fix unpassable condition in EmailChangeService

This commit is contained in:
borisaeric
2018-08-20 17:36:45 +02:00
parent 275d4e259c
commit 2cf884ac96
3 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# CHANGELOG # CHANGELOG
## 1.5.0 - Work in progress ## 1.5.0 - Work in progress
- Fix: Fix condition in EmailChangeService (it was always false) (borisaeric)
- Fix #198: Updated translations by quique, bizley, TonisOrmisson, guogan, Dezinger, maxxer, wautvda, mrbig00 - Fix #198: Updated translations by quique, bizley, TonisOrmisson, guogan, Dezinger, maxxer, wautvda, mrbig00
- Fix #209: Doc fix. allowAccountDelete default value is false (Dezinger) - Fix #209: Doc fix. allowAccountDelete default value is false (Dezinger)
- Fix #211: Migration boolean default value set to FALSE instead 0 (Dezinger) - Fix #211: Migration boolean default value set to FALSE instead 0 (Dezinger)

View File

@ -65,7 +65,7 @@ class User extends ActiveRecord implements IdentityInterface
use ContainerAwareTrait; use ContainerAwareTrait;
// following constants are used on secured email changing process // following constants are used on secured email changing process
const OLD_EMAIL_CONFIRMED = 0b1; const OLD_EMAIL_CONFIRMED = 0b01;
const NEW_EMAIL_CONFIRMED = 0b10; const NEW_EMAIL_CONFIRMED = 0b10;
/** /**

View File

@ -76,7 +76,7 @@ class EmailChangeService implements ServiceInterface
); );
} }
} }
if (($this->model->flags & User::NEW_EMAIL_CONFIRMED & $this->model->flags & User::OLD_EMAIL_CONFIRMED) if ((($this->model->flags & User::NEW_EMAIL_CONFIRMED) && ($this->model->flags & User::OLD_EMAIL_CONFIRMED))
|| $this->getModule()->emailChangeStrategy === MailChangeStrategyInterface::TYPE_DEFAULT || $this->getModule()->emailChangeStrategy === MailChangeStrategyInterface::TYPE_DEFAULT
) { ) {
$this->model->email = $this->model->unconfirmed_email; $this->model->email = $this->model->unconfirmed_email;