diff --git a/e107_admin/admin.php b/e107_admin/admin.php
index fe7075c83..ba6859fc0 100644
--- a/e107_admin/admin.php
+++ b/e107_admin/admin.php
@@ -135,16 +135,20 @@ class admin_start
return null;
}
+
if(!e107::getDb()->isTable('admin_log')) // Upgrade from v1.x to v2.x required.
{
$this->upgradeRequiredFirst = true;
}
+ // eHelper::clearSystemNotification(); // clear the notifications.
+
// Files that can cause comflicts and problems.
$fileInspector = e107::getFileInspector();
$this->deprecated = $fileInspector::getCachedDeprecatedFiles();
$this->checkCoreVersion();
+ $this->checkDependencies();
if(!empty($_POST['delete-deprecated']))
{
@@ -205,7 +209,8 @@ class admin_start
$this->checkDeveloperMode();
- if($this->refresh == true)
+
+ if($this->refresh)
{
e107::getRedirect()->go(e_REQUEST_SELF);
}
@@ -213,7 +218,9 @@ class admin_start
// delete half-completed user accounts. (previously called in header.php )
e107::getUserSession()->deleteExpired();
- }
+ }
+
+
private function checkPaths()
{
@@ -232,9 +239,13 @@ class admin_start
else
{
$message = e107::getParser()->lanVars(ADLAN_187,$dr,true);
- $mes->addWarning($message);
+ eHelper::addSystemNotification('check_paths_'.sha1($dr), $message);
}
}
+ else
+ {
+ eHelper::clearSystemNotification('check_paths_'.sha1($dr));
+ }
}
}
@@ -284,7 +295,7 @@ class admin_start
// auto db update
if ('0' != ADMINPERMS)
{
- return null;
+ return;
}
if($this->upgradeRequiredFirst)
@@ -488,13 +499,13 @@ TMPO;
if(deftrue('e_MEDIA') && is_dir(e_MEDIA) && !is_writable(e_MEDIA))
{
$message = str_replace("[x]", e_MEDIA, ADLAN_193);
- $mes->addWarning($message);
+ $mes->addWarning($message);
}
if(deftrue('e_SYSTEM') && is_dir(e_SYSTEM) && !is_writable(e_SYSTEM))
{
$message = str_replace("[x]", e_SYSTEM, ADLAN_193);
- $mes->addWarning($message);
+ $mes->addWarning($message);
}
$files = e107::getFile()->scandir(e_IMAGE."avatars",'jpg,gif,png,jpeg');
@@ -526,7 +537,8 @@ TMPO;
{
if($this->upgradeRequiredFirst)
{
- return null;
+ eHelper::clearSystemNotification('checkIncompatiblePlugins');
+ return;
}
$mes = e107::getMessage();
@@ -543,15 +555,21 @@ TMPO;
if(!empty($installedPlugs[$folder]) && ($version == $installedPlugs[$folder] || $version === '*'))
{
- $inCompatText .= "
".$folder." v".$installedPlugs[$folder]."";
+ $url = e_ADMIN."plugin.php?searchquery=$folder&filter_options=&mode=installed&action=list&etrigger_filter=etrigger_filter";
+ $inCompatText .= "".$folder." v".$installedPlugs[$folder]."";
}
}
if($inCompatText)
{
$text = "";
- $mes->addWarning(ADLAN_189."
".$text);
- }
+ eHelper::addSystemNotification('checkIncompatiblePlugins', ADLAN_189."
".$text);
+ // $mes->addWarning(ADLAN_189."
".$text);
+ }
+ else
+ {
+ eHelper::clearSystemNotification('checkIncompatiblePlugins');
+ }
}
@@ -560,7 +578,7 @@ TMPO;
{
if($this->upgradeRequiredFirst)
{
- return null;
+ return;
}
$us = e107::getUserSession();
@@ -570,8 +588,12 @@ TMPO;
{
$message = LAN_PASSWORD_WARNING;
$srch = array('[',']');
- $repl = array("","");
- $mes->addWarning(str_replace($srch,$repl,$message));
+ $repl = array("","");
+ eHelper::addSystemNotification('checkPasswordEncryption', str_replace($srch,$repl,$message));
+ }
+ else
+ {
+ eHelper::clearSystemNotification('checkPasswordEncryption');
}
}
@@ -583,7 +605,11 @@ TMPO;
if($pref['developer'] && (strpos(e_SELF,'localhost') === false) && (strpos(e_SELF,'127.0.0.1') === false))
{
- e107::getMessage()->addWarning($tp->toHTML(LAN_DEVELOPERMODE_CHECK, true));
+ eHelper::addSystemNotification('checkDeveloperMode', $tp->toHTML(LAN_DEVELOPERMODE_CHECK, true));
+ }
+ else
+ {
+ eHelper::clearSystemNotification('checkDeveloperMode');
}
}
@@ -591,7 +617,27 @@ TMPO;
private function checkDependencies()
{
+ if(PHP_MAJOR_VERSION < 8)
+ {
+ $lanFallback = 'Your website is currently running an [outdated version of PHP], which may pose a security risk. If your plugins will allow it, we recommend upgrading to [x] to ensure that your website is secure and up-to-date.';
+ $lan = defset('LAN_PHP_OUTDATED', $lanFallback);
+ $url = e_ADMIN.'phpinfo.php';
+ $lan = e107::getParser()->lanVars($lan, 'PHP 8.2');
+
+ $srch = array('[',']');
+ $repl = [
+ "",
+ ""
+ ];
+
+ $lan = str_replace($srch, $repl, $lan);
+ eHelper::addSystemNotification('checkDependencies', $lan);
+ }
+ else
+ {
+ eHelper::clearSystemNotification('checkDependencies');
+ }
}
@@ -674,9 +720,13 @@ TMPO;
{
if(rename(e_BASE."e107.htaccess", e_BASE.".htaccess")===false)
{
- e107::getMessage()->addWarning("Please rename your e107.htaccess file to .htaccess");
+ eHelper::addSystemNotification('checkHtaccess', "Please rename your e107.htaccess file to .htaccess");
}
}
+ else
+ {
+ eHelper::clearSystemNotification('checkDependencies');
+ }
}
diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php
index 1856907d2..c8c40126f 100644
--- a/e107_core/shortcodes/batch/admin_shortcodes.php
+++ b/e107_core/shortcodes/batch/admin_shortcodes.php
@@ -1699,7 +1699,55 @@ Inverse 10 10
return $text;
}
+ public function sc_admin_notifications()
+ {
+ // $content = @file_get_contents(e_SYSTEM."adminNotifications.json");
+ if(!$array = eHelper::getSystemNotification())
+ {
+ return '';
+ }
+
+ /*return '';*/
+
+ $count = count($array);
+ $lanNotify = defset('LAN_SYSTEM_NOTIFICATIONS_X', '[x] System Notifications');
+ $lan = e107::getParser()->lanVars($lanNotify, $count);
+
+
+ $text = '';
+
+ return $text;
+
+ }
+
+
+ /**
+ * Checks for a new version of e107 that could be available for download.
+ * @return string|null
+ */
public function sc_admin_update()
{
if (!ADMIN) { return null; }
@@ -1708,6 +1756,7 @@ Inverse 10 10
if(empty($pref['check_updates']))
{
+ eHelper::clearSystemNotification('sc_admin_update');
return null;
}
@@ -1733,13 +1782,18 @@ Inverse 10 10
}
$data = e107::unserialize($cached);
+ $message = e107::getParser()->lanVars(LAN_NEWVERSION,$data['version']);
+
+ eHelper::addSystemNotification('sc_admin_update', "$message");
if($data === false || isset($data['status']))
{
+ eHelper::clearSystemNotification('sc_admin_update');
return null;
}
+
// Don't check for updates if running locally (comment out the next line to allow check - but
// remember it can cause delays/errors if its not possible to access the Internet
if(e_DEBUG !== true)
@@ -1748,13 +1802,15 @@ Inverse 10 10
}
+
+
return '
-
@@ -2085,11 +2141,24 @@ Inverse 10 10
}
// $template = $$tmpl;
+ if(e107::getSession()->get('core-update-status')===true)
+ {
+ $lan = defset('LAN_DATABASE_UPDATE', "An update is available for your database. We recommend [running this update] as soon as possible to ensure that your database is secure and up-to-date.");
+ $srch = array('[',']');
+ $repl = [
+ "",
+ ""
+ ];
+ eHelper::addSystemNotification('core_update', str_replace($srch, $repl, $lan));
+ }
+ else
+ {
+ eHelper::clearSystemNotification('core_update');
+ }
+ // $upStatus = (e107::getSession()->get('core-update-status') === true) ? '' : '';
-
- $upStatus = (e107::getSession()->get('core-update-status') === true) ? '' : '';
-
- return varset($template['start']). '
- '.$upStatus.'
' .varset($template['end']);
+ return;
+ // return varset($template['start']). '- '.$upStatus.'
' .varset($template['end']);
}
diff --git a/e107_core/templates/admin_template.php b/e107_core/templates/admin_template.php
index 20c5db5cb..5409a8b87 100644
--- a/e107_core/templates/admin_template.php
+++ b/e107_core/templates/admin_template.php
@@ -206,6 +206,7 @@ $ADMIN_TEMPLATE['header'] = '
{ADMIN_MULTISITE}
{ADMIN_PM}
{ADMIN_DEBUG}
+ {ADMIN_NOTIFICATIONS}
{ADMIN_UPDATE}
diff --git a/e107_handlers/application.php b/e107_handlers/application.php
index 8734ce453..5ebac2bd2 100644
--- a/e107_handlers/application.php
+++ b/e107_handlers/application.php
@@ -4864,6 +4864,8 @@ class eHelper
protected static $_idRegEx = '#[^\w\-]#';
protected static $_styleRegEx = '#[^\w\s\-\.;:!]#';
+ protected static $_systemNotify = 'systemNotifications';
+
/**
* @param $string
* @return array|string|string[]|null
@@ -4873,6 +4875,39 @@ class eHelper
return preg_replace(self::$_classRegEx, '', $string);
}
+
+ /**
+ * @return array
+ */
+ public static function getSystemNotification()
+ {
+ return (array) e107::getSession()->get(self::$_systemNotify);
+ }
+
+
+ /**
+ * @param string $id
+ * @param string $message
+ * @return array|e_core_session|null
+ */
+ public static function addSystemNotification($id, $message)
+ {
+ return e107::getSession()->set(self::$_systemNotify.'/'.$id.'/message', $message);
+ }
+
+
+ /**
+ * @param $id
+ * @return array|e_core_session|null
+ */
+ public static function clearSystemNotification($id = '')
+ {
+ $key = !empty($id) ? self::$_systemNotify.'/'.$id : self::$_systemNotify;
+
+ return e107::getSession()->clear($key);
+ }
+
+
/**
* @param $string
* @return array|string|string[]|null
diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php
index c15545568..17da2b82a 100644
--- a/e107_languages/English/admin/lan_admin.php
+++ b/e107_languages/English/admin/lan_admin.php
@@ -383,7 +383,7 @@ define("LAN_NOPERMISSION", "no permissions");
define("LAN_NO_ADMIN_PERMISSION", "You do not have administrator permissions for [x]");
define("LAN_CREDITS","Credits");
-define("LAN_NEWVERSION","e107 v[x] Available");
+define("LAN_NEWVERSION","e107 v[x] is available for download.");
define("LAN_CHECKALL", "Check All");
define("LAN_UNCHECKALL", "Uncheck All");
@@ -597,4 +597,8 @@ define("LAN_UI_FILTER_THIS_YEAR", "This Year");
define("LAN_SEARCH_ENGINES_X_LIMIT", "Read by search engines. Maximum [x] characters.");
define("LAN_META_TITLE", "Meta Title");
-define("LAN_META_DESCRIPTION", "Meta Description");
\ No newline at end of file
+define("LAN_META_DESCRIPTION", "Meta Description");
+
+define("LAN_SYSTEM_NOTIFICATIONS_X", "[x] System Notification(s)");
+define("LAN_PHP_OUTDATED", "Your website is currently running an [outdated version of PHP], which may pose a security risk. If your plugins will allow it, we recommend upgrading to [x] to ensure that your website is secure and up-to-date.");
+define("LAN_DATABASE_UPDATE", "An update is available for your database. We recommend [running this update] as soon as possible to ensure that your database is secure and up-to-date.");
\ No newline at end of file
diff --git a/e107_themes/bootstrap3/admin_style.css b/e107_themes/bootstrap3/admin_style.css
index a008a4781..ea7202167 100644
--- a/e107_themes/bootstrap3/admin_style.css
+++ b/e107_themes/bootstrap3/admin_style.css
@@ -470,6 +470,14 @@ img.image-selector { margin-bottom:0; }
.dropdown-menu i,
.dropdown-menu img { padding: 0 0; margin-right: 10px; }
+.dropdown-menu li.dropdown-item-text { padding:15px}
+.dropdown-menu li.dropdown-item-text:hover { background: rgba(255,255,255,0.05) }
+.dropdown-menu li.dropdown-item-text { border-bottom:1px solid rgba(255,255,255,0.3)}
+.dropdown-menu > li.dropdown-item-text > a { display: inline !important; padding:0; white-space:normal }
+.dropdown-menu > li.dropdown-item-text > a:focus,
+.dropdown-menu > li.dropdown-item-text > a:hover { background: none; color: white !important }
+#admin-notifications ul.dropdown-menu { width:400px; max-height:calc(100vh - 300px); overflow-y:scroll }
+
ul.navbar-nav li ul.dropdown-menu > li a img,
ul.navbar-nav li ul.dropdown-menu > li a i,
ul#e-latest img,
diff --git a/e107_themes/bootstrap3/css/modern-dark.css b/e107_themes/bootstrap3/css/modern-dark.css
index 9f62fc1fc..f9dcde933 100644
--- a/e107_themes/bootstrap3/css/modern-dark.css
+++ b/e107_themes/bootstrap3/css/modern-dark.css
@@ -1475,7 +1475,7 @@ td.visible-print,th.visible-print{display:table-cell!important}
.text-success,.text-success:hover{color:#51a351}
.text-danger,.text-danger:hover{color:#F86965}
.text-warning,.text-warning:hover{color:#f89406}
-.text-info,.text-info:hover{color:#5bc0de}
+.text-info,.text-info:hover{color:#8BC0ED !important}
.table a{text-decoration:underline}
.table .danger,.table .info,.table .success,.table .warning{color:#fff}
.table-bordered tbody tr.danger td,.table-bordered tbody tr.danger:hover td,.table-bordered tbody tr.success td,.table-bordered tbody tr.success:hover td,.table-bordered tbody tr.warning td,.table-bordered tbody tr.warning:hover td{border-color:#0a0a0a}