Update Profile\Email page for auto calc {hash}
This commit is contained in:
parent
94bac9255a
commit
985e24d6cd
1 changed files with 3 additions and 3 deletions
|
@ -26,7 +26,7 @@ class Email extends Profile
|
|||
{
|
||||
if (
|
||||
$this->user->id !== $args['id']
|
||||
|| ! \hash_equals($args['hash'], $this->c->Secury->hash($args['id'] . $args['email'] . $args['key']))
|
||||
|| ! $this->c->Csrf->verify($args['hash'], 'SetNewEmail', $args)
|
||||
|| ! \hash_equals($this->user->activate_string, $args['key'])
|
||||
) {
|
||||
return $this->c->Message->message('Bad request', false);
|
||||
|
@ -131,15 +131,15 @@ class Email extends Profile
|
|||
->page('EditUserProfile', $args)
|
||||
->message('Email changed redirect');
|
||||
} else {
|
||||
$this->c->Csrf->setHashExpiration(259200); // ???? хэш действует 72 часа
|
||||
|
||||
$key = $this->c->Secury->randomPass(33);
|
||||
$hash = $this->c->Secury->hash($this->curUser->id . $v->new_email . $key);
|
||||
$link = $this->c->Router->link(
|
||||
'SetNewEmail',
|
||||
[
|
||||
'id' => $this->curUser->id,
|
||||
'email' => $v->new_email,
|
||||
'key' => $key,
|
||||
'hash' => $hash,
|
||||
]
|
||||
);
|
||||
$tplData = [
|
||||
|
|
Loading…
Add table
Reference in a new issue