Add autofocus for the two forms

This commit is contained in:
Visman 2021-02-16 15:59:03 +07:00
parent d303f1a002
commit 7ffe8aa00e
2 changed files with 3 additions and 2 deletions

View file

@ -25,9 +25,8 @@ class Email extends Profile
public function setEmail(array $args, string $method): Page
{
if (
$this->user->id !== (int) $args['id']
$this->user->id !== $args['id']
|| ! \hash_equals($args['hash'], $this->c->Secury->hash($args['id'] . $args['email'] . $args['key']))
|| empty($this->user->activate_string)
|| ! \hash_equals($this->user->activate_string, $args['key'])
) {
return $this->c->Message->message('Bad request', false);
@ -189,6 +188,7 @@ class Email extends Profile
'class' => 'data-edit',
'fields' => [
'new_email' => [
'autofocus' => true,
'type' => 'text',
'maxlength' => '80',
'caption' => __($this->rules->confirmEmail ? 'New or old email' : 'New email'),

View file

@ -103,6 +103,7 @@ class Pass extends Profile
'class' => 'data-edit',
'fields' => [
'new_pass' => [
'autofocus' => true,
'type' => 'password',
'caption' => __('New pass'),
'required' => true,