mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-07 20:02:40 +02:00
refactor: eliminate proxy functions, migrate to direct class method calls
312 files changed, 2866 insertions(+), 24110 deletions(-) Proxy function replacements (130+ functions): - goHome() -> AdminHelpers::goHome() - checkPermissions() -> PageAuthorization::checkPermissions() - getBouquet/getCategory/etc -> Service::getById() - deleteStream/deleteLine/etc -> Repository/Service::delete() - APIRequest/systemapirequest -> ApiClient::request/systemRequest() - prepareArray/preparecolumn -> QueryHelper methods - confirmIDs/parserelease/etc -> AdminHelpers methods - getSettings/clearSettingsCache -> SettingsManager methods - destroySession -> SessionManager::clearContext() - getMag/getEnigma/deleteMAG/etc -> MagService/EnigmaService - getSeriesTrailer/getMovieTMDB/etc -> TMDbService methods Removed legacy files: - src/includes/admin.php (main proxy hub) - src/includes/libs/ (35+ files moved to core/modules) - src/includes/python/ (moved to bin/python) - src/includes/api/ (moved to Controllers) - src/includes/ts.php, reseller_api.php - src/infrastructure/legacy/admin_proxies.php - tools/run_scan.sh, update_redis_conf.sh Additional fixes: - SQL query placeholder migration (BouquetService, CategoryService) - PHP 8.x null-safe access (live.php, server_view.php, stream.php) - TmdbCron: extracted variable for repeated similar_text calls
This commit is contained in:
@@ -43,32 +43,28 @@ class BaseAdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверка общих прав доступа (checkPermissions).
|
||||
* При отказе — goHome() + exit.
|
||||
* Проверка общих прав доступа.
|
||||
* При отказе — redirect на главную + exit.
|
||||
*/
|
||||
protected function requirePermission()
|
||||
{
|
||||
if (function_exists('checkPermissions') && !checkPermissions()) {
|
||||
if (function_exists('goHome')) {
|
||||
goHome();
|
||||
}
|
||||
if (!PageAuthorization::checkPermissions()) {
|
||||
AdminHelpers::goHome();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверка расширенных прав (hasPermissions).
|
||||
* При отказе — goHome() + exit.
|
||||
* При отказе — redirect на главную + exit.
|
||||
*
|
||||
* @param string $type Тип прав ('adv' и т.д.)
|
||||
* @param string $key Ключ прав ('edit_user' и т.д.)
|
||||
*/
|
||||
protected function requireAdvPermission($type, $key)
|
||||
{
|
||||
if (class_exists('Authorization') && !Authorization::check($type, $key)) {
|
||||
if (function_exists('goHome')) {
|
||||
goHome();
|
||||
}
|
||||
if (!Authorization::check($type, $key)) {
|
||||
AdminHelpers::goHome();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user