nexus base
This commit is contained in:
@@ -24,9 +24,12 @@ $publicPaths = [
|
||||
'auth/me',
|
||||
'module/pi_control/terminal_info',
|
||||
];
|
||||
$requiresGlobalAuth = in_array($uriPath, ['settings', 'users', 'modules', 'modules/install', 'modules/sql-import', 'debug', 'exports/database.sql'], true)
|
||||
$requiresGlobalAuth = in_array($uriPath, ['settings', 'users', 'modules', 'modules/install', 'modules/sql-import', 'debug', 'exports/database.sql', 'dashboard', 'dashboards', 'integrations', 'page-modules'], true)
|
||||
|| str_starts_with($uriPath, 'modules/setup/')
|
||||
|| str_starts_with($uriPath, 'modules/access/');
|
||||
if (str_starts_with($uriPath, 'page-modules/view/')) {
|
||||
$requiresGlobalAuth = true;
|
||||
}
|
||||
if (defined('APP_AUTH_ENABLED') && APP_AUTH_ENABLED && $requiresGlobalAuth && !in_array($uriPath, $publicPaths, true)) {
|
||||
$user = auth_user();
|
||||
if (!$user) {
|
||||
@@ -274,6 +277,17 @@ if (str_starts_with($uriPath, 'modules/install')) {
|
||||
$target = $pagesBase . '/users/settings.php';
|
||||
} elseif ($uriPath === 'users') {
|
||||
$target = $pagesBase . '/users/index.php';
|
||||
} elseif ($uriPath === 'dashboard') {
|
||||
$target = $pagesBase . '/dashboard.php';
|
||||
} elseif ($uriPath === 'dashboards') {
|
||||
$target = $pagesBase . '/dashboards.php';
|
||||
} elseif ($uriPath === 'integrations') {
|
||||
$target = $pagesBase . '/integrations.php';
|
||||
} elseif ($uriPath === 'page-modules') {
|
||||
$target = $pagesBase . '/page_modules.php';
|
||||
} elseif (preg_match('~^page-modules/view/(\d+)$~', $uriPath, $pageModuleMatch)) {
|
||||
$_GET['id'] = (string) $pageModuleMatch[1];
|
||||
$target = $pagesBase . '/page_modules_view.php';
|
||||
} elseif ($uriPath === 'debug') {
|
||||
$target = $pagesBase . '/retool/debug.php';
|
||||
} elseif (preg_match('~^module/([a-zA-Z0-9_-]+)(?:/(.+))?$~', $uriPath, $m)) {
|
||||
|
||||
Reference in New Issue
Block a user