Skip to content

Commit

Permalink
Dev Fixed Scrutinizer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Nov 27, 2017
1 parent 381862d commit fa6e9dc
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 172 deletions.
1 change: 0 additions & 1 deletion application/controllers/admin/surveyadmin.php
Expand Up @@ -944,7 +944,6 @@ public function rendersidemenulink($iSurveyID, $subaction)
if (!(Permission::model()->hasSurveyPermission($iSurveyID, $menuEntry->permission, $menuEntry->permission_grade))) {
Yii::app()->setFlashMessage(gT("You do not have permission to access this page."), 'error');
$this->getController()->redirect(array('admin/survey', 'sa'=>'view', 'surveyid'=>$iSurveyID));
Yii::app()->end();
}

$templateData = is_array($menuEntry->data) ? $menuEntry->data : [];
Expand Down
8 changes: 4 additions & 4 deletions application/controllers/admin/surveypermission.php
Expand Up @@ -75,7 +75,7 @@ public function index($iSurveyID)
// Foot first

if (Yii::app()->getConfig('usercontrolSameGroupPolicy') == true) {
$authorizedGroupsList = getUserGroupList(null, 'simplegidarray');
$authorizedGroupsList = getUserGroupList();
}

$surveysecurity .= "<tbody>\n";
Expand Down Expand Up @@ -202,7 +202,7 @@ public function index($iSurveyID)
. "<li><label class='col-sm-1 col-md-offset-2 text-right control-label' for='uidselect'>".gT("User").": </label>
<div class='col-sm-4'>
<select id='uidselect' name='uid' class='form-control'>\n"
. getSurveyUserList(false, false, $iSurveyID)
. getSurveyUserList( false, $iSurveyID)
. "</select></div>\n"
. "<input style='width: 15em;' class='btn btn-default' type='submit' value='".gT("Add user")."' onclick=\"if (document.getElementById('uidselect').value == -1) { alert('".gT("Please select a user first", "js")."'); return false;}\"/>"
. "<input type='hidden' name='action' value='addsurveysecurity' />"
Expand Down Expand Up @@ -430,7 +430,7 @@ function set($surveyid)
$this->getController()->error('Access denied');
}
} elseif ($action == "setusergroupsurveysecurity") {
if (!Permission::model()->hasGlobalPermission('superadmin', 'read') && !in_array($postusergroupid, getUserGroupList(null, 'simplegidarray'))) {
if (!Permission::model()->hasGlobalPermission('superadmin', 'read') && !in_array($postusergroupid, getUserGroupList())) {
// User can not change own security (except for superadmin ?)
$this->getController()->error('Access denied');
}
Expand Down Expand Up @@ -607,7 +607,7 @@ function surveyright($surveyid)

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

Expand Down

0 comments on commit fa6e9dc

Please sign in to comment.