Browse Source

updated Libraries/Aauth & Aauth/LoginTest

v3-dev
REJack 6 years ago
parent
commit
4f2ffb1ee9
No known key found for this signature in database
GPG Key ID: 4A44B48700429F46
  1. 5
      application/Libraries/Aauth.php
  2. 5
      tests/Aauth/Libraries/Aauth/LoginTest.php

5
application/Libraries/Aauth.php

@ -616,8 +616,6 @@ class Aauth
$loginAttemptModel = new LoginAttemptModel();
$userVariableModel = new UserVariableModel();
print_r($this->config);
if ($this->config->loginProtection && ! $loginAttemptModel->save())
{
$this->error(lang('Aauth.loginAttemptsExceeded'));
@ -637,6 +635,7 @@ class Aauth
if ($this->config->loginUseUsername)
{
print_r($this->config);
if (! $identifier || strlen($password) < $this->config->passwordMin || strlen($password) > $this->config->passwordMax)
{
$this->error(lang('Aauth.loginFailedUsername'));
@ -794,7 +793,7 @@ class Aauth
{
helper('cookie');
set_cookie('remember', '', -3600);
$this->session->destroy();
@$this->session->destroy();
}
/**

5
tests/Aauth/Libraries/Aauth/LoginTest.php

@ -83,7 +83,7 @@ class LoginTest extends CIDatabaseTestCase
{
$session = $this->getInstance();
$this->library = new Aauth(null, $session);
$this->assertFalse($this->library->login('admin@example.com', 'password'));
$this->assertFalse($this->library->login('admin@example.com', 'passwor'));
$this->assertEquals(lang('Aauth.loginFailedEmail'), $this->library->getErrorsArray()[0]);
}
@ -120,7 +120,7 @@ class LoginTest extends CIDatabaseTestCase
$config = new AauthConfig();
$config->loginUseUsername = true;
$this->library = new Aauth($config, $session);
$this->assertFalse($this->library->login('admina', 'password'));
$this->assertFalse($this->library->login('user99', 'password123456'));
$this->assertEquals(lang('Aauth.notFoundUser'), $this->library->getErrorsArray()[0]);
$config->loginUseUsername = false;
}
@ -165,6 +165,7 @@ class LoginTest extends CIDatabaseTestCase
$this->library->login('admina@example.com', 'password123456');
$this->library->login('admina@example.com', 'password123456');
$this->library->login('admina@example.com', 'password123456');
$this->library->login('admina@example.com', 'password123456');
$this->assertFalse($this->library->login('admina@example.com', 'password123456'));
$this->assertEquals(lang('Aauth.loginAttemptsExceeded'), $this->library->getErrorsArray()[0]);
}

Loading…
Cancel
Save