From ac9e81dedec788f31c7e29a737c121de2fc342d1 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Mon, 12 Mar 2012 17:40:53 +0000 Subject: [PATCH] 2012-03-12 Juan Manuel Ramon * include/functions_ui.php: Skin is not used on logon error. Fixes: #3464062 * godmode/menu.php: Delete autorefresh in Pandora db interface. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5741 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++ pandora_console/godmode/menu.php | 14 ++++++----- pandora_console/include/functions_ui.php | 31 ++++++++++++++++++++++-- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5580caf728..628f4af193 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2012-03-12 Juan Manuel Ramon + + * include/functions_ui.php: Skin is not used on logon error. + + Fixes: #3464062 + + * godmode/menu.php: Delete autorefresh in Pandora db interface. + 2012-03-12 Miguel de Dios * include/functions_visual_map.php, diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index cd9c210279..4a88c7159f 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -289,12 +289,14 @@ if (check_acl ($config['id_user'], 0, "PM")) { if (array_key_exists('fatherId',$extmenu)) { if (strlen($extmenu['fatherId']) > 0) { $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']); - if (!empty($config['refr'])){ - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr']; - } - else{ - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 60; - } + if ($extmenu["name"] != 'DB interface'){ + if (!empty($config['refr'])){ + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr']; + } + else{ + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 60; + } + } $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon']; $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions'; $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index a235267a5a..837d7f8188 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -940,10 +940,36 @@ function ui_process_page_head ($string, $bitfield) { $config['css'] = array (); } - $exists_css = false; + $login_ok = true; + if (! isset ($config['id_user']) && isset ($_GET["login"])) { + if (isset($_POST['nick']) and isset($_POST['pass'])) { + $nick = get_parameter_post ("nick"); //This is the variable with the login + $pass = get_parameter_post ("pass"); //This is the variable with the password + $nick = db_escape_string_sql($nick); + $pass = db_escape_string_sql($pass); + + // process_user_login is a virtual function which should be defined in each auth file. + // It accepts username and password. The rest should be internal to the auth file. + // The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it + // process_user_login should return false in case of errors or invalid login, the nickname if correct + $nick_in_db = process_user_login ($nick, $pass); + + if ($nick_in_db === false) { + $login_ok = false; + } + } + } + //First, if user has assigned a skin then try to use css files of skin subdirectory $isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); - if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { + if (!$login_ok) { + if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { + enterprise_hook('skins_cleanup'); + } + } + + $exists_css = false; + if ($login_ok and $isFunctionSkins !== ENTERPRISE_NOT_HOOK) { //Checks if user's skin is available $exists_skin = enterprise_hook('skins_is_path_set'); if ($exists_skin){ @@ -971,6 +997,7 @@ function ui_process_page_head ($string, $bitfield) { //We can't load empty and we loaded (conditionally) ie $loaded = array ('', 'ie'); + foreach ($config['css'] as $name => $filename) { if (in_array ($name, $loaded)) continue;