Skip to content

Commit

Permalink
Fixed issue: User without superadmin permission can enter comfort upd…
Browse files Browse the repository at this point in the history
…ate page without restriction
  • Loading branch information
eddylackmann committed Oct 14, 2020
1 parent 7804ea5 commit 9a8a031
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/controllers/admin/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ class update extends Survey_Common_Action
*/
public function index()
{
if (!Permission::model()->hasGlobalPermission('superadmin')) {
Yii::app()->setFlashMessage(gT('You are not allowed to enter this page'), 'error');
$this->getController()->redirect(Yii::app()->getController()->createUrl("/admin"));
}

if (Yii::app()->getConfig('demoMode')) {
Yii::app()->setFlashMessage(gT('This function cannot be executed because demo mode is active.'), 'error');
$this->getController()->redirect(Yii::app()->getController()->createUrl("/admin"));
Expand Down

4 comments on commit 9a8a031

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, please … send 403 error …

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then : sys admin can check who try to hack server …

@eddylackmann
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Shnoulle hahaha yes make sense . but you have to log in anyway before try to do something..
But i will add a 403

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddylackmann : yes, it is an old habit on LimeSurvey to use redirects for 401/403 errors. I think it's a bad habit :)

See https://bugs.limesurvey.org/view.php?id=16470 for discussion .

Please sign in to comment.