$dbconn = pg_connect("host=postgres port=5432 dbname=messenger user=admin password=root")
$original = 'videorecord/2023/05/14/Б6-4';
echo($original . '<br>');
$encrypted = Crypt::encryptText($original);
echo($encrypted . '<br>');
$decrypted = Crypt::decryptText($encrypted);
echo($decrypted . '<br>');
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" -iname "*.JPG" \) -exec jpegoptim -f -m80 -T10 --strip-all {} \; &&
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" -iname "*.JPG" \) -exec mogrify -verbose -format jpg -layers Dispose -resize 2048\>x2048\> -quality 80% {} +
body.classList.toggle('.dark-mode', !wasDarkmode)
$user = Auth::user();
if ($user?->isAdmin()) {
$controller = \Controllers\Admin\IndexController::class;
} elseif ($user?->isManager()) {
$controller = \Controllers\Manager\IndexController::class;
} else {
abort(403);
}
$route = $request->route();
$action = $route->getAction();
// подменяем на новый
$action['uses'] = "$controller@$actionMethod";
$action['controller'] = "$controller@$actionMethod";
// сохраняем
$route->setAction($action);
// нужно сбросить контроллер, иначе отрабатывает старый
$route->controller = false;
return $next($request);
$adminUsers = \Bitrix\Main\UserTable::getList([
'filter' => [
'GROUPS.GROUP_ID' => [1]
]
])->fetchAll();
(new OneToMany('GROUPS', UserGroupTable::class, 'USER'))
->configureJoinType(Join::TYPE_INNER),