forçage de mot de passe
This commit is contained in:
parent
dca5418647
commit
d7011da2a3
@ -267,7 +267,7 @@ class user extends common
|
|||||||
) {
|
) {
|
||||||
// Double vérification pour le mot de passe
|
// Double vérification pour le mot de passe
|
||||||
if ($this->getUser('group') < self::GROUP_ADMIN) {
|
if ($this->getUser('group') < self::GROUP_ADMIN) {
|
||||||
$newPassword = $this->getData(['user', $this->getUrl(2), 'password']);
|
$newPassword = $this->getData(['user', $this->getUrl(2), 'password']);
|
||||||
if ($this->getInput('userEditNewPassword')) {
|
if ($this->getInput('userEditNewPassword')) {
|
||||||
// L'ancien mot de passe est correct
|
// L'ancien mot de passe est correct
|
||||||
if (password_verify(html_entity_decode($this->getInput('userEditOldPassword')), $this->getData(['user', $this->getUrl(2), 'password']))) {
|
if (password_verify(html_entity_decode($this->getInput('userEditOldPassword')), $this->getData(['user', $this->getUrl(2), 'password']))) {
|
||||||
@ -288,7 +288,7 @@ class user extends common
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($this->getInput('userEditNewPassword') === $this->getInput('userEditConfirmPassword')) {
|
if ($this->getInput('userEditNewPassword') === $this->getInput('userEditConfirmPassword')) {
|
||||||
$newPassword = $this->getInput('userEditNewPassword', helper::FILTER_PASSWORD, true);
|
$newPassword = $this->getInput('userEditNewPassword', helper::FILTER_PASSWORD);
|
||||||
// Déconnexion de l'utilisateur si il change le mot de passe de son propre compte
|
// Déconnexion de l'utilisateur si il change le mot de passe de son propre compte
|
||||||
if ($this->getUser('id') === $this->getUrl(2)) {
|
if ($this->getUser('id') === $this->getUrl(2)) {
|
||||||
helper::deleteCookie('ZWII_USER_ID');
|
helper::deleteCookie('ZWII_USER_ID');
|
||||||
@ -332,7 +332,7 @@ class user extends common
|
|||||||
'pseudo' => $this->getInput('userEditPseudo', helper::FILTER_STRING_SHORT, true),
|
'pseudo' => $this->getInput('userEditPseudo', helper::FILTER_STRING_SHORT, true),
|
||||||
'signature' => $this->getInput('userEditSignature', helper::FILTER_INT, true),
|
'signature' => $this->getInput('userEditSignature', helper::FILTER_INT, true),
|
||||||
'mail' => $this->getInput('userEditMail', helper::FILTER_MAIL, true),
|
'mail' => $this->getInput('userEditMail', helper::FILTER_MAIL, true),
|
||||||
'password' => $newPassword,
|
'password' => $newPassword ? $newPassword : $this->getData(['user', $this->getUrl(2)], 'password'),
|
||||||
'connectFail' => $this->getData(['user', $this->getUrl(2), 'connectFail']),
|
'connectFail' => $this->getData(['user', $this->getUrl(2), 'connectFail']),
|
||||||
'connectTimeout' => $this->getData(['user', $this->getUrl(2), 'connectTimeout']),
|
'connectTimeout' => $this->getData(['user', $this->getUrl(2), 'connectTimeout']),
|
||||||
'accessUrl' => $this->getData(['user', $this->getUrl(2), 'accessUrl']),
|
'accessUrl' => $this->getData(['user', $this->getUrl(2), 'accessUrl']),
|
||||||
|
Loading…
Reference in New Issue
Block a user