Browse Source

[svn r21655] logic changes - Allow install dokeos in IE - (partial FS#4367)

Isaac Flores 15 years ago
parent
commit
9a7e5b733f
2 changed files with 38 additions and 19 deletions
  1. 30 14
      main/install/index.php
  2. 8 5
      main/install/install_functions.inc.php

+ 30 - 14
main/install/index.php

@@ -127,26 +127,26 @@ EOM;
 */
 session_start();
 // Including necessary files
-@include('../inc/installedVersion.inc.php');
-require('../inc/lib/main_api.lib.php');
+@include '../inc/installedVersion.inc.php';
+require '../inc/lib/main_api.lib.php';
 
-require('../lang/english/trad4all.inc.php');
-require('../lang/english/install.inc.php');
+require '../lang/english/trad4all.inc.php';
+require '../lang/english/install.inc.php';
 
 if (!empty($_POST['language_list']))
 {
 	$search = array('../','\\0');
 	$install_language = str_replace($search,'',urldecode($_POST['language_list']));
 	if(!is_dir('../lang/'.$install_language)){$install_language = 'english';}
-	include_once("../lang/$install_language/trad4all.inc.php");
-	include_once("../lang/$install_language/install.inc.php");
+	include_once "../lang/$install_language/trad4all.inc.php";
+	include_once "../lang/$install_language/install.inc.php";
 	api_session_register('install_language');
 }
 elseif ( isset($_SESSION['install_language']) && $_SESSION['install_language'] )
 {
 	$install_language = $_SESSION['install_language'];
-	include_once("../lang/$install_language/trad4all.inc.php");
-	include_once("../lang/$install_language/install.inc.php");
+	include_once "../lang/$install_language/trad4all.inc.php";
+	include_once "../lang/$install_language/install.inc.php";
 }
 
 // These global variables must be set for proper working of the function get_lang(...) during the installation.
@@ -180,8 +180,8 @@ if (isset($install_language))
 header('Content-Type: text/html; charset='. $charset);
 api_set_default_encoding($charset); // Initialization of the default encoding that will be used by the string routines.
 
-require_once('install_upgrade.lib.php'); //also defines constants
-require_once('install_functions.inc.php');
+require_once 'install_upgrade.lib.php'; //also defines constants
+require_once 'install_functions.inc.php';
 
 // Some constants
 define('DOKEOS_INSTALL',1);
@@ -224,6 +224,17 @@ $new_version_stable = true;
 		STEP 1 : INITIALIZES FORM VARIABLES IF IT IS THE FIRST VISIT
 ==============================================================================
 */
+
+//Is valid request
+$is_valid_request=$_REQUEST['is_executable'];
+foreach ($_POST as $request_index=>$request_value) {
+	if (substr($request_index,0,4)=='step') {
+		if ($request_index<>$is_valid_request) {
+			unset($_POST[$request_index]);
+		}
+	}
+}
+
 $badUpdatePath=false;
 $emptyUpdatePath=true;
 $proposedUpdatePath = '';
@@ -325,7 +336,7 @@ else
 
 if($installType=='update' && in_array($my_old_version,$update_from_version_8))
 {
-	include_once('../inc/conf/configuration.php');
+	include_once '../inc/conf/configuration.php';
 }
 
 if(!isset($_GET['running']))
@@ -470,7 +481,12 @@ if ($encryptPassForm=='1' ) {
 					$('#dbUserForm').attr('disabled','disabled');
 					$('#dbStatsForm').attr('value','dokeos_main');
 					$('#dbUserForm').attr('value','dokeos_main');												
-			}	
+			}
+		//Allow dokeos install in IE
+		$("button").click(function() {
+			$("#is_executable").attr("value",$(this).attr("name"));
+		});
+			
 	 	} ); 	
 	</script>
 	<script type="text/javascript">
@@ -607,7 +623,6 @@ if ($encryptPassForm=='1' ) {
 
 
 <?php
-
 if($_POST['step2'])
 {
 	//STEP 3 : LICENSE
@@ -620,6 +635,7 @@ elseif($_POST['step3'])
 }
 elseif($_POST['step4'])
 {
+
 	//STEP 5 : CONFIGURATION SETTINGS
 	//if update, try getting settings from the database...
 	if($installType == 'update')
@@ -753,7 +769,7 @@ elseif($_POST['step5'])
 	<table width="100%">
 	<tr>
 	  <td><button type="submit" class="back" name="step4" value="&lt; <?php echo get_lang('Previous'); ?>" /><?php echo get_lang('Previous'); ?></button></td>
-	  <td align="right"><button class="save" type="submit" name="step6" value="<?php echo get_lang('InstallDokeos'); ?> &gt;" onclick="javascript:if(this.value == '<?php $msg = get_lang('PleaseWait');?>...') return false; else this.value='<?php $msg = get_lang('InstallDokeos');?>...';" ><?php echo $msg; ?></button></td>
+	  <td align="right"><input type="hidden" name="is_executable" id="is_executable" value="-" /><button class="save" type="submit" name="step6" value="<?php echo get_lang('InstallDokeos'); ?> &gt;" onclick="javascript:if(this.value == '<?php $msg = get_lang('PleaseWait');?>...') return false; else this.value='<?php $msg = get_lang('InstallDokeos');?>...';" ><?php echo $msg; ?></button></td>
 	</tr>
 	</table>
 

+ 8 - 5
main/install/install_functions.inc.php

@@ -364,6 +364,7 @@ function display_language_selection()
 	<form id="lang_form" method="post" action="<?php echo api_get_self(); ?>">
 <?php display_language_selection_box(); ?>
 	<button type="submit" name="step1" class="next" value="<?php get_lang('Next');?> &gt;"><?php echo get_lang('Next');?></button>
+	<input type="hidden" name="is_executable" id="is_executable" value="-" />
 	</form>
 <?php }
 
@@ -585,6 +586,7 @@ function display_requirements($installType, $badUpdatePath, $updatePath='', $upd
 			<tr>
 			<td colspan="2" align="center">
 				<button type="submit" class="back" name="step1" value="&lt; <?php echo get_lang('Back');?>" ><?php echo get_lang('Back');?></button>
+				<input type="hidden" name="is_executable" id="is_executable" value="-" />	
 				<button type="submit" class="next" name="<?php echo (isset($_POST['step2_update_6'])?'step2_update_6':'step2_update_8');?>" value="<?php echo get_lang('Next');?> &gt;" ><?php echo get_lang('Next');?></button>
 			</td>
 			</tr>
@@ -674,7 +676,7 @@ function display_requirements($installType, $badUpdatePath, $updatePath='', $upd
 		<p align="center">
 		<button type="submit" name="step1" class="back" onclick="window.location='index.php';return false;" value="&lt; <?php echo get_lang('Previous'); ?>" ><?php echo get_lang('Previous'); ?></button>
 		<button type="submit" name="step2_install" class="add" value="<?php echo get_lang("NewInstallation"); ?>" <?php if($error) if($error)echo 'disabled="disabled"'; ?> ><?php echo get_lang('NewInstallation'); ?></button>
-
+		<input type="hidden" name="is_executable" id="is_executable" value="-" />
 		<?php
 		//real code
 		echo '<button type="submit" class="save" name="step2_update_8" value="Upgrade from Dokeos 1.8.x"';
@@ -717,6 +719,7 @@ function display_license_agreement()
 				<td></td>
 				<td align="center">
 					<button type="submit" class="back" name="step1" value="&lt; <?php echo get_lang('Previous'); ?>" ><?php echo get_lang('Previous'); ?></button>
+					<input type="hidden" name="is_executable" id="is_executable" value="-" />
 					<button type="submit" class="next" name="step3" value="<?php echo get_lang('IAccept'); ?> &gt;" ><?php echo get_lang('IAccept'); ?></button>
 				</td>
 			</tr>
@@ -918,11 +921,11 @@ function display_database_settings_form($installType, $dbHostForm, $dbUsernameFo
 				<!--<div  style="float:left; margin-right:10px;">
 				<img src="../img/message_confirmation.png" alt="Confirmation" />
 				</div>-->
-				<div style="float:left;">
+				<!--<div style="float:left;">-->
 				MySQL host info: <?php echo mysql_get_host_info(); ?><br />
 				MySQL server version: <?php echo mysql_get_server_info(); ?><br />
 				MySQL protocol version: <?php echo mysql_get_proto_info(); ?>
-			</div>
+				<!--</div>-->
 				<div style="clear:both;"></div>
 			</div>
 		</td>
@@ -944,7 +947,7 @@ function display_database_settings_form($installType, $dbHostForm, $dbUsernameFo
 	<tr>
 	  <td><button type="submit" name="step2" class="back" value="&lt; <?php echo get_lang('Previous'); ?>" ><?php echo get_lang('Previous'); ?></button></td>
 	  <td>&nbsp;</td>
-	  <td align="right"><button type="submit" class="next" name="step4" value="<?php echo get_lang('Next'); ?> &gt;" /><?php echo get_lang('Next'); ?></button></td>
+	  <td align="right"><input type="hidden" name="is_executable" id="is_executable" value="-" /><button type="submit" class="next" name="step4" value="<?php echo get_lang('Next'); ?> &gt;" /><?php echo get_lang('Next'); ?></button></td>
 	</tr>
 	</table>
 	<?php
@@ -1143,7 +1146,7 @@ function display_configuration_settings_form($installType, $urlForm, $languageFo
 	</tr>
 	<tr>
 	  <td><button type="submit" class="back" name="step3" value="&lt; <?php echo get_lang('Previous'); ?>" /><?php echo get_lang('Previous'); ?></button></td>
-	  <td align="right"><button class="next" type="submit" name="step5" value="<?php echo get_lang('Next'); ?> &gt;" /><?php echo get_lang('Next'); ?></button></td>
+	  <td align="right"><input type="hidden" name="is_executable" id="is_executable" value="-" /><button class="next" type="submit" name="step5" value="<?php echo get_lang('Next'); ?> &gt;" /><?php echo get_lang('Next'); ?></button></td>
 	</tr>
 	</table>
 	<?php