This commit is contained in:
KuJoe 2026-03-17 20:49:50 -04:00 committed by GitHub
commit d676d3626b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 161 additions and 0 deletions

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -341,3 +341,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -351,3 +351,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ subpages = "Unterseiten"
getstarted = "Los geht's"
onthispage = "Auf dieser Seite"
backtotop = "Nach oben"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ subpages = "Unterseiten"
getstarted = "Los geht's"
onthispage = "Auf dieser Seite"
backtotop = "Nach oben"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ subpages = "Unterseiten"
getstarted = "Los geht's"
onthispage = "Auf dieser Seite"
backtotop = "Nach oben"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -342,3 +342,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -407,3 +407,15 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."
health_check = "Health Check"
directory_permissions = "Directory Permissions"
cache_folder_writable = "/cache/ directory is writable."
content_folder_not_writable = "/content/ directory is not writable, please update the permissions/ownership to continue."
content_folder_writable = "/content/ directory is writable."
users_folder_not_writable = "/config/users/ directory is not writable, please update the permissions/ownership to continue."
users_folder_writable = "/config/users/ directory is writable."
php_check = "PHP Version"
php_version_check_passed = "PHP version meets the minimum requirement."
php_version_check_failed = "PHP version does not meet the minimum requirement. Please upgrade your PHP version."
php_modules = "PHP Modules"

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -407,3 +407,4 @@ backtotop = "Torna in cima"
subpages = "Sottopagine"
getstarted = "Per cominciare"
onthispage = "Su questa pagina"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -341,3 +341,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -341,3 +341,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -352,3 +352,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -340,3 +340,4 @@ backtotop = "Back to top"
subpages = "Sub pages"
getstarted = "Get started"
onthispage = "On this page"
cache_folder_not_writable = "/cache/ directory is not writable, please update the permissions/ownership to continue."

View file

@ -1674,6 +1674,7 @@ EOF;
}
if ($role === 'editor' || $role === 'admin') {
$toolbar .= '<li class="tb-clearcache"><a href="' . $base . 'admin/clear-cache">' . i18n('Clear_cache') . '</a></li>';
$toolbar .= '<li class="tb-health"><a href="' . $base . 'admin/health">' . i18n('health_check') . '</a></li>';
}
$toolbar .= '<li class="tb-editprofile"><a href="' . $base . 'edit/profile">' . i18n('Edit_profile') . '</a></li>';
$toolbar .= '<li class="tb-logout"><a href="' . $base . 'logout">' . i18n('Logout') . '</a></li>';

View file

@ -0,0 +1,70 @@
<?php if (!defined('HTMLY')) die('HTMLy'); ?>
<?php
$CSRF = get_csrf();
echo '<h2>'.i18n('health_check').'</h2><hr>';
echo '<h3>'.i18n('php_check').'</h3>';
$requiredPhpVersion = '7.2';
if (version_compare(PHP_VERSION, $requiredPhpVersion, '>=')) {
echo '<p> ✅ '.i18n('php_version_check_passed').' (Current: '.PHP_VERSION.', Required: '.$requiredPhpVersion.')</p>';
} else {
echo '<p> ❌ '.i18n('php_version_check_failed').' (Current: '.PHP_VERSION.', Required: '.$requiredPhpVersion.')</p>';
}
echo '<h3>'.i18n('directory_permissions').'</h3>';
$cachedir = 'cache/';
if (!is_writable($cachedir)) {
echo '<p> ❌ '.i18n('cache_folder_not_writable').'</p>';
} else {
echo '<p> ✅ '.i18n('cache_folder_writable').'</p>';
}
$contentdir = 'content/';
if (!is_writable($contentdir)) {
echo '<p> ❌ '.i18n('content_folder_not_writable').'</p>';
} else {
echo '<p> ✅ '.i18n('content_folder_writable').'</p>';
}
$usersdir = 'config/users/';
if (!is_writable($usersdir)) {
echo '<p> ❌ '.i18n('users_folder_not_writable').'</p>';
} else {
echo '<p> ✅ '.i18n('users_folder_writable').'</p>';
}
echo '<h3>'.i18n('php_modules').'</h3>';
$requiredChecks = array(
'json' => extension_loaded('json'),
'mbstring' => extension_loaded('mbstring'),
'libxml' => extension_loaded('libxml'),
'dom' => extension_loaded('dom') && class_exists('DOMDocument'),
'simplexml' => extension_loaded('simplexml') && class_exists('SimpleXMLElement'),
'xml' => extension_loaded('xml'),
'hash' => extension_loaded('hash'),
'session' => extension_loaded('session'),
'pcre' => extension_loaded('pcre'),
'filter' => extension_loaded('filter'),
'ctype' => extension_loaded('ctype'),
'openssl' => extension_loaded('openssl'),
'zip' => extension_loaded('zip') && class_exists('ZipArchive'),
'gd' => extension_loaded('gd') && function_exists('gd_info'),
'iconv' => extension_loaded('iconv') && function_exists('iconv'),
'intl' => extension_loaded('intl'),
'apcu' => extension_loaded('apcu'),
'mcrypt' => extension_loaded('mcrypt'),
);
foreach ($requiredChecks as $label => $ok) {
if ($ok) {
echo '<p> ✅ '.$label.'</p>';
} else {
echo '<p> ❌ '.$label.'</p>';
}
}

View file

@ -262,6 +262,13 @@ if (isset($author[0])) {
</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo site_url();?>admin/health" class="nav-link">
<p>
<?php echo i18n('health_check');?>
</p>
</a>
</li>
<?php if (config('fulltext.search') == 'true') : ?>
<li class="nav-item">
<a href="<?php echo site_url();?>admin/search" class="nav-link">

View file

@ -14,6 +14,11 @@ $dir = 'cache/';
if (!is_dir($dir)) {
mkdir($dir, 0775, true);
}
if (!is_writable($dir)) {
echo '<h2>'.i18n('Update').'</h2><hr>';
echo i18n('cache_folder_not_writable');
return;
}
if (defined("JSON_PRETTY_PRINT")) {
file_put_contents(
'cache/installedVersion.json',

View file

@ -2626,6 +2626,41 @@ get('/admin/clear-cache', function () {
}
});
// Show health status page
get('/admin/health', function () {
$user = $_SESSION[site_url()]['user'] ?? null;
$role = user('role', $user) ?? null;
if (login()) {
config('views.root', 'system/admin/views');
if ($role === 'editor' || $role === 'admin') {
render('health', array(
'title' => generate_title('is_default', i18n('Health_check')),
'description' => safe_html(strip_tags(blog_description())),
'canonical' => site_url(),
'metatags' => generate_meta(null, null),
'type' => 'is_admin-health',
'is_admin' => true,
'bodyclass' => 'admin-health',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; ' . i18n('Health_check')
));
} else {
render('denied', array(
'title' => generate_title('is_default', i18n('Denied')),
'description' => safe_html(strip_tags(blog_description())),
'canonical' => site_url(),
'metatags' => generate_meta(null, null),
'type' => 'is_admin-health',
'is_admin' => true,
'bodyclass' => 'denied',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; ' . i18n('Denied')
));
}
} else {
$login = site_url() . 'login';
header("location: $login");
}
});
// Show Update page
get('/admin/update', function () {
$user = $_SESSION[site_url()]['user'] ?? null;