From f4c2ae0ea885d5e3fd467785fc3b2c8b45693406 Mon Sep 17 00:00:00 2001
From: mdtrooper <tres.14159@gmail.com>
Date: Mon, 30 Sep 2013 13:56:14 +0000
Subject: [PATCH] 2013-09-30 Miguel de Dios <miguel.dedios@artica.es>

	* index.php: fixed the check login parameter.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8832 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_console/ChangeLog |  4 ++++
 pandora_console/index.php | 19 ++++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index de5df0bee0..ad37725f18 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,7 @@
+2013-09-30 Miguel de Dios <miguel.dedios@artica.es>
+	
+	* index.php: fixed the check login parameter.
+
 2013-09-30  Sergio Martin <sergio.martin@artica.es>
 
 	* include/graphs/pChart/pPie.class.php: Fix reversed colors bug in
diff --git a/pandora_console/index.php b/pandora_console/index.php
index 7ec162e239..9233d71684 100644
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -114,9 +114,10 @@ if (get_parameter ("refr"))
 	$config["refr"] = (int) get_parameter ("refr");
 
 ob_start ();
-echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
-echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";
-echo '<head>';
+echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' .
+	"\n";
+echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
+echo '<head>' . "\n";
 
 //This starts the page head. In the call back function, things from $page['head'] array will be processed into the head
 ob_start ('ui_process_page_head');
@@ -126,7 +127,8 @@ enterprise_include ('index.php');
 
 // This tag is included in the buffer passed to ui_process_page_head so 
 // technically it can be stripped
-echo '</head>'."\n";
+echo '</head>' . "\n";
+
 require_once ("include/functions_themes.php");
 ob_start ('ui_process_page_body');
 
@@ -182,7 +184,8 @@ if (! isset ($config['id_user']) && isset ($_GET["loginhash"])) {
 }
 elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
 	// Login process 
-	include_once('include/functions_db.php');//Include it to use escape_string_sql function
+	include_once('include/functions_db.php'); //Include it to use escape_string_sql function
+	
 	$config["auth_error"] = ""; //Set this to the error message from the authorization mechanism
 	$nick = get_parameter_post ("nick"); //This is the variable with the login
 	$pass = get_parameter_post ("pass"); //This is the variable with the password
@@ -224,7 +227,9 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
 		}
 	}
 	
-	if (($nick_in_db !== false) && $expired_pass) { //login ok and password has expired
+	if (($nick_in_db !== false) && $expired_pass) {
+		//login ok and password has expired
+		
 		require_once ('general/login_page.php');
 		db_pandora_audit("Password expired", "Password expired: ".$nick, $nick);
 		while (@ob_end_flush ());
@@ -398,7 +403,7 @@ if ($old_global_counter_chat != $now_global_counter_chat) {
 }
 
 // Display login help info dialog
-if (get_parameter ('login', 0) == 1) {
+if (get_parameter ('login', 0) !== 0) {
 	
 	// If it's configured to not skip this
 	if (!isset($config['skip_login_help_dialog']) ||