Fix Profile\Pass page

This commit is contained in:
Visman 2023-07-19 18:53:10 +07:00
parent f66c890db3
commit 688b7d580b
2 changed files with 5 additions and 11 deletions

View file

@ -87,7 +87,8 @@ class Routing
$r->add(
$r::GET,
'/login[/{tail:.*}]',
'Redirect:toIndex'
'Redirect:toIndex',
'Login' // <-- для переадресации со страницы изменения пароля
);
$r->add(
$r::GET,

View file

@ -10,12 +10,9 @@ declare(strict_types=1);
namespace ForkBB\Models\Pages\Profile;
use ForkBB\Core\Image;
use ForkBB\Core\Validator;
use ForkBB\Core\Exceptions\MailException;
use ForkBB\Models\Page;
use ForkBB\Models\Pages\Profile;
use ForkBB\Models\User\User;
use function \ForkBB\__;
class Pass extends Profile
@ -52,17 +49,13 @@ class Pass extends Profile
]);
if ($v->validation($_POST)) {
// if (\password_verify($v->new_pass, $this->curUser->password)) {
// return $this->c->Redirect->page('EditUserProfile', $args)->message('Email is old redirect');
// }
$this->curUser->password = \password_hash($v->new_pass, \PASSWORD_DEFAULT);
$this->c->users->update($this->curUser);
if ($this->rules->my) {
# $auth = $this->c->Auth;
# $auth->fIswev = [FORK_MESS_SUCC => [__('Pass updated')]];
# return $auth->login([], 'GET', $this->curUser->username);
// $auth = $this->c->Auth;
// $auth->fIswev = [FORK_MESS_SUCC => [__('Pass updated')]];
// return $auth->login([], 'GET', $this->curUser->username);
return $this->c->Redirect->page('Login')->message('Pass updated', FORK_MESS_SUCC); // ???? нужна передача данных между скриптами не привязанная к пользователю
} else {
return $this->c->Redirect->page('EditUserProfile', $args)->message('Pass updated redirect', FORK_MESS_SUCC);