X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=classes%2Fxnetsession.php;h=27ed4d8b638549643b29121c90d5d462a8ddf932;hb=a67a14b4ab7ea2661f7cdbd1e201be6a0aaf6193;hp=765ad5eb54ec22708aa68a40303434325eaa1871;hpb=137f046d4f1d3fcfdd077a9ae0c7d7585eb0de3d;p=platal.git diff --git a/classes/xnetsession.php b/classes/xnetsession.php index 765ad5e..27ed4d8 100644 --- a/classes/xnetsession.php +++ b/classes/xnetsession.php @@ -35,11 +35,12 @@ class XnetSession extends XorgSession } if (!S::logged() && Post::has('auth_type') && Post::v('auth_type') == 'xnet' && !Post::has('wait')) { + $email = Post::v('username'); $type = XDB::fetchOneCell('SELECT type FROM accounts - WHERE hruid = {?}', - Post::v('username')); - if (!is_null($type) && $type != 'xnet') { + WHERE email = {?}', + $email); + if ((!is_null($type) && $type != 'xnet') || !User::isForeignEmailAddress($email)) { Platal::page()->trigErrorRedirect('Ce formulaire d\'authentification est réservé aux extérieurs à la communauté polytechnicienne.', ''); }