[*] новые фичи 5
This commit is contained in:
1 parent
29d19261ff
commit
a6f3a007c6
4 files changed
+66
-25
No files matched your search
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
use Core\Models\User;
|
||||
require_once __DIR__ . '/inc/header.php';
|
||||
?>
|
||||
<div class="pageheader">
|
||||
<div class="media">
|
||||
<div class="pageicon pull-left">
|
||||
<i class="fa fa-home"></i>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
|
||||
<li>Список Групп</li>
|
||||
</ul>
|
||||
<h4>Список групп</h4>
|
||||
</div>
|
||||
</div><!-- media -->
|
||||
</div><!-- pageheader -->
|
||||
|
||||
<div class="contentpanel">
|
||||
<!-- table -->
|
||||
<div class="row">
|
||||
<div class="col-md-12r">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-primary table-hover mb30">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Название</th>
|
||||
<th>Описание</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$arGroups = User::getAllGroups();
|
||||
foreach($arGroups as $group){
|
||||
?>
|
||||
<tr>
|
||||
<td><?=$group['id'];?></td>
|
||||
<td><?=$group['name'];?></td>
|
||||
<td><?=$group['description'];?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- table-responsive -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end table -->
|
||||
</div><!-- contentpanel -->
|
||||
<?php require_once __DIR__ . '/inc/footer.php'; ?>
|
||||
@@ -206,6 +206,7 @@
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="/admin/"><i class="fa fa-home"></i> <span>Дашбоард</span></a></li>
|
||||
<li><a href="/admin/users.php"><i class="fa fa-home"></i> <span>Список пользователей</span></a></li>
|
||||
<li><a href="/admin/groups.php"><i class="fa fa-home"></i> <span>Список групп</span></a></li>
|
||||
<li><a href="/admin/cacheInfo.php"><i class="fa fa-home"></i> <span>Кэширование</span></a></li>
|
||||
<li><a href="index.html"><i class="fa fa-home"></i> <span>Dashboard</span></a></li>
|
||||
<li><a href="index.html"><i class="fa fa-home"></i> <span>Dashboard</span></a></li>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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'],
|
||||
|
||||
Reference in new issue
Block a user