мелкие правки
This commit is contained in:
1 parent
4571b24fce
commit
bdb8920d0d
3 files changed
+4
-9
No files matched your search
@@ -31,6 +31,7 @@
|
||||
<div class="mb-3">
|
||||
<button class="btn btn-primary" type="button" onClick="addUseSection(this, 'use Core\\Models\\DB;');">DB</button>
|
||||
<button class="btn btn-primary" type="button" onClick="addUseSection(this, 'use Core\\Models\\User;');">User</button>
|
||||
<button class="btn btn-primary" type="button" onClick="addUseSection(this, 'use Core\\Models\\MQ;');">MQ</button>
|
||||
<button class="btn btn-primary" type="button" onClick="addUseSection(this, 'use Core\\Helpers\\Cache;');">Cache</button>
|
||||
<button class="btn btn-primary" type="button" onClick="addUseSection(this, 'use Core\\Helpers\\Log;');">Log</button>
|
||||
<button class="btn btn-primary" type="button" onClick="addUseSection(this, 'use Core\\Helpers\\Files;');">Files</button>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
if ((int)$result === 27) {
|
||||
throw new CoreException('Сервер обмена временно недоступен');
|
||||
}
|
||||
return 'Generated num: ' . $result;
|
||||
return 'Пользователь с ID ' . $params['0'] . ' обновлен';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +93,7 @@
|
||||
*/
|
||||
private function convertToJson($arData): ?string
|
||||
{
|
||||
if(empty($arData)) {
|
||||
if (empty($arData)) {
|
||||
$arData = [];
|
||||
}
|
||||
return json_encode($arData, JSON_UNESCAPED_UNICODE);
|
||||
@@ -344,7 +344,6 @@
|
||||
null,
|
||||
false
|
||||
);
|
||||
|
||||
} catch (\Throwable|CoreException $t) {
|
||||
$endTime = round(microtime(true) - $startTime, 4);
|
||||
$this->DB->update(
|
||||
@@ -399,7 +398,7 @@
|
||||
'attempts' => $arTask['attempts'],
|
||||
'date_created' => $arTask['date_created'],
|
||||
'date_updated' => $arTask['date_updated'],
|
||||
'class' => $arTask['class'],
|
||||
'class' => addslashes($arTask['class']),
|
||||
'method' => $arTask['method'],
|
||||
'params' => $arTask['params'],
|
||||
'status' => $arTask['status'],
|
||||
|
||||
@@ -177,7 +177,6 @@
|
||||
$res = (DB::getInstance())->query('SELECT * FROM `' . self::USERS_TABLE . '` ORDER BY `id` ' . $sort . ' LIMIT ' . $limit);
|
||||
Cache::set($cacheId, $res);
|
||||
}
|
||||
Log::logToFile(__METHOD__, 'User.log', func_get_args());
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -417,7 +416,6 @@
|
||||
setcookie('userLogin', $result['login'], time() + 3600 * 24);
|
||||
setcookie('token', md5(self::$cryptoSalt . $result['id'] . $result['login'] . $result['password']), time() + 3600 * 24);
|
||||
}
|
||||
Log::logToFile(__METHOD__, 'User.log', func_get_args());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -435,8 +433,6 @@
|
||||
*/
|
||||
public static function securityAuthorize(string $login, string $password, bool $remember = false): bool
|
||||
{
|
||||
Log::logToFile(__METHOD__, 'User.log', func_get_args());
|
||||
|
||||
/** @var $DB DB */
|
||||
$DB = DB::getInstance();
|
||||
$result = $DB->getItem(self::USERS_TABLE, ['login' => $login, 'password' => self::passwordEncryption($password)], true);
|
||||
@@ -527,7 +523,6 @@
|
||||
*/
|
||||
public static function logout(): void
|
||||
{
|
||||
Log::logToFile(__METHOD__, 'User.log', func_get_args());
|
||||
$_SESSION['id'] = '';
|
||||
$_SESSION['authorize'] = '';
|
||||
$_SESSION['login'] = '';
|
||||
|
||||
Reference in new issue
Block a user