Skip to content

Commit

Permalink
refs #478-custom-emails fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
steinkel committed Aug 29, 2017
2 parents 584dfbe + aaba9f1 commit 002cbb2
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .semver
@@ -1,5 +1,5 @@
---
:major: 5
:minor: 0
:patch: 3
:minor: 1
:patch: 0
:special: ''
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,13 @@ Changelog
Releases for CakePHP 3
-------------

* 5.1.0
* New resend validation method in RegisterBehavior
* Allow upgrade to CakePHP 3.5.x
* New feature connect social account
* New polish translations
* Fixed bugs reported

* 5.0.3
* Implemented event dispatching on social login
* Fixed bugs reported
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -28,7 +28,7 @@
},
"require": {
"cakephp/cakephp": "^3.4.0",
"cakedc/auth": "^1.0"
"cakedc/auth": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^5.0",
Expand Down
3 changes: 3 additions & 0 deletions src/Controller/Component/RememberMeComponent.php
Expand Up @@ -106,6 +106,9 @@ public function setLoginCookie(Event $event)
return;
}
$user['user_agent'] = $this->getController()->request->getHeaderLine('User-Agent');
if (!(bool)$this->getController()->request->getData(Configure::read('Users.Key.Data.rememberMe'))) {
return;
}
$this->Cookie->write($this->_cookieName, $user);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Controller/Traits/PasswordManagementTrait.php
Expand Up @@ -15,6 +15,7 @@
use CakeDC\Users\Exception\UserNotFoundException;
use CakeDC\Users\Exception\WrongPasswordException;
use Cake\Core\Configure;
use Cake\Log\Log;
use Cake\Validation\Validator;
use Exception;

Expand Down Expand Up @@ -137,7 +138,7 @@ public function requestResetPassword()
$this->Flash->error(__d('CakeDC/Users', 'The user is not active'));
} catch (Exception $exception) {
$this->Flash->error(__d('CakeDC/Users', 'Token could not be reset'));
$this->log($exception->getMessage());
Log::error($exception->getMessage());
}
}

Expand Down
Expand Up @@ -93,7 +93,6 @@ public function tearDown()
*/
public function testInitialize()
{
$this->Registry->unload('GoogleAuthenticator');
$this->Controller->GoogleAuthenticator = new GoogleAuthenticatorComponent($this->Registry);
$this->assertInstanceOf('CakeDC\Users\Controller\Component\GoogleAuthenticatorComponent', $this->Controller->GoogleAuthenticator);
}
Expand Down
Expand Up @@ -121,7 +121,8 @@ public function testSetLoginCookie()
->setMethods(['write'])
->disableOriginalConstructor()
->getMock();
$this->rememberMeComponent->request = (new ServerRequest('/'))->env('HTTP_USER_AGENT', 'user-agent');
$this->rememberMeComponent->request = (new ServerRequest('/'))->env('HTTP_USER_AGENT', 'user-agent')
->withData(Configure::read('Users.Key.Data.rememberMe'), '1');
$this->rememberMeComponent->Cookie->expects($this->once())
->method('write')
->with('remember_me', ['id' => 1, 'user_agent' => 'user-agent']);
Expand Down

0 comments on commit 002cbb2

Please sign in to comment.