dokeos-install
[ class tree: dokeos-install ] [ index: dokeos-install ] [ all elements ]

Source for file index.php

Documentation is available at index.php

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

Documentation generated on Thu, 12 Jun 2008 13:50:52 -0500 by phpDocumentor 1.4.1