From 9b025105991e70f466df7f9a829c20d161972162 Mon Sep 17 00:00:00 2001
From: m-lopez-f <miguel.lopez@artica.es>
Date: Mon, 9 Jan 2017 09:09:41 +0100
Subject: [PATCH] Fixed problems with wizard login when cancel wizard. Ticket:
 #4246

(cherry picked from commit f11e78cc3a0ccd8aea6f014952afd07198b27af0)
---
 pandora_console/general/login_required.php | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/pandora_console/general/login_required.php b/pandora_console/general/login_required.php
index d7151391a7..5cb52604c5 100644
--- a/pandora_console/general/login_required.php
+++ b/pandora_console/general/login_required.php
@@ -24,6 +24,7 @@ if (is_ajax()) {
 	
 	$save_identification = get_parameter ('save_required_wizard', 0);
 	$change_language = get_parameter ('change_language', 0);
+	$cancel_wizard = get_parameter ('cancel_wizard', 0);
 	
 	// Updates the values get on the identification wizard
 	if ($save_identification) {
@@ -52,6 +53,10 @@ if (is_ajax()) {
 		config_update_value ('language', $change_language);
 	}
 	
+	if ($cancel_wizard !== 0) {
+		config_update_value ('initial_wizard', 1);
+	}
+	
 	return;
 }
 
@@ -219,7 +224,13 @@ $(document).ready (function () {
 	$(".ui-draggable").css("cursor", "inherit");
 	
 	$("#button-cancel").click (function () {
-		$("#login_id_dialog" ).dialog('close')
+		jQuery.post ("ajax.php",
+			{"page": "general/login_required",
+			"cancel_wizard": 1},
+			function (data) {}
+		);
+		
+		$("#login_id_dialog" ).dialog('close');
 	});
 	
 });