Compare commits
No commits in common. "d90320f5f9a4cc2f44a42678f4cc0e5b8e0e7929" and "5f9a0fe75b51dc37ce193f0ff613b106f1e12801" have entirely different histories.
d90320f5f9
...
5f9a0fe75b
|
|
@ -143,10 +143,6 @@ class Feedback {
|
||||||
'type' => self::TYPE_WARNING,
|
'type' => self::TYPE_WARNING,
|
||||||
'dismissible' => true
|
'dismissible' => true
|
||||||
],
|
],
|
||||||
'MAINTENANCE_ON' => [
|
|
||||||
'type' => self::TYPE_WARNING,
|
|
||||||
'dismissible' => false
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
private static $strings = null;
|
private static $strings = null;
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,5 @@ return [
|
||||||
'DB_CONNECT_ERROR' => 'Error connecting to DB: %s',
|
'DB_CONNECT_ERROR' => 'Error connecting to DB: %s',
|
||||||
'DB_UNKNOWN_TYPE' => 'Error: unknown database type "%s"',
|
'DB_UNKNOWN_TYPE' => 'Error: unknown database type "%s"',
|
||||||
'MIGRATIONS_PENDING' => '%s',
|
'MIGRATIONS_PENDING' => '%s',
|
||||||
'MAINTENANCE_ON' => 'Maintenance mode is enabled. Regular users see a maintenance page.',
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,6 @@ if (!$canAdmin) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get any old feedback messages
|
|
||||||
include __DIR__ . '/../helpers/feedback.php';
|
|
||||||
|
|
||||||
// Handle actions
|
// Handle actions
|
||||||
$action = $_POST['action'] ?? '';
|
$action = $_POST['action'] ?? '';
|
||||||
|
|
||||||
|
|
@ -144,5 +141,8 @@ try {
|
||||||
// CSRF token
|
// CSRF token
|
||||||
$csrf_token = $security->generateCsrfToken();
|
$csrf_token = $security->generateCsrfToken();
|
||||||
|
|
||||||
|
// Get any new feedback messages
|
||||||
|
include __DIR__ . '/../helpers/feedback.php';
|
||||||
|
|
||||||
// Load the template
|
// Load the template
|
||||||
include __DIR__ . '/../templates/admin-tools.php';
|
include __DIR__ . '/../templates/admin-tools.php';
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,6 @@ if (!Session::isValidSession()) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get any old feedback messages
|
|
||||||
include '../app/helpers/feedback.php';
|
|
||||||
|
|
||||||
// Handle theme switching
|
// Handle theme switching
|
||||||
if (isset($_GET['switch_to'])) {
|
if (isset($_GET['switch_to'])) {
|
||||||
$themeName = $_GET['switch_to'];
|
$themeName = $_GET['switch_to'];
|
||||||
|
|
@ -67,5 +64,8 @@ $themes = $themeData;
|
||||||
// Generate CSRF token for the form
|
// Generate CSRF token for the form
|
||||||
$csrf_token = $security->generateCsrfToken();
|
$csrf_token = $security->generateCsrfToken();
|
||||||
|
|
||||||
|
// Get any new feedback messages
|
||||||
|
include '../app/helpers/feedback.php';
|
||||||
|
|
||||||
// Load the template
|
// Load the template
|
||||||
include '../app/templates/theme.php';
|
include '../app/templates/theme.php';
|
||||||
|
|
|
||||||
|
|
@ -241,8 +241,6 @@ try {
|
||||||
}
|
}
|
||||||
if (!$isSuperuser) {
|
if (!$isSuperuser) {
|
||||||
http_response_code(503);
|
http_response_code(503);
|
||||||
// Advise clients to retry after 10 minutes (600 seconds; configure here)
|
|
||||||
header('Retry-After: 600');
|
|
||||||
// Show themed maintenance page
|
// Show themed maintenance page
|
||||||
\App\Helpers\Theme::include('page-header');
|
\App\Helpers\Theme::include('page-header');
|
||||||
\App\Helpers\Theme::include('page-menu');
|
\App\Helpers\Theme::include('page-menu');
|
||||||
|
|
@ -250,16 +248,6 @@ try {
|
||||||
\App\Helpers\Theme::include('page-footer');
|
\App\Helpers\Theme::include('page-footer');
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
exit;
|
exit;
|
||||||
} else {
|
|
||||||
// Superusers bypass maintenance; show a small banner
|
|
||||||
$maintMsg = \App\Core\Maintenance::getMessage();
|
|
||||||
$custom = 'Maintenance mode is enabled.';
|
|
||||||
if (!empty($maintMsg)) {
|
|
||||||
$custom .= ' <em>' . htmlspecialchars($maintMsg) . '</em>';
|
|
||||||
}
|
|
||||||
$custom .= ' Control it in <a href="' . htmlspecialchars($app_root) . '?page=admin-tools">Admin tools</a>';
|
|
||||||
// Non-dismissible and small, do not sanitize to allow link and <em>
|
|
||||||
Feedback::flash('SYSTEM', 'MAINTENANCE_ON', $custom, false, true, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue