X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Freminder%2Fpromotion_ml.inc.php;h=c311e13ade6c63b53edf9ed5e6a7e9f22f9ac398;hb=f3bfd6c9a14b70736b9416a1892d7548e160880b;hp=1156e2a4ce4a62b23099d1b5126766cfecd3401c;hpb=00ba8a742be0cfc70eef7c6aaaccebe7134ec087;p=platal.git diff --git a/include/reminder/promotion_ml.inc.php b/include/reminder/promotion_ml.inc.php index 1156e2a..c311e13 100644 --- a/include/reminder/promotion_ml.inc.php +++ b/include/reminder/promotion_ml.inc.php @@ -1,6 +1,6 @@ id(), $user->profile()->yearPromo()); $mmlist = new MMList($user); $mmlist->subscribe('promo' . $user->profile()->yearPromo()); @@ -60,7 +60,7 @@ class ReminderPromotionMl extends Reminder return "Inscription à la liste de diffusion de ta promotion"; } - public static function IsCandidate(User &$user, $candidate) + public static function IsCandidate(User $user, $candidate) { $profile = $user->profile(); if (!$profile) { @@ -79,7 +79,16 @@ class ReminderPromotionMl extends Reminder if ($mlCount) { Reminder::MarkCandidateAsAccepted($user->id(), $candidate); } - return ($mlCount == 0); + if ($mlCount == 0) { + $mmlist = new MMList($user); + try { + $mmlist->get_members_limit('promo' + $user->profile()->yearPromo(), + 0, 0); + } catch (Exception $e) { + return false; + } + } + return false; } }