Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lang/ar_AR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/be_BY.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/cs_CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/da_DK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/de_DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/de_DE_gender_doppelpunkt.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/de_DE_gender_dudenkonform.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/el_GR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
12 changes: 12 additions & 0 deletions lang/en_US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions lang/eo_EO.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/es_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/fa_IR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/fr_FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/gl_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/gu_GU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/hi_HI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/hr_HR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/hu_HU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/id_ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/it_IT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/ko_KO.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/ku_KU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/ms_MY.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/nl_NL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/pl_PL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/pt_BR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/ru_RU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/sv_SE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/tr_TR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/uk_UA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/zh_CN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions lang/zh_TW.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
1 change: 1 addition & 0 deletions system/admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,7 @@ function toolbar()
}
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>';
Expand Down
70 changes: 70 additions & 0 deletions system/admin/views/health.html.php
Original file line number Diff line number Diff line change
@@ -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>';
}
}

7 changes: 7 additions & 0 deletions system/admin/views/layout.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@
</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">
Expand Down
5 changes: 5 additions & 0 deletions system/admin/views/update.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
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',
Expand Down
35 changes: 35 additions & 0 deletions system/htmly.php
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,41 @@
}
});

// 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;
Expand Down