summaryrefslogtreecommitdiff
path: root/includes/pages/admin_user.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2012-12-25 19:30:53 +0100
committerPhilip Häusler <msquare@notrademark.de>2012-12-25 19:30:53 +0100
commitb8854f7158cc279a0720065425718fd5bb864206 (patch)
tree07a6b9ec3ebe8cdd2fa3fb24538505c276ad8bef /includes/pages/admin_user.php
parent419da73bef1b44e4295cda780b3d992236f2036b (diff)
right fix
Diffstat (limited to 'includes/pages/admin_user.php')
-rw-r--r--includes/pages/admin_user.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php
index 9fc88e69..6593cced 100644
--- a/includes/pages/admin_user.php
+++ b/includes/pages/admin_user.php
@@ -184,10 +184,10 @@ function admin_user() {
switch ($_REQUEST['action']) {
case 'save_groups' :
if ($id != $user['UID']) {
- list ($my_highest_group) = sql_select("SELECT * FROM `UserGroups` WHERE `uid`=" . sql_escape($user['UID']) . " ORDER BY `group_id`");
- list ($his_highest_group) = sql_select("SELECT * FROM `UserGroups` WHERE `uid`=" . sql_escape($id) . " ORDER BY `group_id`");
+ $my_highest_group = sql_select("SELECT * FROM `UserGroups` WHERE `uid`=" . sql_escape($user['UID']) . " ORDER BY `group_id`");
+ $his_highest_group = sql_select("SELECT * FROM `UserGroups` WHERE `uid`=" . sql_escape($id) . " ORDER BY `group_id`");
- if ($my_highest_group['group_id'] <= $his_highest_group['group_id']) {
+ if (count($my_highest_group) > 0 && (count($his_highest_group) == 0 || ($my_highest_group[0]['group_id'] <= $his_highest_group[0]['group_id']))) {
$groups = sql_select("SELECT * FROM `Groups` LEFT OUTER JOIN `UserGroups` ON (`UserGroups`.`group_id` = `Groups`.`UID` AND `UserGroups`.`uid` = " . sql_escape($id) . ") WHERE `Groups`.`UID` >= " . sql_escape($my_highest_group['group_id']) . " ORDER BY `Groups`.`Name`");
$grouplist = array ();
foreach ($groups as $group)