refactor users module to domain/controller and release 0.253 update package

This commit is contained in:
2026-02-12 21:44:40 +01:00
parent f5054047fd
commit c1284ef06c
24 changed files with 1452 additions and 453 deletions

View File

@@ -5,14 +5,22 @@ class Page {
public static function show()
{
global $user;
global $user, $mdb;
if ( $_GET['module'] == 'user' && $_GET['action'] == 'twofa' ) {
return \admin\controls\Users::twofa();
$controller = new \admin\Controllers\UsersController(
new \Domain\User\UserRepository( $mdb )
);
return $controller->twofa();
}
if ( !$user || !$user['admin'] )
return \admin\view\Users::login_form();
{
$controller = new \admin\Controllers\UsersController(
new \Domain\User\UserRepository( $mdb )
);
return $controller->login_form();
}
$tpl = new \Tpl;
$tpl -> content = \admin\Site::route();