X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxorgsession.php;h=798d8387ee600182d218b0c87f7490b75f101f88;hb=07e4a9a091ac34c84129c230cde455de34e1ae91;hp=d0efe9d777a6814f745f6530ed131b473a1cfe94;hpb=959221f7482b51bb1b3f03d86aeabc0bd246205a;p=platal.git diff --git a/classes/xorgsession.php b/classes/xorgsession.php index d0efe9d..798d838 100644 --- a/classes/xorgsession.php +++ b/classes/xorgsession.php @@ -1,6 +1,6 @@ id()); + if (is_null($user)) { + Platal::page()->trigError(self::TEXT_INVALID_LOGIN); + $success = false; } else { - $success = $this->checkPassword($login, $user, Post::v('response')); + if (S::suid()) { + $success = (S::suid('uid') == $user->id()); + } else { + $success = $this->checkPassword($login, $user, Post::v('response')); + } } if ($success) { @@ -178,6 +183,13 @@ class XorgSession extends PlSession $this->setAccessCookie(false, S::i('auth_by_cookie') != $user->id()); } else { $this->killAccessCookie(); + + // If login for an external website and not activating cookie, + // mark that we want to disconnect once external auth checks + // have been performed. + if (Post::b('external_auth')) { + S::set('external_auth_exit', true); + } } }