From d4e20d2b7692aa60304b5a6be40b2ceb41bfb654 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Wed, 23 Jan 2013 15:56:00 +0000 Subject: [PATCH] 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. --- includes/classes/menu.php | 43 ++------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/includes/classes/menu.php b/includes/classes/menu.php index 8df00fedf1..ba423e543f 100644 --- a/includes/classes/menu.php +++ b/includes/classes/menu.php @@ -17,14 +17,14 @@ The Initial Developer of the Original Code is Mark J Crane - Copyright (C) 2010 + Copyright (C) 2013 All Rights Reserved. Contributor(s): Mark J Crane */ -//define the follow me class +//define the menu class class menu { 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 foreach($apps as $app) {