diff --git a/website_code/php/management/modify_roles.php b/website_code/php/management/modify_roles.php index 77ec3fe55..0d2511a71 100644 --- a/website_code/php/management/modify_roles.php +++ b/website_code/php/management/modify_roles.php @@ -70,11 +70,14 @@ if(count($roles_to_unassign) > 0){ $questionMarks = "?"; + $params = array($userid, $roles_to_unassign[0]); for($i = 1; $i < count($roles_to_unassign);$i++){ + $params[] = $roles_to_unassign[$i]; $questionMarks .= ", ?"; + } $query = "delete from logindetailsrole where userid=? and roleid in ({$questionMarks})"; - $result = db_query($query, array($userid, ...$roles_to_unassign)); + $result = db_query($query, $params); if($result === false){ $return .= USERS_FAILED_REMOVE_ROLES . PHP_EOL; } diff --git a/website_code/php/management/user_groups.php b/website_code/php/management/user_groups.php index fcff2a24c..a9e7e74ad 100644 --- a/website_code/php/management/user_groups.php +++ b/website_code/php/management/user_groups.php @@ -36,7 +36,7 @@ * */ -if (is_user_permitted("useradmin", /*"projectadmin"*/)) { +if (is_user_permitted("useradmin")) { $database_id = database_connect("user groups list connected","user groups list failed");