- if (!$survey->isMode(Survey::MODE_ALL)) { // if the survey is reserved to alumni
- if (!S::logged()) {
- return false;
- }
- $profile = S::user()->profile();
- if (!$profile) {
- return false;
- }
- // checks promotion
- $allowed = false;
- foreach ($profile->yearspromo() as $p) {
- if ($survey->checkPromo($p)) {
- $allowed = true;
- break;
- }
+ if ($survey->isMode(Survey::MODE_ALL)) { // if the survey is not reserved to alumni
+ return true;
+ }
+ if (!S::logged()) {
+ return false;
+ }
+ $profile = S::user()->profile();
+ if (!$profile) {
+ return false;
+ }
+ // checks promotion
+ $allowed = false;
+ foreach ($profile->yearspromo() as $p) {
+ if ($survey->checkPromo($p)) {
+ $allowed = true;
+ break;