X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Forange.inc.php;h=ae5f3eef8cb603a39efef41f2aaea5b3aadba188;hb=4ca15c312b905eea712b71d077c7a8b24f9d3b01;hp=2cd391810780c2b941d05b802f960ab2ba1dd410;hpb=ea74d2785d9c1ff5571ebf2f73c89cbf19c8dd07;p=platal.git diff --git a/include/validations/orange.inc.php b/include/validations/orange.inc.php index 2cd3918..ae5f3ee 100644 --- a/include/validations/orange.inc.php +++ b/include/validations/orange.inc.php @@ -1,6 +1,6 @@ promo_sortie = $_sortie; - $res = XDB::query("SELECT promo FROM auth_user_md5 WHERE user_id = {?}", $_user->id()); + $res = XDB::query("SELECT entry_year + FROM profile_education + WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $_uid); + $this->promo = $res->fetchOneCell(); } // }}} @@ -65,10 +68,11 @@ class OrangeReq extends Validate protected function _mail_body($isok) { if ($isok) { - $res = " La demande de changement de promo de sortie que tu as demandée vient d'être effectuée."; - return $res; + return " La demande de changement de promotion de sortie que tu as demandée vient d'être effectuée. " + . "Si tu le souhaites, tu peux maintenant modifier l'affichage de ta promotion sur le site sur la page suivante : " + . "https://www.polytechnique.org/profile/edit"; } else { - return " La demande de changement de promo de sortie tu avais faite a été refusée."; + return " La demande de changement de promotion de sortie tu avais faite a été refusée."; } } @@ -77,7 +81,9 @@ class OrangeReq extends Validate public function commit() { - XDB::execute("UPDATE auth_user_md5 set promo_sortie = {?} WHERE user_id = {?}",$this->promo_sortie, $this->user->id()); + XDB::execute("UPDATE profile_education + SET grad_year = {?} + WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->promo_sortie, $this->uid); return true; }