mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Fixed the custom config values for user in the first login.
This commit is contained in:
parent
e2fac6ccb2
commit
99786a5a16
@ -115,6 +115,7 @@ require_once ($ownDir. 'functions_config.php');
|
|||||||
|
|
||||||
date_default_timezone_set("Europe/Madrid");
|
date_default_timezone_set("Europe/Madrid");
|
||||||
|
|
||||||
|
|
||||||
config_process_config();
|
config_process_config();
|
||||||
|
|
||||||
if (!isset($config["homeurl_static"])) {
|
if (!isset($config["homeurl_static"])) {
|
||||||
@ -142,32 +143,9 @@ else {
|
|||||||
$config["global_block_size"] = $config["block_size"];
|
$config["global_block_size"] = $config["block_size"];
|
||||||
$config["global_flash_charts"] = $config["flash_charts"];
|
$config["global_flash_charts"] = $config["flash_charts"];
|
||||||
|
|
||||||
|
|
||||||
if (isset ($config['id_user'])) {
|
if (isset ($config['id_user'])) {
|
||||||
$userinfo = get_user_info ($config['id_user']);
|
config_user_set_custom_config();
|
||||||
|
|
||||||
// Refresh the last_connect info in the user table
|
|
||||||
// if last update was more than 5 minutes ago
|
|
||||||
if($userinfo['last_connect'] < (time()-SECONDS_1MINUTE)) {
|
|
||||||
update_user($config['id_user'], array('last_connect' => time()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// If block_size or flash_chart are provided then override global settings
|
|
||||||
if (!empty($userinfo["block_size"]) && ($userinfo["block_size"] != 0))
|
|
||||||
$config["block_size"] = $userinfo["block_size"];
|
|
||||||
|
|
||||||
if ($userinfo["flash_chart"] != -1)
|
|
||||||
$config["flash_charts"] = $userinfo["flash_chart"];
|
|
||||||
|
|
||||||
// Each user could have it's own timezone)
|
|
||||||
if (isset($userinfo["timezone"])) {
|
|
||||||
if ($userinfo["timezone"] != "") {
|
|
||||||
date_default_timezone_set($userinfo["timezone"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (defined('METACONSOLE')) {
|
|
||||||
$config['metaconsole_access'] = $userinfo["metaconsole_access"];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if inventory_changes_blacklist is setted, if not create it
|
// Check if inventory_changes_blacklist is setted, if not create it
|
||||||
|
@ -1428,4 +1428,33 @@ function config_return_in_bytes($val) {
|
|||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function config_user_set_custom_config() {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$userinfo = get_user_info ($config['id_user']);
|
||||||
|
|
||||||
|
// Refresh the last_connect info in the user table
|
||||||
|
// if last update was more than 5 minutes ago
|
||||||
|
if ($userinfo['last_connect'] < (time()-SECONDS_1MINUTE)) {
|
||||||
|
update_user($config['id_user'], array('last_connect' => time()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// If block_size or flash_chart are provided then override global settings
|
||||||
|
if (!empty($userinfo["block_size"]) && ($userinfo["block_size"] != 0))
|
||||||
|
$config["block_size"] = $userinfo["block_size"];
|
||||||
|
|
||||||
|
if ($userinfo["flash_chart"] != -1)
|
||||||
|
$config["flash_charts"] = $userinfo["flash_chart"];
|
||||||
|
|
||||||
|
// Each user could have it's own timezone)
|
||||||
|
if (isset($userinfo["timezone"])) {
|
||||||
|
if ($userinfo["timezone"] != "") {
|
||||||
|
date_default_timezone_set($userinfo["timezone"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined('METACONSOLE')) {
|
||||||
|
$config['metaconsole_access'] = $userinfo["metaconsole_access"];
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -69,6 +69,7 @@ if ((! file_exists ("include/config.php")) || (! is_readable ("include/config.ph
|
|||||||
session_start ();
|
session_start ();
|
||||||
require_once ("include/config.php");
|
require_once ("include/config.php");
|
||||||
|
|
||||||
|
|
||||||
// If metaconsole activated, redirect to it
|
// If metaconsole activated, redirect to it
|
||||||
if ($config['metaconsole'] == 1 && $config['enterprise_installed'] == 1) {
|
if ($config['metaconsole'] == 1 && $config['enterprise_installed'] == 1) {
|
||||||
header ("Location: " . $config['homeurl'] . "enterprise/meta");
|
header ("Location: " . $config['homeurl'] . "enterprise/meta");
|
||||||
@ -395,6 +396,13 @@ if (! isset ($config['id_user'])) {
|
|||||||
db_logon ($nick_in_db, $_SERVER['REMOTE_ADDR']);
|
db_logon ($nick_in_db, $_SERVER['REMOTE_ADDR']);
|
||||||
$_SESSION['id_usuario'] = $nick_in_db;
|
$_SESSION['id_usuario'] = $nick_in_db;
|
||||||
$config['id_user'] = $nick_in_db;
|
$config['id_user'] = $nick_in_db;
|
||||||
|
|
||||||
|
//==========================================================
|
||||||
|
//-------- SET THE CUSTOM CONFIGS OF USER ------------------
|
||||||
|
|
||||||
|
config_user_set_custom_config();
|
||||||
|
//==========================================================
|
||||||
|
|
||||||
//Remove everything that might have to do with people's passwords or logins
|
//Remove everything that might have to do with people's passwords or logins
|
||||||
unset ($pass, $login_good);
|
unset ($pass, $login_good);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user