Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rel/173.3.2 #16

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "173.3.1",
"version": "173.3.2",
"status": "Stable",
"dle": [
"17.x"
Expand Down
2 changes: 1 addition & 1 deletion upload/engine/ajax/maharder/maharder/_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ function execute_query($id, $query) : void {
$db->query_errors_list = [];

}
}
}
2 changes: 1 addition & 1 deletion upload/engine/ajax/maharder/maharder/_new_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,4 @@
'failed' => $fails,
],
JSON_UNESCAPED_UNICODE);
}
}
64 changes: 32 additions & 32 deletions upload/engine/ajax/maharder/maharder/_settings.php
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
<?php

if (!$is_logged) {
exit('error');
}
if (!$is_logged) {
exit('error');
}

if ('' == $_REQUEST['user_hash'] or $_REQUEST['user_hash'] != $dle_login_hash) {
exit('error');
}
$concurrentDirectory = ENGINE_DIR . '/inc/maharder/_config';
if ('' == $_REQUEST['user_hash'] or $_REQUEST['user_hash'] != $dle_login_hash) {
exit('error');
}
$concurrentDirectory = ENGINE_DIR . '/inc/maharder/_config';

if (!DataManager::createDir(service : 'maharder', module : 'save_setting', _path : $concurrentDirectory)) {
LogGenerator::setLogs(1);
}
$file = $concurrentDirectory.'/'.$_POST['module'].'.json';
if (!DataManager::createDir(service : 'maharder', module : 'save_setting', _path : $concurrentDirectory)) {
LogGenerator::setLogs(1);
}
$file = $concurrentDirectory.'/'.$_POST['module'].'.json';


if (empty($save_con['list_count']) || !isset($save_con['list_count'])) {
$save_con['list_count'] = $config['news_number'];
}
if (empty($save_con['list_count']) || !isset($save_con['list_count'])) {
$save_con['list_count'] = $config['news_number'];
}

if (empty($save_con['language']) || !isset($save_con['language'])) {
$save_con['language'] = 'ru_RU';
}
if (empty($save_con['language']) || !isset($save_con['language'])) {
$save_con['language'] = 'ru_RU';
}

if (empty($save_con['cache_path']) || !isset($save_con['cache_path'])) {
$save_con['cache_path'] = '/engine/inc/maharder/_cache';
}
if (empty($save_con['cache_path']) || !isset($save_con['cache_path'])) {
$save_con['cache_path'] = '/engine/inc/maharder/_cache';
}

if (empty($save_con['locales_path']) || !isset($save_con['locales_path'])) {
$save_con['locales_path'] = '/engine/inc/maharder/_locales';
}
if (empty($save_con['locales_path']) || !isset($save_con['locales_path'])) {
$save_con['locales_path'] = '/engine/inc/maharder/_locales';
}

if (empty($save_con['cache_timer']) || !isset($save_con['cache_timer'])) {
$save_con['cache_timer'] = 60;
}
if (empty($save_con['cache_timer']) || !isset($save_con['cache_timer'])) {
$save_con['cache_timer'] = 60;
}

if (empty($save_con['theme']) || !isset($save_con['theme'])) {
$save_con['theme'] = 'light';
}
if (empty($save_con['theme']) || !isset($save_con['theme'])) {
$save_con['theme'] = 'light';
}

file_put_contents($file, json_encode($save_con, JSON_UNESCAPED_UNICODE));
clear_cache();
file_put_contents($file, json_encode($save_con, JSON_UNESCAPED_UNICODE));
clear_cache();

echo 'ok';
echo 'ok';
152 changes: 76 additions & 76 deletions upload/engine/ajax/maharder/maharder/master.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,105 +13,105 @@
// Код распространяется по лицензии MIT =
//===============================================================

// ===============================
// Настройки модуля | сохраняем
// ===============================
// Автор: Maxim Harder
// Сайт: https://maxim-harder.de
// Телеграм: http://t.me/MaHarder
// ===============================
// Ничего не менять
// ===============================
// ===============================
// Настройки модуля | сохраняем
// ===============================
// Автор: Maxim Harder
// Сайт: https://maxim-harder.de
// Телеграм: http://t.me/MaHarder
// ===============================
// Ничего не менять
// ===============================


if (!defined('DATALIFEENGINE')) {
header('HTTP/1.1 403 Forbidden');
header('Location: ../../../../');
exit('Hacking attempt!');
}
header('HTTP/1.1 403 Forbidden');
header('Location: ../../../../');
exit('Hacking attempt!');
}

global $is_logged, $dle_login_hash, $mh_admin, $method, $data;
global $is_logged, $dle_login_hash, $mh_admin, $method, $data;

if (!$is_logged) {
exit('error');
}
if (!$is_logged) {
exit('error');
}

if ('' == $_REQUEST['user_hash'] or $_REQUEST['user_hash'] != $dle_login_hash) {
exit('error');
}
if ('' == $_REQUEST['user_hash'] or $_REQUEST['user_hash'] != $dle_login_hash) {
exit('error');
}

require_once DLEPlugins::Check(__DIR__ . '/_functions.php');
require_once DLEPlugins::Check(__DIR__ . '/_functions.php');

if (!$method) {
exit();
}
if (!$method) {
exit();
}

$save_con = [];
$save_con = [];

if (isset($data['data'])) {
foreach (filter_var_array($data['data']) as $id => $d) {
$name = $d['name'];
$value = $d['value'];
$value = htmlspecialchars($value);
$save_con[$name] = $value;
}
if (isset($data['data'])) {
foreach (filter_var_array($data['data']) as $id => $d) {
$name = $d['name'];
$value = $d['value'];
$value = htmlspecialchars($value);
$save_con[$name] = $value;
}
}

switch ($method) {
case 'settings':
include DLEPlugins::Check(__DIR__ . '/_settings.php');
switch ($method) {
case 'settings':
include DLEPlugins::Check(__DIR__ . '/_settings.php');

break;
break;

case 'new_module':
include DLEPlugins::Check(__DIR__ . '/_new_module.php');
case 'new_module':
include DLEPlugins::Check(__DIR__ . '/_new_module.php');

break;
break;

case 'check_assets':
try {
echo json_encode($mh_admin->checkAssets(), JSON_UNESCAPED_UNICODE);
} catch (\Exception $e) {
LogGenerator::generateLog('mhadmin', 'check_assets', $e->getMessage());
echo json_encode([]);
}
case 'check_assets':
try {
echo json_encode($mh_admin->checkAssets(), JSON_UNESCAPED_UNICODE);
} catch (\Exception $e) {
LogGenerator::generateLog('mhadmin', 'check_assets', $e->getMessage());
echo json_encode([]);
}


break;
break;

case 'save_asset':
case 'save_asset':

try {
echo json_encode($mh_admin->save_asset($data['data'], $data['file']), JSON_UNESCAPED_UNICODE);
} catch (\Exception $e) {
LogGenerator::generateLog('mhadmin', 'save_asset', $e->getMessage());
echo json_encode([]);
}
sleep(0.5);
break;
try {
echo json_encode($mh_admin->save_asset($data['data'], $data['file']), JSON_UNESCAPED_UNICODE);
} catch (\Exception $e) {
LogGenerator::generateLog('mhadmin', 'save_asset', $e->getMessage());
echo json_encode([]);
}
sleep(0.5);
break;

case 'check_update':
case 'check_update':

try {
$mh_admin->setRecourceId($data['resource_id']);
echo json_encode($mh_admin->checkUpdate(), JSON_UNESCAPED_UNICODE);
} catch (Exception $e) {
LogGenerator::generateLog('mhadmin', 'check_update', $e->getMessage());
echo json_encode([]);
}
try {
$mh_admin->setRecourceId($data['resource_id']);
echo json_encode($mh_admin->checkUpdate(), JSON_UNESCAPED_UNICODE);
} catch (Exception $e) {
LogGenerator::generateLog('mhadmin', 'check_update', $e->getMessage());
echo json_encode([]);
}

break;
break;

case 'delete_log':
case 'delete_log':

try {
$log = new MhDB(MhLog::class);
echo json_encode($log->delete($data['id']), JSON_UNESCAPED_UNICODE);
} catch (Exception $e) {
LogGenerator::generateLog('mhadmin', 'delete_log', $e->getMessage());
echo '';
} catch (Throwable $e) {
}
try {
$log = new MhDB(MhLog::class);
echo json_encode($log->delete($data['id']), JSON_UNESCAPED_UNICODE);
} catch (Exception $e) {
LogGenerator::generateLog('mhadmin', 'delete_log', $e->getMessage());
echo '';
} catch (Throwable $e) {
}

break;
}
break;
}
10 changes: 5 additions & 5 deletions upload/engine/inc/maharder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// заполняем важную и нужную информацию о модуле
$modInfo = [
'module_name' => 'MaHarder Assets',
'module_version' => '173.3.1',
'module_version' => '173.3.0',
'module_description' => __('Административная панель для моих разработок'),
'module_code' => 'maharder',
'module_id' => 4,
Expand All @@ -44,19 +44,19 @@
switch ($_GET['sites']) {
// Страница с выводом логов
case 'logs':
require_once DLEPlugins::Check(MH_ROOT.'/_modules/admin/module/logs.php');
require_once DLEPlugins::Check(MH_MODULES.'/admin/module/logs.php');
break;
// Страница с генератором модуля
case 'new_module':
require_once DLEPlugins::Check(MH_ROOT.'/_modules/admin/module/new_module.php');
require_once DLEPlugins::Check(MH_MODULES.'/admin/module/new_module.php');
break;
// Страница с логами изменений
case 'changelog':
require_once DLEPlugins::Check(MH_ROOT.'/_modules/admin/module/changelog.php');
require_once DLEPlugins::Check(MH_MODULES.'/admin/module/changelog.php');
break;
// Главная страница
default:
require_once DLEPlugins::Check(MH_ROOT.'/_modules/admin/module/main.php');
require_once DLEPlugins::Check(MH_MODULES.'/admin/module/main.php');
break;
}

Expand Down
9 changes: 4 additions & 5 deletions upload/engine/inc/maharder/_includes/classes/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,10 @@ public function getVariables(?string $name = null): array {
public function setVar(
#[ExpectedValues(values:
[
'css_dir', 'js_dir',
'css', 'js',
'url', 'lic_link',
'author', 'menu', 'breadcrumbs'
'css_dir', 'js_dir',
'css', 'js',
'url', 'lic_link',
'author', 'menu', 'breadcrumbs'
])]
string $name, mixed $value): void {
$this->variables[$name] = $value;
Expand Down Expand Up @@ -522,4 +522,3 @@ public function setBreadcrumb(BreadCrumb $crumb): void {
public function upload_file() { }

}

4 changes: 1 addition & 3 deletions upload/engine/inc/maharder/_includes/extras/paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
MH_INCLUDES . '/database',
MH_INCLUDES . '/responses',
MH_INCLUDES . '/traits',
MH_INCLUDES . '/types',
MH_INCLUDES . '/twigExtensions',
MH_MODULES . '/admin/repositories',
// Custom paths //
Expand Down Expand Up @@ -195,7 +196,4 @@

$MHDB = new MhDB();




ComposerAction::destroy();
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private function saveFile(string $file_path, string $content, string $file): boo
LogGenerator::generateLog(
'maharder/admin',
'save_asset',
__("Файл ':file' не был сохранён!", [':file' => $file]),
__('mhadmin', "Файл '{$file}' не был сохранён!")
);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
global $mh;

$logs = [
'173.3.2' => [
__('[FIX] По неопределённой причине закинул старую версию поверх новой при мёрдже')
],
'173.3.1' => [
__('[FIX] Исправлена загрузка скриптов при помощи composer'),
__('[FIX] Исправлены мелкие ошибки в коде'),
Expand Down
1 change: 0 additions & 1 deletion upload/engine/inc/maharder/_modules/admin/module/links.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@
new AdminLink('changelog', name: __('Журнал изменений'), link: '?mod=' . $modInfo['module_code'] . '&sites=changelog'),
'changelog'
);

2 changes: 1 addition & 1 deletion upload/engine/inc/maharder/_modules/admin/module/logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
$mh->setBreadcrumb(new BreadCrumb($modVars['title'], THIS_SELF . '?' . http_build_query($GET_DATA)));

if ($cur_page > 1) {
$mh->setBreadcrumb(new BreadCrumb(__('Страница %page%', ['%page%' => $cur_page]), THIS_SELF . '?' . http_build_query($GET_DATA)));
$mh->setBreadcrumb(new BreadCrumb(__('mhadmin', 'Страница %page%', ['%page%' => $cur_page]), THIS_SELF . '?' . http_build_query($GET_DATA)));
}

$htmlTemplate = 'admin/logs.html';
Loading
Loading