X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Flists.php;h=1ebf75f4e1a25752a08faf19f89edcb577e66253;hb=7bc2c3966c5c7fcf1040d6a8d0b97add182bf1aa;hp=d50eeb2224c494532572aab556c405c334218491;hpb=00ca0ad5370df5be4a0272364fb16a4385ffabfe;p=platal.git diff --git a/modules/lists.php b/modules/lists.php index d50eeb2..1ebf75f 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -112,7 +112,7 @@ class ListsModule extends PLModule if ($promo >= 1900 and $promo < 2100) { $this->client->subscribe("promo$promo"); } else { - $page->trigSuccess("promo incorrecte, il faut une promo sur 4 chiffres."); + $page->trigError("promo incorrecte, il faut une promo sur 4 chiffres."); } } @@ -169,14 +169,20 @@ class ListsModule extends PLModule $page->changeTpl('lists/create.tpl'); - $user_promo = S::i('promo'); + $user_promo = S::user()->profile()->yearPromo(); $year = date('Y'); $month = date('m'); + // scolar year starts in september + $scolarmonth = ($year - $user_promo) * 12 + ($month - 8); $young_promo = $very_young_promo = 0; - if ((($year > $user_promo) && ($month > 3)) && ($year < $user_promo + 5)) { + // binet are accessible only in april in the first year and until + // march of the 5th year + if ($scolarmonth >= 8 && $scolarmonth < 56) { $young_promo = 1; } - if ((($year > $user_promo) && ($month > 7)) && (($year < $user_promo + 1) && ($month < 8))) { + // PSC aliases are accesible only between september and june of the second + // year of scolarity + if ($scolarmonth >= 12 && $scolarmonth < 22) { $very_young_promo = 1; } $page->assign('young_promo', $young_promo); @@ -582,8 +588,7 @@ class ListsModule extends PLModule { global $list_unregistered, $globals; - /* TODO: fixes this call to a removed function. */ - $users = get_not_registered_user($login, true); + $users = User::getPendingAccounts($login, true); if ($users && $users->total()) { if (!isset($list_unregistered)) { $list_unregistered = array();