- Added columns for two-factor authentication (2FA) in the pp_users table: - twofa_enabled (TINYINT) - twofa_email (VARCHAR) - twofa_code_hash (VARCHAR) - twofa_expires_at (DATETIME) - twofa_sent_at (DATETIME) - twofa_failed_attempts (INT) - Updated the twofa_enabled and twofa_email for user with id 0. - Enhanced .htaccess to disable directory listing, block execution of sensitive files, and prevent serving hidden files.
44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
namespace admin\controls;
|
|
|
|
class Users
|
|
{
|
|
public static function user_delete()
|
|
{
|
|
if ( \admin\factory\Users::user_delete( \S::get( 'id' ) ) )
|
|
\S::alert( 'Użytkownik został usunięty.' );
|
|
header( 'Location: /admin/users/view_list/' );
|
|
exit;
|
|
}
|
|
|
|
public static function user_save()
|
|
{
|
|
$values = json_decode( \S::get( 'values' ), true );
|
|
|
|
$response = \admin\factory\Users::user_save( $values['id'], $values['login'], $values['status'], $values['password'], $values['password_re'], $values['admin'], $values['twofa_enabled'], $values['twofa_email'] );
|
|
echo json_encode( $response );
|
|
exit;
|
|
}
|
|
|
|
public static function user_edit()
|
|
{
|
|
return \admin\view\Users::user_edit(
|
|
\admin\factory\Users::user_details(
|
|
\S::get( 'id' )
|
|
)
|
|
);
|
|
}
|
|
|
|
public static function view_list()
|
|
{
|
|
return \admin\view\Users::users_list();
|
|
}
|
|
|
|
static public function twofa() {
|
|
return \Tpl::view( 'site/unlogged', [
|
|
'content' => \Tpl::view( 'users/user-2fa' )
|
|
] );
|
|
}
|
|
}
|
|
?>
|