Skip to content

Commit

Permalink
Fixed Issue #10062: SuperAdmin can't add users to not-owned UserGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljenik committed Nov 27, 2015
1 parent 9b21a0d commit f5bee51
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/controllers/admin/usergroups.php
Expand Up @@ -278,7 +278,8 @@ public function index($ugid = false, $header = false)
$eguquery = "SELECT * FROM {{user_in_groups}} AS a INNER JOIN {{users}} AS b ON a.uid = b.uid WHERE ugid = " . $ugid . " ORDER BY b.users_name";
$eguresult = dbExecuteAssoc($eguquery);
$aUserInGroupsResult = $eguresult->readAll();
$query2 = "SELECT ugid FROM {{user_groups}} WHERE ugid = " . $ugid . " AND owner_id = " . Yii::app()->session['loginID'];
$query2 = "SELECT ugid FROM {{user_groups}} WHERE ugid = " . $ugid;
if (!Permission::model()->hasGlobalPermission('superadmin','read')) $query2 .= " AND owner_id = " . Yii::app()->session['loginID'];
$result2 = dbSelectLimitAssoc($query2, 1);
$row2 = $result2->readAll();
$row = 1;
Expand Down

0 comments on commit f5bee51

Please sign in to comment.