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
199d96d
..
6fadc20
100644
(file)
--- a/
modules/survey.php
+++ b/
modules/survey.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
09
Polytechnique.org *
+ * Copyright (C) 2003-20
10
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-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.");
}
}