[*] небольшой код стайл User класса

This commit is contained in:
rsgrinko committed 2022-08-15 19:15:31 +03:00
1 parent 51d11c838f
commit 1ea49a1c10
3 files changed
+86 -35

No files matched your search

+8 -3
View File
@@ -20,6 +20,7 @@
*/
use Core\Models\User;
use Core\CoreException;
require_once __DIR__ . '/inc/bootstrap.php';
if (User::isAuthorized()) {
@@ -44,10 +45,14 @@
}
if (empty($arErrors)) {
$userId = User::create($_REQUEST['login'], $_REQUEST['pass'], $_REQUEST['email'], $_REQUEST['name']);
try {
$userId = User::create($_REQUEST['login'], $_REQUEST['pass'], $_REQUEST['email'], $_REQUEST['name']);
User::authorize($userId);
header('Location: index.php');
User::authorize($userId);
header('Location: index.php');
} catch (CoreException $e){
$arErrors[] = $e->getMessage();
}
}
}