mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
If you customize the permissions and restore the menu it puts the permissions back to default. Therefore I'm removing the restore permissions on the menu class and moving it to the a button on the group permissions page.
This commit is contained in:
@@ -17,14 +17,14 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Copyright (C) 2010
|
Copyright (C) 2013
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//define the follow me class
|
//define the menu class
|
||||||
class menu {
|
class menu {
|
||||||
public $menu_uuid;
|
public $menu_uuid;
|
||||||
|
|
||||||
@@ -150,45 +150,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($apps as $row) {
|
|
||||||
foreach ($row['permissions'] as $menu) {
|
|
||||||
//set the variables
|
|
||||||
if ($menu['groups']) {
|
|
||||||
foreach ($menu['groups'] as $group) {
|
|
||||||
//if the item uuid is not currently in the db then add it
|
|
||||||
$sql = "select * from v_group_permissions ";
|
|
||||||
$sql .= "where permission_name = '".$menu['name']."' ";
|
|
||||||
$sql .= "and domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
||||||
$sql .= "and group_name = '$group' ";
|
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
|
||||||
if ($prep_statement) {
|
|
||||||
$prep_statement->execute();
|
|
||||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
unset ($prep_statement);
|
|
||||||
if (count($result) == 0) {
|
|
||||||
//insert the default menu into the database
|
|
||||||
$sql = "insert into v_group_permissions ";
|
|
||||||
$sql .= "(";
|
|
||||||
$sql .= "group_permission_uuid, ";
|
|
||||||
$sql .= "domain_uuid, ";
|
|
||||||
$sql .= "permission_name, ";
|
|
||||||
$sql .= "group_name ";
|
|
||||||
$sql .= ") ";
|
|
||||||
$sql .= "values ";
|
|
||||||
$sql .= "(";
|
|
||||||
$sql .= "'".uuid()."', ";
|
|
||||||
$sql .= "'".$_SESSION["domain_uuid"]."', ";
|
|
||||||
$sql .= "'".$menu['name']."', ";
|
|
||||||
$sql .= "'".$group."' ";
|
|
||||||
$sql .= ");";
|
|
||||||
$db->exec(check_sql($sql));
|
|
||||||
unset($sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//if there are no groups listed in v_menu_item_groups under menu_uuid then add the default groups
|
//if there are no groups listed in v_menu_item_groups under menu_uuid then add the default groups
|
||||||
foreach($apps as $app) {
|
foreach($apps as $app) {
|
||||||
|
|||||||
Reference in New Issue
Block a user