Skip to content

Commit

Permalink
Fixed issue #19093: [security] Improper Authorization in Import Quest…
Browse files Browse the repository at this point in the history
…ion function (#3513)

Co-authored-by: Lapiu Dev <devgit@lapiu.biz>
Co-authored-by: Denis Chenu <denis@sondages.pro>
  • Loading branch information
3 people committed Oct 26, 2023
1 parent 238c399 commit b1f44b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/controllers/QuestionAdministrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,12 @@ public function actionImport()
$iSurveyID = (int) App()->request->getPost('sid', 0);
$gid = (int) App()->request->getPost('gid', 0);

if (!Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'import')) {
App()->session['flashmessage'] = gT("We are sorry but you don't have permissions to do this.");
/* Same redirect than importView */
$this->redirect(['questionAdministration/listquestions/surveyid/' . $iSurveyID]);
}

$jumptoquestion = (bool)App()->request->getPost('jumptoquestion', 1);

$oSurvey = Survey::model()->findByPk($iSurveyID);
Expand Down

0 comments on commit b1f44b8

Please sign in to comment.