X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fsurvey.php;h=b28aea73a066fd68030a1035a530d6c9ed81cf75;hb=4d7d27fc5c01f66e772a25cad7c1a7d33ea7bf43;hp=f493b4ecd15300fcdf8be683cc7e6c6c1037e8d3;hpb=301e3543efce642475e428cfab02a8a38b4ed3f8;p=platal.git diff --git a/modules/survey.php b/modules/survey.php index f493b4e..b28aea7 100644 --- a/modules/survey.php +++ b/modules/survey.php @@ -1,6 +1,6 @@ show_error($page, "Le sondage ".$survey->getTitle()." est terminé.", 'survey'); } if (!$this->check_surveyPerms($page, $survey)) { - return; + return PL_DO_AUTH; } if (Post::has('survey_submit')) { // checks if the survey has already been filled in $uid = 0; @@ -106,7 +106,7 @@ class SurveyModule extends PLModule return $this->show_error($page, "Le sondage ".$survey->getTitle()." n'est pas encore terminé.", 'survey'); } if (!$this->check_surveyPerms($page, $survey)) { - return; + return PL_DO_AUTH; } if ($show == 'csv') { header('Content-Type: text/csv; charset="UTF-8"'); @@ -400,14 +400,11 @@ class SurveyModule extends PLModule { $this->load('survey.inc.php'); if (!$survey->isMode(Survey::MODE_ALL)) { // if the survey is reserved to alumni - global $globals; - if (!call_user_func(array($globals->session, 'doAuth'))) { // checks authentification - global $platal; - $platal->force_login($page); + if (!S::logged()) { + return false; } if (!$survey->checkPromo(S::v('promo'))) { // checks promotion - $this->show_error($page, "Tu n'as pas accès à ce sondage car il est réservé à d'autres promotions.", 'survey'); - return false; + $page->kill("Tu n'as pas accès à ce sondage car il est réservé à d'autres promotions."); } } return true; @@ -462,6 +459,7 @@ class SurveyModule extends PLModule if (!is_null($errArray)) { $page->assign('survey_errors', $errArray); } + } // }}}