add scrutinizer suggestion
This commit is contained in:
@ -122,21 +122,23 @@ class SettingsForm extends Model
|
|||||||
{
|
{
|
||||||
if ($this->validate()) {
|
if ($this->validate()) {
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$user->scenario = 'settings';
|
if ($user instanceof User) {
|
||||||
$user->username = $this->username;
|
$user->scenario = 'settings';
|
||||||
$user->password = $this->new_password;
|
$user->username = $this->username;
|
||||||
if ($this->email == $user->email && $user->unconfirmed_email != null) {
|
$user->password = $this->new_password;
|
||||||
$user->unconfirmed_email = null;
|
if ($this->email == $user->email && $user->unconfirmed_email != null) {
|
||||||
} elseif ($this->email != $user->email) {
|
$user->unconfirmed_email = null;
|
||||||
$strategy = EmailChangeStrategyFactory::makeByStrategyType(
|
} elseif ($this->email != $user->email) {
|
||||||
$this->getModule()->emailChangeStrategy,
|
$strategy = EmailChangeStrategyFactory::makeByStrategyType(
|
||||||
$this
|
$this->getModule()->emailChangeStrategy,
|
||||||
);
|
$this
|
||||||
|
);
|
||||||
|
|
||||||
return $strategy->run();
|
return $strategy->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $user->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $user->save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user