From: Florent Bruneau Date: Wed, 22 Oct 2008 19:54:19 +0000 (+0200) Subject: Modules MUST NOT try to reproduce authentication stuff from platal.php. X-Git-Tag: xorg/0.10.0~74 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6997b0996491b5180fe4809fa90ce4596b837018;p=platal.git Modules MUST NOT try to reproduce authentication stuff from platal.php. Signed-off-by: Florent Bruneau --- diff --git a/core b/core index 029135c..30b4d21 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 029135c8d7891915fb00fdc5352ba57dc5fa2837 +Subproject commit 30b4d2149c5fa19fccb09a4f6b286b3a52344245 diff --git a/modules/survey.php b/modules/survey.php index f493b4e..93e471a 100644 --- a/modules/survey.php +++ b/modules/survey.php @@ -67,7 +67,7 @@ class SurveyModule extends PLModule return $this->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); } + } // }}}