diff --git a/application/Libraries/Aauth.php b/application/Libraries/Aauth.php index 6ebe938..5122772 100644 --- a/application/Libraries/Aauth.php +++ b/application/Libraries/Aauth.php @@ -623,6 +623,8 @@ class Aauth return false; } + print_r($loginAttemptModel->find()); + // if ($this->config->ddos_protection && $this->config->recaptcha_active && $loginAttempts->get() > $this->config->recaptcha_login_attempts){ // $this->CI->load->helper('recaptchalib'); // $reCaptcha = new ReCaptcha( $this->config->recaptcha_secret); @@ -635,7 +637,6 @@ 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')); diff --git a/tests/Aauth/Libraries/Aauth/ErrorsTest.php b/tests/Aauth/Libraries/Aauth/ErrorsTest.php index 7d9b096..e3e7175 100644 --- a/tests/Aauth/Libraries/Aauth/ErrorsTest.php +++ b/tests/Aauth/Libraries/Aauth/ErrorsTest.php @@ -88,26 +88,40 @@ class ErrorsTest extends \CIUnitTestCase $session = $this->getInstance(); $this->library = new Aauth(NULL, $session); $this->library->error('test message 1', true); - $this->assertEquals(['test message 1'], $session->get('errors')); + $this->assertEquals(['test message 1'], $session->getFlashdata('errors')); $this->library->clearErrors(); - $this->assertNull($session->get('errors')); + $this->assertNull($session->getFlashdata('errors')); } public function testErrorsFlash() { $session = $this->getInstance(); $this->library = new Aauth(NULL, $session); - $this->assertNull($session->get('errors')); + $this->assertNull($session->getFlashdata('errors')); $this->library->error('test message 1', true); - $this->assertEquals(['test message 1'], $session->get('errors')); + $session->start(); + $this->assertEquals(['test message 1'], $session->getFlashdata('errors')); + } + + public function testErrorsFlashKeep() + { + $session = $this->getInstance(); + $this->library = new Aauth(NULL, $session); + $this->assertNull($session->getFlashdata('errors')); + $this->library->error('test message 1', true); + $session->start(); + $this->library->keepErrors(); + $session->start(); + $this->assertEquals(['test message 1'], $this->library->getErrorsArray()); } public function testErrorsFlashArray() { $session = $this->getInstance(); $this->library = new Aauth(NULL, $session); - $this->assertNull($session->get('errors')); + $this->assertNull($session->getFlashdata('errors')); $this->library->error(['test message 1','test message 2'], true); - $this->assertEquals(['test message 1','test message 2'], $session->get('errors')); + $session->start(); + $this->assertEquals(['test message 1','test message 2'], $session->getFlashdata('errors')); } }