Skip to content

Commit

Permalink
Dev: Factor out getUserList()
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Apr 7, 2016
1 parent f0efa6a commit 9d289b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/controllers/admin/surveypermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,13 @@ function delete($surveyid)
$gid = App()->getRequest()->getParam('gid');
$postuserid = (!empty($uid)) ? $uid : false;
$postusergroupid = (!empty($gid)) ? $gid : false;// Not used
$userList = getUserList('onlyuidarray');

if($postuserid && !in_array($postuserid,getUserList('onlyuidarray')))
if($postuserid && !in_array($postuserid,$userList))
{
$this->getController()->error('Access denied');
}
elseif( $postusergroupid && !in_array($postusergroupid,getUserList('onlyuidarray')))
elseif($postusergroupid && !in_array($postusergroupid, $userList))
{
$this->getController()->error('Access denied');
}
Expand Down

0 comments on commit 9d289b7

Please sign in to comment.