diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 66d0fd828e..fa06770f31 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -234,6 +234,7 @@ class ConsoleSupervisor /* * Check license. * NOTIF.LICENSE.EXPIRATION + * NOTIF.LICENSE.LIMITED */ $this->checkLicense(); @@ -537,6 +538,10 @@ class ConsoleSupervisor } switch ($data['type']) { + case 'NOTIF.LICENSE.LIMITED': + $max_age = 0; + break; + case 'NOTIF.LICENSE.EXPIRATION': case 'NOTIF.FILES.ATTACHMENT': case 'NOTIF.FILES.DATAIN': @@ -684,12 +689,28 @@ class ConsoleSupervisor $days_to_expiry = ((strtotime($license['expiry_date']) - time()) / (60 * 60 * 24)); + // Limited mode. + if (isset($config['limited_mode'])) { + // Warn user if license is going to expire in 15 days or less. + $this->notify( + [ + 'type' => 'NOTIF.LICENSE.LIMITED', + 'title' => __('Limited mode.'), + 'message' => io_safe_output($config['limited_mode']), + 'url' => 'index.php?sec=gsetup&sec2=godmode/setup/license', + ] + ); + } else { + $this->cleanNotifications('NOTIF.LICENSE.LIMITED'); + } + + // Expiry. if (($days_to_expiry <= 15) && ($days_to_expiry > 0)) { // Warn user if license is going to expire in 15 days or less. $this->notify( [ - 'type' => 'NOTIF.LICENSE_EXPIRATION', - 'title' => __('License is about to expire'), + 'type' => 'NOTIF.LICENSE.EXPIRATION', + 'title' => __('License is going to expire.'), 'message' => __( 'Your license will expire in %d days. Please, contact our sales department.', $days_to_expiry diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index e1861e70a3..9816e373bb 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1438,7 +1438,13 @@ function enterprise_include($filename) global $config; // Load enterprise extensions - $filepath = realpath($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename); + if (defined('DESTDIR')) { + $destdir = DESTDIR; + } else { + $destdir = ''; + } + + $filepath = realpath($destdir.$config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename); if ($filepath === false) { return ENTERPRISE_NOT_HOOK; diff --git a/pandora_console/include/functions_extensions.php b/pandora_console/include/functions_extensions.php index 8efb4c8f36..66e7ff9c3d 100755 --- a/pandora_console/include/functions_extensions.php +++ b/pandora_console/include/functions_extensions.php @@ -380,7 +380,18 @@ function extensions_load_extensions($process_login) // ~ } // ~ } // ~ else { + try { include_once $path_extension; + } + + // PHP 7 + catch (Throwable $e) { + } + + // PHP 5 + catch (Exception $e) { + } + // ~ } } } diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index bd0da308c4..9e0b3447af 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -163,12 +163,21 @@ $(document).ready (function () { background: "black" }, open: function() { - setTimeout(function(){ - $("#spinner_ok").hide(); + var remaining = 30; + + // Timeout counter. + var count = function() { + if (remaining > 0) { + $("#license_error_remaining").text(remaining); + remaining -= 1; + } else { + $("#license_error_remaining").hide(); $("#ok_buttom").show(); - }, - 30000 - ); + clearInterval(count); + } + } + + setInterval(count, 1000); } }); diff --git a/pandora_console/index.php b/pandora_console/index.php index 9fb4149da0..529be5de7c 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -244,6 +244,10 @@ if (strlen($search) > 0) { // Login process if (! isset($config['id_user'])) { + // Clear error messages. + unset($_COOKIE['errormsg']); + setcookie('errormsg', null, -1); + if (isset($_GET['login'])) { include_once 'include/functions_db.php'; // Include it to use escape_string_sql function @@ -1026,10 +1030,11 @@ if ($config['pure'] == 0) { echo '
';