Compare commits

..

No commits in common. "d90320f5f9a4cc2f44a42678f4cc0e5b8e0e7929" and "5f9a0fe75b51dc37ce193f0ff613b106f1e12801" have entirely different histories.

5 changed files with 6 additions and 23 deletions

View File

@ -143,10 +143,6 @@ class Feedback {
'type' => self::TYPE_WARNING,
'dismissible' => true
],
'MAINTENANCE_ON' => [
'type' => self::TYPE_WARNING,
'dismissible' => false
],
];
private static $strings = null;

View File

@ -45,6 +45,5 @@ return [
'DB_CONNECT_ERROR' => 'Error connecting to DB: %s',
'DB_UNKNOWN_TYPE' => 'Error: unknown database type "%s"',
'MIGRATIONS_PENDING' => '%s',
'MAINTENANCE_ON' => 'Maintenance mode is enabled. Regular users see a maintenance page.',
],
];

View File

@ -28,9 +28,6 @@ if (!$canAdmin) {
exit;
}
// Get any old feedback messages
include __DIR__ . '/../helpers/feedback.php';
// Handle actions
$action = $_POST['action'] ?? '';
@ -144,5 +141,8 @@ try {
// CSRF token
$csrf_token = $security->generateCsrfToken();
// Get any new feedback messages
include __DIR__ . '/../helpers/feedback.php';
// Load the template
include __DIR__ . '/../templates/admin-tools.php';

View File

@ -19,9 +19,6 @@ if (!Session::isValidSession()) {
exit;
}
// Get any old feedback messages
include '../app/helpers/feedback.php';
// Handle theme switching
if (isset($_GET['switch_to'])) {
$themeName = $_GET['switch_to'];
@ -67,5 +64,8 @@ $themes = $themeData;
// Generate CSRF token for the form
$csrf_token = $security->generateCsrfToken();
// Get any new feedback messages
include '../app/helpers/feedback.php';
// Load the template
include '../app/templates/theme.php';

View File

@ -241,8 +241,6 @@ try {
}
if (!$isSuperuser) {
http_response_code(503);
// Advise clients to retry after 10 minutes (600 seconds; configure here)
header('Retry-After: 600');
// Show themed maintenance page
\App\Helpers\Theme::include('page-header');
\App\Helpers\Theme::include('page-menu');
@ -250,16 +248,6 @@ try {
\App\Helpers\Theme::include('page-footer');
ob_end_flush();
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) {