Do not display job's address and email if private to users with only ax directory...
[platal.git] / modules / survey.php
index 8ce9d73..3c53625 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -109,7 +109,7 @@ class SurveyModule extends PLModule
         } elseif (!$survey->isEnded() && !$survey->canSeeEarlyResults(S::user())) {
             return $this->show_error($page, "Le sondage ".$survey->getTitle()." n'est pas encore terminé.", 'survey');
         }
-        if (!$this->check_surveyPerms($page, $survey)) {
+        if (!$survey->canSeeEarlyResults(S::user()) && !$this->check_surveyPerms($page, $survey)) {
             return PL_DO_AUTH;
         }
         if ($show == 'csv') {