Merge remote-tracking branch 'origin/develop' into ent-3595-discovery-fase-2

Conflicts:
	pandora_console/include/class/ConsoleSupervisor.php


Former-commit-id: d734637dea22b18b1d30a3d8575cd45500558e29
This commit is contained in:
Daniel Barbero Martin 2019-03-26 18:48:49 +01:00
commit 5504741a9d
5 changed files with 62 additions and 10 deletions

View File

@ -234,6 +234,7 @@ class ConsoleSupervisor
/* /*
* Check license. * Check license.
* NOTIF.LICENSE.EXPIRATION * NOTIF.LICENSE.EXPIRATION
* NOTIF.LICENSE.LIMITED
*/ */
$this->checkLicense(); $this->checkLicense();
@ -537,6 +538,10 @@ class ConsoleSupervisor
} }
switch ($data['type']) { switch ($data['type']) {
case 'NOTIF.LICENSE.LIMITED':
$max_age = 0;
break;
case 'NOTIF.LICENSE.EXPIRATION': case 'NOTIF.LICENSE.EXPIRATION':
case 'NOTIF.FILES.ATTACHMENT': case 'NOTIF.FILES.ATTACHMENT':
case 'NOTIF.FILES.DATAIN': case 'NOTIF.FILES.DATAIN':
@ -684,12 +689,28 @@ class ConsoleSupervisor
$days_to_expiry = ((strtotime($license['expiry_date']) - time()) / (60 * 60 * 24)); $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)) { if (($days_to_expiry <= 15) && ($days_to_expiry > 0)) {
// Warn user if license is going to expire in 15 days or less. // Warn user if license is going to expire in 15 days or less.
$this->notify( $this->notify(
[ [
'type' => 'NOTIF.LICENSE_EXPIRATION', 'type' => 'NOTIF.LICENSE.EXPIRATION',
'title' => __('License is about to expire'), 'title' => __('License is going to expire.'),
'message' => __( 'message' => __(
'Your license will expire in %d days. Please, contact our sales department.', 'Your license will expire in %d days. Please, contact our sales department.',
$days_to_expiry $days_to_expiry

View File

@ -1438,7 +1438,13 @@ function enterprise_include($filename)
global $config; global $config;
// Load enterprise extensions // 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) { if ($filepath === false) {
return ENTERPRISE_NOT_HOOK; return ENTERPRISE_NOT_HOOK;

View File

@ -380,7 +380,18 @@ function extensions_load_extensions($process_login)
// ~ } // ~ }
// ~ } // ~ }
// ~ else { // ~ else {
try {
include_once $path_extension; include_once $path_extension;
}
// PHP 7
catch (Throwable $e) {
}
// PHP 5
catch (Exception $e) {
}
// ~ } // ~ }
} }
} }

View File

@ -163,12 +163,21 @@ $(document).ready (function () {
background: "black" background: "black"
}, },
open: function() { open: function() {
setTimeout(function(){ var remaining = 30;
$("#spinner_ok").hide();
// Timeout counter.
var count = function() {
if (remaining > 0) {
$("#license_error_remaining").text(remaining);
remaining -= 1;
} else {
$("#license_error_remaining").hide();
$("#ok_buttom").show(); $("#ok_buttom").show();
}, clearInterval(count);
30000 }
); }
setInterval(count, 1000);
} }
}); });

View File

@ -244,6 +244,10 @@ if (strlen($search) > 0) {
// Login process // Login process
if (! isset($config['id_user'])) { if (! isset($config['id_user'])) {
// Clear error messages.
unset($_COOKIE['errormsg']);
setcookie('errormsg', null, -1);
if (isset($_GET['login'])) { if (isset($_GET['login'])) {
include_once 'include/functions_db.php'; include_once 'include/functions_db.php';
// Include it to use escape_string_sql function // Include it to use escape_string_sql function
@ -1026,10 +1030,11 @@ if ($config['pure'] == 0) {
echo '<div id="container"><div id="head">'; echo '<div id="container"><div id="head">';
include 'general/header.php'; include 'general/header.php';
if ($_SESSION['menu_type']=='classic') if ($_SESSION['menu_type'] == 'classic') {
echo '</div><div id="page" class="page_classic"><div id="menu">'; echo '</div><div id="page" class="page_classic"><div id="menu">';
else } else {
echo '</div><div id="page" class="page_collapsed"><div id="menu">'; echo '</div><div id="page" class="page_collapsed"><div id="menu">';
}
include 'general/main_menu.php'; include 'general/main_menu.php';
echo '</div>'; echo '</div>';