projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Integration of the new BPLC payment system.
[platal.git]
/
modules
/
survey.php
diff --git
a/modules/survey.php
b/modules/survey.php
index
94b39b9
..
6fadc20
100644
(file)
--- a/
modules/survey.php
+++ b/
modules/survey.php
@@
-403,7
+403,19
@@
class SurveyModule extends PLModule
if (!S::logged()) {
return false;
}
if (!S::logged()) {
return false;
}
- if (!$survey->checkPromo(S::v('promo'))) { // checks promotion
+ $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 (!$allowed) {
$page->kill("Tu n'as pas accès à ce sondage car il est réservé à d'autres promotions.");
}
}
$page->kill("Tu n'as pas accès à ce sondage car il est réservé à d'autres promotions.");
}
}