I should have merged before last commit...
[platal.git] / modules / survey / survey.inc.php
index 497a7f8..852c5e8 100644 (file)
@@ -348,6 +348,9 @@ class Survey
         default:
             return null;
         }
+        if (!S::user()->checkPerms(PERMS_USER)) {
+            $where .=  XDB::format(' AND mode = {?}', self::MODE_ALL);
+        }
         $sql = 'SELECT id, title, end, mode
                   FROM surveys
                  WHERE '.$where.'