diff --git a/admin/groups.php b/admin/groups.php
new file mode 100644
index 0000000..393af45
--- /dev/null
+++ b/admin/groups.php
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Название |
+ Описание |
+
+
+
+
+
+ | =$group['id'];?> |
+ =$group['name'];?> |
+ =$group['description'];?> |
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/inc/header.php b/admin/inc/header.php
index 664fbca..14b49f4 100644
--- a/admin/inc/header.php
+++ b/admin/inc/header.php
@@ -206,6 +206,7 @@
- Дашбоард
- Список пользователей
+ - Список групп
- Кэширование
- Dashboard
- Dashboard
diff --git a/core/lib/Core/Models/User.class.php b/core/lib/Core/Models/User.class.php
index 37fec7f..696f860 100644
--- a/core/lib/Core/Models/User.class.php
+++ b/core/lib/Core/Models/User.class.php
@@ -9,7 +9,7 @@
use Core\CoreException;
use Core\Models\DB;
- use Core\Helpers\{Cache, Log};
+ use Core\Helpers\{Cache, Log, SystemFunctions};
class User
{
@@ -159,16 +159,6 @@
return $this->getAllUserData() ? $this->getAllUserData()['id'] : null;
}
- /**
- * Получение прав доступа текущего пользователя
- *
- * @return string|null
- */
- public function getAccessLevel(): ?string
- {
- return $this->getAllUserData() ? $this->getAllUserData()['access_level'] : null;
- }
-
/**
* Получение всех пользователей панели
*
@@ -176,6 +166,7 @@
* @param string $sort Сортировка
*
* @return array
+ * @throws CoreException
*/
public static function getUsers(string $limit = '10', $sort = 'ASC')
{
@@ -194,6 +185,7 @@
* Создание пользовательского токена
*
* @return string
+ * @throws CoreException
*/
public function createToken(): string
{
@@ -276,27 +268,23 @@
*
* @param string $login Логин
* @param string $password Пароль
- * @param string $level Права
* @param string $name Имя
* @param string $image Аватар
*
* @throws CoreException
*/
- public static function registration(string $login, string $password, string $email, string $level = 'user', string $name = '', string $image = ''): int
+ public static function registration(string $login, string $password, string $email, string $name = '', string $image = ''): int
{
Log::logToFile(__METHOD__, 'User.log', func_get_args());
- $userId = (DB::getInstance())->addItem(self::USERS_TABLE, [
- 'login' => $login,
- 'password' => md5(self::$cryptoSalt . $password),
- 'access_level' => $level,
- 'name' => $name,
- 'image' => $image,
- 'token' => '',
- 'email' => $email,
- 'last_active' => time(),
+ return (DB::getInstance())->addItem(self::USERS_TABLE, [
+ 'login' => $login,
+ 'password' => md5(self::$cryptoSalt . $password),
+ 'name' => $name,
+ 'image' => $image,
+ 'token' => '',
+ 'email' => $email,
+ 'last_active' => time(),
]);
- //self::authorize($userId);
- return $userId;
}
/**
diff --git a/index.php b/index.php
index 2d7e44d..846b5f6 100644
--- a/index.php
+++ b/index.php
@@ -75,7 +75,6 @@ $arData = (DB::getInstance())->query('select * from users order by id desc limit
'id' => $element['id'],
'login' => $element['login'],
//'password' => $element['password'],
- 'access_level' => $element['access_level'],
'name' => $element['name'],
'email' => $element['email'],
'image' => $element['image'],