Просмотр исходного кода

Reinstated the detect Configuration (#1624)

it is no longer required for the detect_switch to pass but this
reinstates the ability to change the values and check them with detect
configuration
Mafoo 9 лет назад
Родитель
Сommit
d976ef1f76
2 измененных файлов с 19 добавлено и 12 удалено
  1. 15 8
      core/install/install.php
  2. 4 4
      core/install/resources/page_parts/install_event_socket.php

+ 15 - 8
core/install/install.php

@@ -97,6 +97,7 @@
 //intialize variables
 //intialize variables
 	$install_step = '';
 	$install_step = '';
 	$return_install_step = '';
 	$return_install_step = '';
+	$re_detect_switch = false;
 
 
 //process the the HTTP POST
 //process the the HTTP POST
 	if (count($_POST) > 0) {
 	if (count($_POST) > 0) {
@@ -116,6 +117,9 @@
 			$install_template_name		= $_POST["install_template_name"];
 			$install_template_name		= $_POST["install_template_name"];
 			$domain_name				= $_POST["domain_name"];
 			$domain_name				= $_POST["domain_name"];
 		}
 		}
+		if($install_step == 'config_detail' and strlen(check_str($_POST["re_detect_switch"])) > 0 ){
+			$re_detect_switch = true;
+		}
 	}
 	}
 
 
 //set the install step if it is not set
 //set the install step if it is not set
@@ -177,7 +181,10 @@
 		elseif (strlen($admin_password) < 5) { $messages[] = "Please provide an Admin Password that is 5 or more characters.<br>\n"; }
 		elseif (strlen($admin_password) < 5) { $messages[] = "Please provide an Admin Password that is 5 or more characters.<br>\n"; }
 		if ( count($messages) > $existing_errors) { $install_step = 'config_detail'; }
 		if ( count($messages) > $existing_errors) { $install_step = 'config_detail'; }
 	}
 	}
-
+	if($re_detect_switch == true ){
+		$install_step = 'detect_config';
+	}
+	
 	if($install_step =='execute') {
 	if($install_step =='execute') {
 		//set the max execution time to 1 hour
 		//set the max execution time to 1 hour
 		ini_set('max_execution_time',3600);
 		ini_set('max_execution_time',3600);
@@ -214,17 +221,17 @@
 		echo "</form>\n";
 		echo "</form>\n";
 	} elseif($install_step == 'detect_config'){
 	} elseif($install_step == 'detect_config'){
 		if(!($event_host == '' || $event_host == 'localhost' || $event_host == '::1' || $event_host == '127.0.0.1' )){
 		if(!($event_host == '' || $event_host == 'localhost' || $event_host == '::1' || $event_host == '127.0.0.1' )){
-			echo "<p><b>Warning</b> you have choosen a value other than localhost for event_host, this is unsoported at present</p>\n";
+			echo "<p><b>Warning</b> you have chosen a value other than localhost for event_host, this is unsupported at present</p>\n";
 		}
 		}
 		//if($detect_ok){
 		//if($detect_ok){
 			echo "<form method='post' name='frm' action=''>\n";
 			echo "<form method='post' name='frm' action=''>\n";
 			include "resources/page_parts/install_event_socket.php";
 			include "resources/page_parts/install_event_socket.php";
-			echo "	<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
-			echo "	<input type='hidden' name='return_install_step' value='detect_config'/>\n";
-			echo "	<input type='hidden' name='install_step' value='config_detail'/>\n";
-			echo "	<input type='hidden' name='event_host' value='$event_host'/>\n";
-			echo "	<input type='hidden' name='event_port' value='$event_port'/>\n";
-			echo "	<input type='hidden' name='event_password' value='$event_password'/>\n";
+			//echo "	<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
+			//echo "	<input type='hidden' name='return_install_step' value='detect_config'/>\n";
+			//echo "	<input type='hidden' name='install_step' value='config_detail'/>\n";
+			//echo "	<input type='hidden' name='event_host' value='$event_host'/>\n";
+			//echo "	<input type='hidden' name='event_port' value='$event_port'/>\n";
+			//echo "	<input type='hidden' name='event_password' value='$event_password'/>\n";
 			//echo "	<div style='text-align:right'>\n";
 			//echo "	<div style='text-align:right'>\n";
 			//echo "    <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
 			//echo "    <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
 			//echo "    <button type='submit' class='btn' id='next'>".$text['button-next']."</button>\n";
 			//echo "    <button type='submit' class='btn' id='next'>".$text['button-next']."</button>\n";

+ 4 - 4
core/install/resources/page_parts/install_event_socket.php

@@ -17,7 +17,7 @@
 
 
 	The Initial Developer of the Original Code is
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	Portions created by the Initial Developer are Copyright (C) 2008-2016
 	the Initial Developer. All Rights Reserved.
 	the Initial Developer. All Rights Reserved.
 
 
 	Contributor(s):
 	Contributor(s):
@@ -31,8 +31,8 @@
 	try {
 	try {
 		$switch_detect->detect();
 		$switch_detect->detect();
 	} catch(Exception $e){
 	} catch(Exception $e){
-		//echo "<p><b>Failed to detect configuration</b> detect_switch reported: " . $e->getMessage() ."</p>\n";
-		//$detect_ok = false;
+		echo "<p><b>Failed to detect configuration</b> detect_switch reported: " . $e->getMessage() ."</p>\n";
+		$detect_ok = false;
 	}
 	}
 	echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
 	echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
 	echo "<input type='hidden' name='install_step' value='detect_config'/>\n";
 	echo "<input type='hidden' name='install_step' value='detect_config'/>\n";
@@ -41,7 +41,7 @@
 	echo "<tr>\n";
 	echo "<tr>\n";
 	echo "<td width='30%' align='left' nowrap><b>".$text['header-event_socket']."</b><br><br></td>\n";
 	echo "<td width='30%' align='left' nowrap><b>".$text['header-event_socket']."</b><br><br></td>\n";
 	echo "<td width='70%' align='right'>";
 	echo "<td width='70%' align='right'>";
-	//echo "	<input type='button' name='detect' class='btn' onclick=\"location.reload();\" value='".$text['button-detect']."'/>\n";
+	echo "	<input type='submit' name='re_detect_switch' class='btn' value='".$text['button-detect']."'/>\n";
 	echo "	<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
 	echo "	<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
 	echo "	<input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
 	echo "	<input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
 	echo "</td>\n";
 	echo "</td>\n";