index.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <?php
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004-2007 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. Copyright (c) Olivier Brouckaert
  9. Copyright (c) Roan Embrechts, Vrije Universiteit Brussel
  10. For a full list of contributors, see "credits.txt".
  11. The full license can be read in "license.txt".
  12. This program is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU General Public License
  14. as published by the Free Software Foundation; either version 2
  15. of the License, or (at your option) any later version.
  16. See the GNU General Public License for more details.
  17. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  18. Mail: info@dokeos.com
  19. ==============================================================================
  20. */
  21. /**
  22. ==============================================================================
  23. * GOAL : Dokeos installation
  24. * As seen from the user, the installation proceeds in 6 steps.
  25. * The user is presented with several webpages where he/she has to make choices
  26. * and/or fill in data.
  27. *
  28. * The aim is, as always, to have good default settings and suggestions.
  29. *
  30. * @todo reduce high level of duplication in this code
  31. * @todo (busy) organise code into functions
  32. * @package dokeos.install
  33. ==============================================================================
  34. */
  35. /*
  36. ==============================================================================
  37. INIT SECTION
  38. ==============================================================================
  39. */
  40. session_start();
  41. // Including necessary files
  42. @include('../inc/installedVersion.inc.php');
  43. require('../inc/lib/main_api.lib.php');
  44. require('../lang/english/trad4all.inc.php');
  45. require('../lang/english/install.inc.php');
  46. if (!empty($_POST['language_list']))
  47. {
  48. $search = array('../','\\0');
  49. $install_language = str_replace($search,'',urldecode($_POST['language_list']));
  50. if(!is_dir('../lang/'.$install_language)){$install_language = 'english';}
  51. include_once("../lang/$install_language/trad4all.inc.php");
  52. include_once("../lang/$install_language/install.inc.php");
  53. api_session_register('install_language');
  54. }
  55. elseif ( isset($_SESSION['install_language']) && $_SESSION['install_language'] )
  56. {
  57. $install_language = $_SESSION['install_language'];
  58. include_once("../lang/$install_language/trad4all.inc.php");
  59. include_once("../lang/$install_language/install.inc.php");
  60. }
  61. $charset = '';
  62. //force ISO-8859-15 for European languages. Leave Apache determine the encoding for others (HTML declaring UTF-8)
  63. $euro_langs = array('english','french','french_KM','french_corporate','french_org','dutch','spanish','german','italian','greek','danish','swedish','norwegian','polish','galician','catalan','czech','finnish');
  64. if(in_array($install_language,$euro_langs))
  65. {
  66. $charset = 'ISO-8859-15';
  67. header('Content-Type: text/html; charset='. $charset);
  68. }
  69. require_once('install_upgrade.lib.php'); //also defines constants
  70. require_once('install_functions.inc.php');
  71. // Some constants
  72. define('DOKEOS_INSTALL',1);
  73. define('MAX_COURSE_TRANSFER',100);
  74. define('INSTALL_TYPE_UPDATE', 'update');
  75. define('FORM_FIELD_DISPLAY_LENGTH', 40);
  76. define('DATABASE_FORM_FIELD_DISPLAY_LENGTH', 25);
  77. define('MAX_FORM_FIELD_LENGTH', 50);
  78. define('DEFAULT_LANGUAGE', 'english');
  79. // setting the error reporting
  80. error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR);
  81. // overriding the timelimit (for large campusses that have to be migrated)
  82. @set_time_limit(0);
  83. //upgrading from any subversion of 1.6 is just like upgrading from 1.6.5
  84. $update_from_version_6=array('1.6','1.6.1','1.6.2','1.6.3','1.6.4','1.6.5');
  85. //upgrading from any subversion of 1.8 avoids the additional step of upgrading from 1.6
  86. $update_from_version_8=array('1.8','1.8.2','1.8.3','1.8.4');
  87. $my_old_version = '';
  88. $tmp_version = get_config_param('dokeos_verion');
  89. if(!empty($_POST['old_version']))
  90. {
  91. $my_old_version = $_POST['old_version'];
  92. }
  93. elseif(!empty($dokeos_version)) //variable coming from installedVersion, normally
  94. {
  95. $my_old_version = $dokeos_version;
  96. }
  97. elseif(!empty($tmp_version))
  98. {
  99. $my_old_version = $tmp_version;
  100. }
  101. $new_version = '1.8.5';
  102. $new_version_stable = false;
  103. /*
  104. ==============================================================================
  105. STEP 1 : INITIALIZES FORM VARIABLES IF IT IS THE FIRST VISIT
  106. ==============================================================================
  107. */
  108. $badUpdatePath=false;
  109. $emptyUpdatePath=true;
  110. $proposedUpdatePath = '';
  111. if(!empty($_POST['updatePath']))
  112. {
  113. $proposedUpdatePath = $_POST['updatePath'];
  114. }
  115. if($_POST['step2_install'] || $_POST['step2_update_8'] || $_POST['step2_update_6'])
  116. {
  117. if($_POST['step2_install'])
  118. {
  119. $installType='new';
  120. $_POST['step2']=1;
  121. }
  122. else
  123. {
  124. $installType='update';
  125. if($_POST['step2_update_8'])
  126. {
  127. $emptyUpdatePath = false;
  128. if(empty($_POST['updatePath']))
  129. {
  130. $proposedUpdatePath = $_SERVER['DOCUMENT_ROOT'];
  131. }
  132. else
  133. {
  134. $proposedUpdatePath = $_POST['updatePath'];
  135. }
  136. if(substr($proposedUpdatePath,-1) != '/')
  137. {
  138. $proposedUpdatePath.='/';
  139. }
  140. if(file_exists($proposedUpdatePath))
  141. {
  142. if(in_array($my_old_version,$update_from_version_8))
  143. {
  144. $_POST['step2']=1;
  145. }
  146. else
  147. {
  148. $badUpdatePath=true;
  149. }
  150. }
  151. else
  152. {
  153. $badUpdatePath=true;
  154. }
  155. }
  156. else //step2_update_6, presumably
  157. {
  158. if(empty($_POST['updatePath']))
  159. {
  160. $_POST['step1']=1;
  161. }
  162. else
  163. {
  164. $emptyUpdatePath = false;
  165. if(substr($_POST['updatePath'],-1) != '/')
  166. {
  167. $_POST['updatePath'].='/';
  168. }
  169. if(file_exists($_POST['updatePath']))
  170. {
  171. //1.6.x
  172. $my_old_version = get_config_param('clarolineVersion',$_POST['updatePath']);
  173. if(in_array($my_old_version,$update_from_version_6))
  174. {
  175. $_POST['step2']=1;
  176. $proposedUpdatePath = $_POST['updatePath'];
  177. }
  178. else
  179. {
  180. $badUpdatePath=true;
  181. }
  182. }
  183. else
  184. {
  185. $badUpdatePath=true;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. elseif($_POST['step1'])
  192. {
  193. $_POST['updatePath']='';
  194. $installType='';
  195. $updateFromConfigFile='';
  196. unset($_GET['running']);
  197. }
  198. else
  199. {
  200. $installType=$_GET['installType'];
  201. $updateFromConfigFile=$_GET['updateFromConfigFile'];
  202. }
  203. if($installType=='update' && in_array($my_old_version,$update_from_version_8))
  204. {
  205. include_once('../inc/conf/configuration.php');
  206. }
  207. if(!isset($_GET['running']))
  208. {
  209. $dbHostForm='localhost';
  210. $dbUsernameForm='root';
  211. $dbPassForm='';
  212. $dbPrefixForm='';
  213. $dbNameForm='dokeos_main';
  214. $dbStatsForm='dokeos_stats';
  215. $dbScormForm='dokeos_scorm';
  216. $dbUserForm='dokeos_user';
  217. // extract the path to append to the url if Dokeos is not installed on the web root directory
  218. $urlAppendPath=str_replace('/main/install/index.php','',api_get_self());
  219. $urlForm='http://'.$_SERVER['HTTP_HOST'].$urlAppendPath.'/';
  220. $pathForm=str_replace('\\','/',realpath('../..')).'/';
  221. $emailForm=$_SERVER['SERVER_ADMIN'];
  222. $email_parts = explode('@',$emailForm);
  223. if($email_parts[1] == 'localhost')
  224. {
  225. $emailForm .= '.localdomain';
  226. }
  227. $adminLastName='Doe';
  228. $adminFirstName='John';
  229. $loginForm='admin';
  230. $passForm=api_generate_password();
  231. $campusForm='My campus';
  232. $educationForm='Albert Einstein';
  233. $adminPhoneForm='(000) 001 02 03';
  234. $institutionForm='My Organisation';
  235. $institutionUrlForm='http://www.dokeos.com';
  236. $languageForm='english';
  237. $checkEmailByHashSent=0;
  238. $ShowEmailnotcheckedToStudent=1;
  239. $userMailCanBeEmpty=1;
  240. $allowSelfReg=1;
  241. $allowSelfRegProf=1;
  242. $enableTrackingForm=1;
  243. $singleDbForm=0;
  244. $encryptPassForm=1;
  245. $session_lifetime=360000;
  246. }
  247. else
  248. {
  249. foreach($_POST as $key=>$val)
  250. {
  251. $magic_quotes_gpc=ini_get('magic_quotes_gpc')?true:false;
  252. if(is_string($val))
  253. {
  254. if($magic_quotes_gpc)
  255. {
  256. $val=stripslashes($val);
  257. }
  258. $val=trim($val);
  259. $_POST[$key]=$val;
  260. }
  261. elseif(is_array($val))
  262. {
  263. foreach($val as $key2=>$val2)
  264. {
  265. if($magic_quotes_gpc)
  266. {
  267. $val2=stripslashes($val2);
  268. }
  269. $val2=trim($val2);
  270. $_POST[$key][$key2]=$val2;
  271. }
  272. }
  273. $GLOBALS[$key]=$_POST[$key];
  274. }
  275. }
  276. // The Steps
  277. $total_steps=7;
  278. if (!$_POST)
  279. {
  280. $current_step=1;
  281. }
  282. elseif (!empty($_POST['language_list']) or !empty($_POST['step1']) or ((!empty($_POST['step2_update_8']) or (!empty($_POST['step2_update_6']))) && ($emptyUpdatePath or $badUpdatePath)))
  283. {
  284. $current_step=2;
  285. }
  286. elseif (!empty($_POST['step2']) or (!empty($_POST['step2_update_8']) or (!empty($_POST['step2_update_6'])) ))
  287. {
  288. $current_step=3;
  289. }
  290. elseif (!empty($_POST['step3']))
  291. {
  292. $current_step=4;
  293. }
  294. elseif (!empty($_POST['step4']))
  295. {
  296. $current_step=5;
  297. }
  298. elseif (!empty($_POST['step5']))
  299. {
  300. $current_step=6;
  301. }
  302. ?>
  303. <!DOCTYPE html
  304. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  305. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  306. <html xmlns="http://www.w3.org/1999/xhtml">
  307. <head>
  308. <title>&mdash; <?php echo get_lang('DokeosInstallation').' &mdash; '.get_lang('Version_').' '.$new_version; ?></title>
  309. <style type="text/css" media="screen, projection">
  310. /*<![CDATA[*/
  311. @import "../css/default/default.css";
  312. /*]]>*/
  313. </style>
  314. <?php if(!empty($charset)){ ?>
  315. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
  316. <?php } ?>
  317. </head>
  318. <body dir="<?php echo $text_dir ?>">
  319. <div id="header">
  320. <div id="header1"><?php echo get_lang('DokeosInstallation').' &mdash; '.get_lang('Version_').' '.$new_version; ?><?php if($installType == 'new') echo ' &ndash; '.get_lang('NewInstallation'); else if($installType == 'update') echo ' &ndash; '.get_lang('UpdateFromDokeosVersion').implode('|',$update_from_version); ?></div>
  321. <div id="header2">&nbsp;</div>
  322. <div id="header3">&nbsp;</div>
  323. </div>
  324. <form style="padding: 0px; margin: 0px;" method="post" action="<?php echo api_get_self(); ?>?running=1&amp;installType=<?php echo $installType; ?>&amp;updateFromConfigFile=<?php echo urlencode($updateFromConfigFile); ?>">
  325. <div id="installation_steps">
  326. <img src="../img/bluelogo.gif" hspace="10" vspace="10" alt="Dokeos logo" />
  327. <ol>
  328. <li <?php step_active('1'); ?>><?php echo get_lang('InstallationLanguage'); ?></li>
  329. <li <?php step_active('2'); ?>><?php echo get_lang('Requirements'); ?></li>
  330. <li <?php step_active('3'); ?>><?php echo get_lang('Licence'); ?></li>
  331. <li <?php step_active('4'); ?>><?php echo get_lang('DBSetting'); ?></li>
  332. <li <?php step_active('5'); ?>><?php echo get_lang('CfgSetting'); ?></li>
  333. <li <?php step_active('6'); ?>><?php echo get_lang('PrintOverview'); ?></li>
  334. <li <?php step_active('7'); ?>><?php echo get_lang('Installing'); ?></li>
  335. </ol>
  336. </div>
  337. <table cellpadding="6" cellspacing="0" border="0" width="75%" align="center">
  338. <tr>
  339. <td>
  340. <input type="hidden" name="updatePath" value="<?php if(!$badUpdatePath) echo htmlentities($proposedUpdatePath); ?>" />
  341. <input type="hidden" name="urlAppendPath" value="<?php echo htmlentities($urlAppendPath); ?>" />
  342. <input type="hidden" name="pathForm" value="<?php echo htmlentities($pathForm); ?>" />
  343. <input type="hidden" name="urlForm" value="<?php echo htmlentities($urlForm); ?>" />
  344. <input type="hidden" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" />
  345. <input type="hidden" name="dbUsernameForm" value="<?php echo htmlentities($dbUsernameForm); ?>" />
  346. <input type="hidden" name="dbPassForm" value="<?php echo htmlentities($dbPassForm); ?>" />
  347. <input type="hidden" name="singleDbForm" value="<?php echo htmlentities($singleDbForm); ?>" />
  348. <input type="hidden" name="dbPrefixForm" value="<?php echo htmlentities($dbPrefixForm); ?>" />
  349. <input type="hidden" name="dbNameForm" value="<?php echo htmlentities($dbNameForm); ?>" />
  350. <?php
  351. if($installType == 'update' OR $singleDbForm == 0)
  352. {
  353. ?>
  354. <input type="hidden" name="dbStatsForm" value="<?php echo htmlentities($dbStatsForm); ?>" />
  355. <input type="hidden" name="dbScormForm" value="<?php echo htmlentities($dbScormForm); ?>" />
  356. <input type="hidden" name="dbUserForm" value="<?php echo htmlentities($dbUserForm); ?>" />
  357. <?php
  358. }
  359. else
  360. {
  361. ?>
  362. <input type="hidden" name="dbStatsForm" value="<?php echo htmlentities($dbNameForm); ?>" />
  363. <input type="hidden" name="dbUserForm" value="<?php echo htmlentities($dbNameForm); ?>" />
  364. <?php
  365. }
  366. ?>
  367. <input type="hidden" name="enableTrackingForm" value="<?php echo htmlentities($enableTrackingForm); ?>" />
  368. <input type="hidden" name="allowSelfReg" value="<?php echo htmlentities($allowSelfReg); ?>" />
  369. <input type="hidden" name="allowSelfRegProf" value="<?php echo htmlentities($allowSelfRegProf); ?>" />
  370. <input type="hidden" name="emailForm" value="<?php echo htmlentities($emailForm); ?>" />
  371. <input type="hidden" name="adminLastName" value="<?php echo htmlentities($adminLastName); ?>" />
  372. <input type="hidden" name="adminFirstName" value="<?php echo htmlentities($adminFirstName); ?>" />
  373. <input type="hidden" name="adminPhoneForm" value="<?php echo htmlentities($adminPhoneForm); ?>" />
  374. <input type="hidden" name="loginForm" value="<?php echo htmlentities($loginForm); ?>" />
  375. <input type="hidden" name="passForm" value="<?php echo htmlentities($passForm); ?>" />
  376. <input type="hidden" name="languageForm" value="<?php echo htmlentities($languageForm); ?>" />
  377. <input type="hidden" name="campusForm" value="<?php echo htmlentities($campusForm); ?>" />
  378. <input type="hidden" name="educationForm" value="<?php echo htmlentities($educationForm); ?>" />
  379. <input type="hidden" name="institutionForm" value="<?php echo htmlentities($institutionForm); ?>" />
  380. <input type="hidden" name="institutionUrlForm" value="<?php echo stristr($institutionUrlForm,'http://')?htmlentities($institutionUrlForm):'http://'.htmlentities($institutionUrlForm); ?>" />
  381. <input type="hidden" name="checkEmailByHashSent" value="<?php echo htmlentities($checkEmailByHashSent); ?>" />
  382. <input type="hidden" name="ShowEmailnotcheckedToStudent" value="<?php echo htmlentities($ShowEmailnotcheckedToStudent); ?>" />
  383. <input type="hidden" name="userMailCanBeEmpty" value="<?php echo htmlentities($userMailCanBeEmpty); ?>" />
  384. <input type="hidden" name="encryptPassForm" value="<?php echo htmlentities($encryptPassForm); ?>" />
  385. <input type="hidden" name="session_lifetime" value="<?php echo htmlentities($session_lifetime); ?>" />
  386. <input type="hidden" name="old_version" value="<?php echo htmlentities($my_old_version); ?>" />
  387. <input type="hidden" name="new_version" value="<?php echo htmlentities($new_version); ?>" />
  388. <?php
  389. if($_POST['step2'])
  390. {
  391. //STEP 3 : LICENSE
  392. display_license_agreement();
  393. }
  394. elseif($_POST['step3'])
  395. {
  396. //STEP 4 : MYSQL DATABASE SETTINGS
  397. display_database_settings_form($installType, $dbHostForm, $dbUsernameForm, $dbPassForm, $dbPrefixForm, $enableTrackingForm, $singleDbForm, $dbNameForm, $dbStatsForm, $dbScormForm, $dbUserForm);
  398. }
  399. elseif($_POST['step4'])
  400. {
  401. //STEP 5 : CONFIGURATION SETTINGS
  402. //if update, try getting settings from the database...
  403. if($installType == 'update')
  404. {
  405. $db_name = $dbNameForm;
  406. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'platformLanguage');
  407. if(!empty($tmp)) $languageForm = $tmp;
  408. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'emailAdministrator');
  409. if(!empty($tmp)) $emailForm = $tmp;
  410. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'administratorName');
  411. if(!empty($tmp)) $adminFirstName = $tmp;
  412. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'administratorSurname');
  413. if(!empty($tmp)) $adminLastName = $tmp;
  414. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'administratorTelephone');
  415. if(!empty($tmp)) $adminPhoneForm = $tmp;
  416. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'siteName');
  417. if(!empty($tmp)) $campusForm = $tmp;
  418. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'Institution');
  419. if(!empty($tmp)) $institutionForm = $tmp;
  420. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'InstitutionUrl');
  421. if(!empty($tmp)) $institutionUrlForm = $tmp;
  422. if(in_array($my_old_version,$update_from_version_6))
  423. { //for version 1.6
  424. $urlForm = get_config_param('rootWeb');
  425. $encryptPassForm = get_config_param('userPasswordCrypted');
  426. $allowSelfReg = get_config_param('allowSelfReg');
  427. $allowSelfRegProf = get_config_param('allowSelfRegProf');
  428. }
  429. else
  430. { //for version 1.8
  431. $urlForm = $_configuration['root_web'];
  432. $encryptPassForm = get_config_param('userPasswordCrypted');
  433. $allowSelfReg = false;
  434. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'allow_registration');
  435. if(!empty($tmp)) $allowSelfReg = $tmp;
  436. $allowSelfRegProf = false;
  437. $tmp = get_config_param_from_db($dbHostForm,$dbUsernameForm,$dbPassForm,$db_name,'allow_registration_as_teacher');
  438. if(!empty($tmp)) $allowSelfRegProf = $tmp;
  439. }
  440. }
  441. display_configuration_settings_form($installType, $urlForm, $languageForm, $emailForm, $adminFirstName, $adminLastName, $adminPhoneForm, $campusForm, $institutionForm, $institutionUrlForm, $encryptPassForm, $allowSelfReg, $allowSelfRegProf, $loginForm, $passForm);
  442. }
  443. elseif($_POST['step5'])
  444. {
  445. //STEP 6 : LAST CHECK BEFORE INSTALL
  446. ?>
  447. <h2><?php echo display_step_sequence().get_lang('LastCheck'); ?></h2>
  448. <?php echo get_lang('HereAreTheValuesYouEntered');?>
  449. <br />
  450. <b><?php echo get_lang('PrintThisPageToRememberPassAndOthers');?></b>
  451. <blockquote>
  452. <?php echo get_lang('MainLang').' : '.$languageForm; ?><br /><br />
  453. <?php echo get_lang('DBHost').' : '.$dbHostForm; ?><br />
  454. <?php echo get_lang('DBLogin').' : '.$dbUsernameForm; ?><br />
  455. <?php echo get_lang('DBPassword').' : '.$dbPassForm; ?><br />
  456. <?php if(!empty($dbPrefixForm)) echo get_lang('DbPrefixForm').' : '.$dbPrefixForm.'<br />'; ?>
  457. <?php echo get_lang('MainDB').' : <b>'.$dbNameForm; ?></b><?php if($installType == 'new') echo ' (<font color="#cc0033">'.get_lang('ReadWarningBelow').'</font>)'; ?><br />
  458. <?php
  459. if(!$singleDbForm)
  460. {
  461. echo get_lang('StatDB').' : <b>'.$dbStatsForm.'</b>';
  462. if($installType == 'new')
  463. {
  464. echo ' (<font color="#cc0033">'.get_lang('ReadWarningBelow').'</font>)';
  465. }
  466. echo '<br />';
  467. echo get_lang('ScormDB').' : <b>'.$dbScormForm.'</b>';
  468. if($installType == 'new')
  469. {
  470. echo ' (<font color="#cc0033">'.get_lang('ReadWarningBelow').'</font>)';
  471. }
  472. echo '<br />';
  473. echo get_lang('UserDB').' : <b>'.$dbUserForm.'</b>';
  474. if($installType == 'new')
  475. {
  476. echo ' (<font color="#cc0033">'.get_lang('ReadWarningBelow').'</font>)';
  477. }
  478. echo '<br />';
  479. }
  480. ?>
  481. <?php echo get_lang('EnableTracking').' : '.($enableTrackingForm?$langYes:$langNo); ?><br />
  482. <?php echo get_lang('SingleDb').' : '.($singleDbForm?$langOne:$langSeveral); ?><br /><br />
  483. <?php echo get_lang('AllowSelfReg').' : '.($allowSelfReg?$langYes:$langNo); ?><br />
  484. <?php echo get_lang('EncryptUserPass').' : '.($encryptPassForm?$langYes:$langNo); ?><br /><br/>
  485. <?php echo get_lang('AdminEmail').' : '.$emailForm; ?><br />
  486. <?php echo get_lang('AdminLastName').' : '.$adminLastName; ?><br />
  487. <?php echo get_lang('AdminFirstName').' : '.$adminFirstName; ?><br />
  488. <?php echo get_lang('AdminPhone').' : '.$adminPhoneForm; ?><br />
  489. <?php if($installType == 'new'): ?>
  490. <?php echo get_lang('AdminLogin').' : <b>'.$loginForm; ?></b><br />
  491. <?php echo get_lang('AdminPass').' : <b>'.$passForm; ?></b><br /><br />
  492. <?php else: ?>
  493. <br />
  494. <?php endif; ?>
  495. <?php echo get_lang('CampusName').' : '.$campusForm; ?><br />
  496. <?php echo get_lang('InstituteShortName').' : '.$institutionForm; ?><br />
  497. <?php echo get_lang('InstituteURL').' : '.$institutionUrlForm; ?><br />
  498. <?php echo get_lang('DokeosURL').' : '.$urlForm; ?><br />
  499. </blockquote>
  500. <?php if($installType == 'new'): ?>
  501. <div style="background-color:#FFFFFF">
  502. <p align="center"><b><font color="red">
  503. <?php echo get_lang('Warning');?> !<br />
  504. <?php echo get_lang('TheInstallScriptWillEraseAllTables');?>
  505. </font></b></p>
  506. </div>
  507. <?php endif; ?>
  508. <table width="100%">
  509. <tr>
  510. <td><input type="submit" name="step4" value="&lt; <?php echo get_lang('Previous'); ?>" /></td>
  511. <td align="right"><input type="submit" name="step6" value="<?php echo get_lang('InstallDokeos'); ?> &gt;" onclick="javascript:if(this.value == '<?php echo get_lang('PleaseWait');?>...') return false; else this.value='<?php echo get_lang('PleaseWait');?>...';" /></td>
  512. </tr>
  513. </table>
  514. <?php
  515. }
  516. elseif($_POST['step6'])
  517. {
  518. //STEP 6 : INSTALLATION PROCESS
  519. if($installType == 'update')
  520. {
  521. if(empty($my_old_version)){$my_old_version='1.8.3';} //we guess
  522. $_configuration['main_database'] = $dbNameForm;
  523. //$urlAppendPath = get_config_param('urlAppend');
  524. switch($my_old_version)
  525. {
  526. case '1.6':
  527. case '1.6.0':
  528. case '1.6.1':
  529. case '1.6.2':
  530. case '1.6.3':
  531. case '1.6.4':
  532. case '1.6.5':
  533. include('update-db-1.6.x-1.8.0.inc.php');
  534. include('update-files-1.6.x-1.8.0.inc.php');
  535. //intentionally no break to continue processing
  536. case '1.8':
  537. case '1.8.0':
  538. include('update-db-1.8.0-1.8.2.inc.php');
  539. //intentionally no break to continue processing
  540. case '1.8.2':
  541. include('update-db-1.8.2-1.8.3.inc.php');
  542. //intentionally no break to continue processing
  543. case '1.8.3':
  544. include('update-db-1.8.3-1.8.4.inc.php');
  545. include('update-files-1.8.3-1.8.4.inc.php');
  546. case '1.8.4':
  547. default:
  548. include('update-db-1.8.4-1.8.5.inc.php');
  549. include('update-files-1.8.4-1.8.5.inc.php');
  550. break;
  551. }
  552. }
  553. else
  554. {
  555. include('install_db.inc.php');
  556. include('install_files.inc.php');
  557. }
  558. display_after_install_message($installType, $nbr_courses);
  559. }
  560. elseif($_POST['step1'] || $badUpdatePath)
  561. {
  562. //STEP 1 : REQUIREMENTS
  563. //make sure that proposed path is set, shouldn't be necessary but...
  564. if(empty($proposedUpdatePath)){$proposedUpdatePath = $_POST['updatePath'];}
  565. display_requirements($installType, $badUpdatePath, $proposedUpdatePath, $update_from_version_8, $update_from_version_6);
  566. }
  567. else
  568. {
  569. //start screen
  570. display_language_selection();
  571. }
  572. ?>
  573. </td>
  574. </tr>
  575. </table>
  576. </form>
  577. <br style="clear:both;" />
  578. <div id="footer">
  579. <div class="copyright"><?php echo get_lang('Platform');?> <a href="http://www.dokeos.com"> Dokeos <?php echo $new_version ?></a> &copy; <?php echo date('Y'); ?> </div>
  580. &nbsp;
  581. </div>
  582. </body>
  583. </html>