Update login() method
This commit is contained in:
parent
210474637b
commit
b3a617b3b2
2 changed files with 4 additions and 4 deletions
|
@ -47,7 +47,7 @@ class Auth extends Page
|
|||
/**
|
||||
* Вход на форум
|
||||
*/
|
||||
public function login(array $args, string $method): Page
|
||||
public function login(array $args, string $method, string $username = ''): Page
|
||||
{
|
||||
$this->c->Lang->load('validator');
|
||||
$this->c->Lang->load('auth');
|
||||
|
@ -98,7 +98,7 @@ class Auth extends Page
|
|||
$this->titles = __('Login');
|
||||
$this->regLink = '1' == $this->c->config->o_regs_allow ? $this->c->Router->link('Register') : null;
|
||||
|
||||
$username = $v ? $v->username : ($args['_username'] ?? '');
|
||||
$username = $v ? $v->username : $username;
|
||||
$save = $v ? $v->save : 1;
|
||||
$redirect = $v ? $v->redirect : $this->c->Router->validate($ref, 'Index');
|
||||
$this->form = $this->formLogin($username, $save, $redirect);
|
||||
|
|
|
@ -272,7 +272,7 @@ class Register extends Page
|
|||
$auth = $this->c->Auth;
|
||||
$auth->fIswev = ['s', __('Reg complete')];
|
||||
|
||||
return $auth->login(['_username' => $v->username], 'GET');
|
||||
return $auth->login([], 'GET', $v->username);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,6 +309,6 @@ class Register extends Page
|
|||
$auth = $this->c->Auth;
|
||||
$auth->fIswev = ['s', __('Reg complete')];
|
||||
|
||||
return $auth->login(['_username' => $user->username], 'GET');
|
||||
return $auth->login([], 'GET', $user->username);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue