Change where preLogin hook gets called
Signed-off-by: Sandro Lutz <sandro.lutz@temparus.ch>
This commit is contained in:
parent
6ab0a3215d
commit
e30d28f7eb
|
@ -215,6 +215,8 @@ class LoginController extends Controller {
|
|||
return $this->generateRedirect($redirect_url);
|
||||
}
|
||||
|
||||
$this->userManager->emit('\OC\User', 'preLogin', array($user, $password));
|
||||
|
||||
$originalUser = $user;
|
||||
// TODO: Add all the insane error handling
|
||||
/* @var $loginResult IUser */
|
||||
|
|
|
@ -319,6 +319,8 @@ class Session implements IUserSession, Emitter {
|
|||
OC\Security\Bruteforce\Throttler $throttler) {
|
||||
$currentDelay = $throttler->sleepDelay($request->getRemoteAddress());
|
||||
|
||||
$this->manager->emit('\OC\User', 'preLogin', array($user, $password));
|
||||
|
||||
$isTokenPassword = $this->isTokenPassword($password);
|
||||
if (!$isTokenPassword && $this->isTokenAuthEnforced()) {
|
||||
throw new PasswordLoginForbiddenException();
|
||||
|
@ -463,7 +465,6 @@ class Session implements IUserSession, Emitter {
|
|||
* @throws LoginException if an app canceld the login process or the user is not enabled
|
||||
*/
|
||||
private function loginWithPassword($uid, $password) {
|
||||
$this->manager->emit('\OC\User', 'preLogin', array($uid, $password));
|
||||
$user = $this->manager->checkPassword($uid, $password);
|
||||
if ($user === false) {
|
||||
// Password check failed
|
||||
|
@ -513,8 +514,6 @@ class Session implements IUserSession, Emitter {
|
|||
// Ignore and use empty string instead
|
||||
}
|
||||
|
||||
$this->manager->emit('\OC\User', 'preLogin', array($uid, $password));
|
||||
|
||||
$user = $this->manager->get($uid);
|
||||
if (is_null($user)) {
|
||||
// user does not exist
|
||||
|
|
Loading…
Reference in New Issue