$request_value) { if (substr($request_index, 0, 4) == 'step') { if ($request_index != $is_valid_request) { unset($_POST[$request_index]); } } } $badUpdatePath = false; $emptyUpdatePath = true; $proposedUpdatePath = ''; if(!empty($_POST['updatePath'])) { $proposedUpdatePath = $_POST['updatePath']; } if ($_POST['step2_install'] || $_POST['step2_update_8'] || $_POST['step2_update_6']) { if ($_POST['step2_install']) { $installType = 'new'; $_POST['step2'] = 1; } else { $installType = 'update'; if ($_POST['step2_update_8']) { $emptyUpdatePath = false; if(empty($_POST['updatePath'])) { $proposedUpdatePath = $_SERVER['DOCUMENT_ROOT']; } else { $proposedUpdatePath = $_POST['updatePath']; } if (substr($proposedUpdatePath,-1) != '/') { $proposedUpdatePath .= '/'; } if (file_exists($proposedUpdatePath)) { if (in_array($my_old_version,$update_from_version_8)) { $_POST['step2'] = 1; } else { $badUpdatePath = true; } } else { $badUpdatePath = true; } } else { //step2_update_6, presumably if (empty($_POST['updatePath'])) { $_POST['step1'] = 1; } else { $emptyUpdatePath = false; if(substr($_POST['updatePath'], -1) != '/') { $_POST['updatePath'] .= '/'; } if (file_exists($_POST['updatePath'])) { //1.6.x $my_old_version = get_config_param('clarolineVersion', $_POST['updatePath']); if (in_array($my_old_version, $update_from_version_6)) { $_POST['step2'] = 1; $proposedUpdatePath = $_POST['updatePath']; } else { $badUpdatePath = true; } } else { $badUpdatePath = true; } } } } } elseif($_POST['step1']) { $_POST['updatePath'] = ''; $installType = ''; $updateFromConfigFile = ''; unset($_GET['running']); } else { $installType = $_GET['installType']; $updateFromConfigFile = $_GET['updateFromConfigFile']; } if ($installType == 'update' && in_array($my_old_version, $update_from_version_8)) { include_once '../inc/conf/configuration.php'; } if (!isset($_GET['running'])) { $dbHostForm ='localhost'; $dbUsernameForm ='root'; $dbPassForm =''; $dbPrefixForm =''; $dbNameForm ='chamilo_main'; $dbStatsForm ='chamilo_stats'; $dbScormForm ='chamilo_scorm'; $dbUserForm ='chamilo_user'; // extract the path to append to the url if Chamilo is not installed on the web root directory $urlAppendPath = str_replace('/main/install/index.php', '', api_get_self()); $urlForm = 'http://'.$_SERVER['HTTP_HOST'].$urlAppendPath.'/'; $pathForm = str_replace('\\', '/', realpath('../..')).'/'; $emailForm = $_SERVER['SERVER_ADMIN']; $email_parts = explode('@', $emailForm); if ($email_parts[1] == 'localhost') { $emailForm .= '.localdomain'; } $adminLastName = 'Doe'; $adminFirstName = 'John'; $loginForm = 'admin'; $passForm = api_generate_password(); $campusForm = 'My campus'; $educationForm = 'Albert Einstein'; $adminPhoneForm = '(000) 001 02 03'; $institutionForm = 'My Organisation'; $institutionUrlForm = 'http://www.chamilo.org'; $languageForm = 'english'; $checkEmailByHashSent = 0; $ShowEmailnotcheckedToStudent = 1; $userMailCanBeEmpty = 1; $allowSelfReg = 1; $allowSelfRegProf = 1; $enableTrackingForm = 1; $singleDbForm = 0; $encryptPassForm = 'md5'; $session_lifetime = 360000; } else { foreach($_POST as $key => $val) { $magic_quotes_gpc = ini_get('magic_quotes_gpc') ? true : false; if (is_string($val)) { if ($magic_quotes_gpc) { $val = stripslashes($val); } $val = trim($val); $_POST[$key] = $val; } elseif(is_array($val)) { foreach ($val as $key2 => $val2) { if ($magic_quotes_gpc) { $val2 = stripslashes($val2); } $val2 = trim($val2); $_POST[$key][$key2] = $val2; } } $GLOBALS[$key] = $_POST[$key]; } } // The Steps $total_steps = 7; if (!$_POST) { $current_step = 1; } elseif (!empty($_POST['language_list']) or !empty($_POST['step1']) or ((!empty($_POST['step2_update_8']) or (!empty($_POST['step2_update_6']))) && ($emptyUpdatePath or $badUpdatePath))) { $current_step = 2; } elseif (!empty($_POST['step2']) or (!empty($_POST['step2_update_8']) or (!empty($_POST['step2_update_6'])) )) { $current_step = 3; } elseif (!empty($_POST['step3'])) { $current_step = 4; } elseif (!empty($_POST['step4'])) { $current_step = 5; } elseif (!empty($_POST['step5'])) { $current_step = 6; } // Managing the $encryptPassForm if ($encryptPassForm == '1') { $encryptPassForm = 'md5'; } elseif ($encryptPassForm == '0') { $encryptPassForm = 'none'; } ?>