Add permissions only if there are groups assigned to the user.

This commit is contained in:
Mark Crane 2014-06-10 21:16:42 +00:00
parent 2070de705e
commit 9458e5b51e
1 changed files with 16 additions and 14 deletions

View File

@ -303,6 +303,7 @@ require_once "resources/require.php";
unset($sql, $row_count, $prep_statement); unset($sql, $row_count, $prep_statement);
//get the permissions assigned to the groups that the user is a member of set the permissions in $_SESSION['permissions'] //get the permissions assigned to the groups that the user is a member of set the permissions in $_SESSION['permissions']
if (count($_SESSION["groups"]) > 0) {
$x = 0; $x = 0;
$sql = "select distinct(permission_name) from v_group_permissions "; $sql = "select distinct(permission_name) from v_group_permissions ";
foreach($_SESSION["groups"] as $field) { foreach($_SESSION["groups"] as $field) {
@ -320,6 +321,7 @@ require_once "resources/require.php";
$prep_statement_sub->execute(); $prep_statement_sub->execute();
$_SESSION['permissions'] = $prep_statement_sub->fetchAll(PDO::FETCH_NAMED); $_SESSION['permissions'] = $prep_statement_sub->fetchAll(PDO::FETCH_NAMED);
unset($sql, $prep_statement_sub); unset($sql, $prep_statement_sub);
}
//get the user settings //get the user settings
$sql = "select * from v_user_settings "; $sql = "select * from v_user_settings ";