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
If statement uses its own {} block
  • Loading branch information
gabrieljenik committed Dec 9, 2015
1 parent f5bee51 commit 1d4307b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/controllers/admin/usergroups.php
Expand Up @@ -279,7 +279,9 @@ public function index($ugid = false, $header = false)
$eguresult = dbExecuteAssoc($eguquery);
$aUserInGroupsResult = $eguresult->readAll();
$query2 = "SELECT ugid FROM {{user_groups}} WHERE ugid = " . $ugid;
if (!Permission::model()->hasGlobalPermission('superadmin','read')) $query2 .= " AND owner_id = " . Yii::app()->session['loginID'];
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 1d4307b

Please sign in to comment.