43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* @package Bicycle
|
|
* @author Egor Isaev
|
|
* @description SettingsController.php
|
|
* @copyright (c) 14/08/2026
|
|
*/
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Repositories\UserRepository;
|
|
use Services\Auth;
|
|
use System\Classes\Controller;
|
|
use System\Classes\HTTP\HTTPException;
|
|
use System\Classes\MyException;
|
|
|
|
/**
|
|
* Настройки — профиль и быстрый доступ к управлению статьями/счетами.
|
|
*/
|
|
class SettingsController extends Controller
|
|
{
|
|
protected bool $_auth_protection = true;
|
|
|
|
/**
|
|
* @return string
|
|
* @throws HTTPException|MyException
|
|
*/
|
|
public function indexAction(): string
|
|
{
|
|
$auth_user = Auth::instance()->getUser();
|
|
$user = (new UserRepository())->getByLogin($auth_user['login']);
|
|
|
|
if (!$user) {
|
|
throw HTTPException::factory(404);
|
|
}
|
|
|
|
return $this->render('index', [
|
|
'auth_user' => $auth_user,
|
|
'user' => $user,
|
|
]);
|
|
}
|
|
}
|