]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - install.php
Removed the empty config.php file from the repo; your instance will create this for...
[Github/sugarcrm.git] / install.php
1 <?php
2  if(!defined('sugarEntry'))define('sugarEntry', true);
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38 //session_destroy();
39 if (version_compare(phpversion(),'5.2.0') < 0) {
40         $msg = 'Minimum PHP version required is 5.2.0.  You are using PHP version  '. phpversion();
41     die($msg);
42 }
43 $session_id = session_id();
44 if(empty($session_id)){
45         @session_start();
46 }
47 $GLOBALS['installing'] = true;
48 define('SUGARCRM_IS_INSTALLING', $GLOBALS['installing']);
49 $GLOBALS['sql_queries'] = 0;
50 require_once('include/SugarLogger/LoggerManager.php');
51 require_once('sugar_version.php');
52 require_once('include/utils.php');
53 require_once('install/install_utils.php');
54 require_once('install/install_defaults.php');
55 require_once('include/TimeDate.php');
56 require_once('include/Localization/Localization.php');
57 require_once('include/SugarTheme/SugarTheme.php');
58 require_once('include/utils/LogicHook.php');
59 require_once('data/SugarBean.php');
60 require_once('include/entryPoint.php');
61 //check to see if the script files need to be rebuilt, add needed variables to request array
62     $_REQUEST['root_directory'] = getcwd();
63     $_REQUEST['js_rebuild_concat'] = 'rebuild';
64     require_once('jssource/minify.php');
65
66 $timedate = TimeDate::getInstance();
67 // cn: set php.ini settings at entry points
68 setPhpIniSettings();
69 $locale = new Localization();
70
71 if(get_magic_quotes_gpc() == 1) {
72    $_REQUEST = array_map("stripslashes_checkstrings", $_REQUEST);
73    $_POST = array_map("stripslashes_checkstrings", $_POST);
74    $_GET = array_map("stripslashes_checkstrings", $_GET);
75 }
76
77
78 $GLOBALS['log'] = LoggerManager::getLogger('SugarCRM');
79 $setup_sugar_version = $sugar_version;
80 $install_script = true;
81
82 ///////////////////////////////////////////////////////////////////////////////
83 //// INSTALL RESOURCE SETUP
84 $css = 'install/install.css';
85 $icon = 'include/images/sugar_icon.ico';
86 $sugar_md = 'include/images/sugar_md_open.png';
87 $loginImage = 'include/images/sugarcrm_login.png';
88 $common = 'install/installCommon.js';
89
90 ///////////////////////////////////////////////////////////////////////////////
91 ////    INSTALLER LANGUAGE
92
93
94
95 function getSupportedInstallLanguages(){
96         $supportedLanguages = array(
97         'en_us' => 'English (US)',
98         );
99         if(file_exists('install/lang.config.php')){
100                 include('install/lang.config.php');
101                 if(!empty($config['languages'])){
102                         
103                         foreach($config['languages'] as $k=>$v){
104                                 if(file_exists('install/language/' . $k . '.lang.php')){
105                                         $supportedLanguages[$k] = $v;   
106                                 }       
107                         }       
108                 }
109         }
110         return $supportedLanguages;
111 }
112 $supportedLanguages = getSupportedInstallLanguages();
113
114
115
116
117
118
119
120 // after install language is selected, use that pack
121 $default_lang = 'en_us';
122 if(!isset($_POST['language']) && (!isset($_SESSION['language']) && empty($_SESSION['language']))) {
123         if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
124                 $lang = parseAcceptLanguage();
125                 if(isset($supportedLanguages[$lang])) {
126                         $_POST['language'] = $lang;
127                 } else {
128                         $_POST['language'] = $default_lang;
129             }
130         }
131 }
132
133 if(isset($_POST['language'])) {
134         $_SESSION['language'] = str_replace('-','_',$_POST['language']);
135 }
136
137 $current_language = isset($_SESSION['language']) ? $_SESSION['language'] : $default_lang;
138
139 if(file_exists("install/language/{$current_language}.lang.php")) {
140         require_once("install/language/{$current_language}.lang.php");
141 } else {
142         require_once("install/language/{$default_lang}.lang.php");
143 }
144
145 if($current_language != 'en_us') {
146         $my_mod_strings = $mod_strings;
147         include('install/language/en_us.lang.php');
148         $mod_strings = sugarArrayMerge($mod_strings, $my_mod_strings);
149 }
150 ////    END INSTALLER LANGUAGE
151 ///////////////////////////////////////////////////////////////////////////////
152
153 //get the url for the helper link
154 $help_url = get_help_button_url();
155
156
157
158 //if this license print, then redirect and exit,
159 if(isset($_REQUEST['page']) && $_REQUEST['page'] == 'licensePrint')
160 {
161     include('install/licensePrint.php');
162     exit ();
163 }
164
165 //check to see if mysqli is enabled
166 if(function_exists('mysqli_connect')){
167     $_SESSION['mysql_type'] = 'mysqli';
168 }
169
170 //if this is a system check, then just run the check and return,
171 //this is an ajax call and there is no need for further processing
172 if(isset($_REQUEST['checkInstallSystem']) && ($_REQUEST['checkInstallSystem'])){
173     require_once('install/installSystemCheck.php');
174     echo runCheck($install_script, $mod_strings);
175     return;
176 }
177
178 //if this is a DB Settings check, then just run the check and return,
179 //this is an ajax call and there is no need for further processing
180 if(isset($_REQUEST['checkDBSettings']) && ($_REQUEST['checkDBSettings'])){
181     require_once('install/checkDBSettings.php');
182     echo checkDBSettings();
183     return;
184 }
185
186 //maintaining the install_type if earlier set to custom
187 if(isset($_REQUEST['install_type']) && $_REQUEST['install_type'] == 'custom'){
188         $_SESSION['install_type'] = $_REQUEST['install_type'];
189 }
190
191 //set the default settings into session
192 foreach($installer_defaults as $key =>$val){
193     if(!isset($_SESSION[$key])){
194         $_SESSION[$key] = $val;
195     }
196 }
197
198 // always perform
199 clean_special_arguments();
200 print_debug_comment();
201 $next_clicked = false;
202 $next_step = 0;
203
204 // use a simple array to map out the steps of the installer page flow
205 $workflow = array(  'welcome.php',
206                     'ready.php',
207                     'license.php',
208                     'installType.php',
209 );
210 $workflow[] =  'systemOptions.php';
211 $workflow[] = 'dbConfig_a.php';
212 //$workflow[] = 'dbConfig_b.php';
213
214 //define web root, which will be used as default for site_url
215 if($_SERVER['SERVER_PORT']=='80'){
216     $web_root = $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
217 }else{
218     $web_root = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['PHP_SELF'];
219 }
220 $web_root = str_replace("/install.php", "", $web_root);
221 $web_root = "http://$web_root";
222
223  if(!isset($_SESSION['oc_install']) ||  $_SESSION['oc_install'] == false) {
224     $workflow[] = 'siteConfig_a.php';
225     if(isset($_SESSION['install_type'])  && !empty($_SESSION['install_type'])  && $_SESSION['install_type']=='custom'){
226         $workflow[] = 'siteConfig_b.php';
227     }
228  } else {
229     if(is_readable('config.php')) {
230         require_once('config.php');
231     }
232  }
233
234    // set the form's php var to the loaded config's var else default to sane settings
235     if(!isset($_SESSION['setup_site_url'])  || empty($_SESSION['setup_site_url'])){
236         if(isset($sugar_config['site_url']) && !empty($sugar_config['site_url'])){
237             $_SESSION['setup_site_url']= $sugar_config['site_url'];
238         }else{
239          $_SESSION['setup_site_url']= $web_root;
240         }
241     }
242     if(!isset($_SESSION['setup_system_name']) || empty($_SESSION['setup_system_name'])){$_SESSION['setup_system_name'] = 'SugarCRM';}
243     if(!isset($_SESSION['setup_site_session_path']) || empty($_SESSION['setup_site_session_path'])){$_SESSION['setup_site_session_path']                = (isset($sugar_config['session_dir']))   ? $sugar_config['session_dir']  :  '';}
244     if(!isset($_SESSION['setup_site_log_dir']) || empty($_SESSION['setup_site_log_dir'])){$_SESSION['setup_site_log_dir']                     = (isset($sugar_config['log_dir']))       ? $sugar_config['log_dir']      : '.';}
245     if(!isset($_SESSION['setup_site_guid']) || empty($_SESSION['setup_site_guid'])){$_SESSION['setup_site_guid']                        = (isset($sugar_config['unique_key']))    ? $sugar_config['unique_key']   :  '';}
246
247
248
249   $workflow[] = 'confirmSettings.php';
250   $workflow[] = 'performSetup.php';
251
252   if(!isset($_SESSION['oc_install']) ||  $_SESSION['oc_install'] == false){
253     if(isset($_SESSION['install_type'])  && !empty($_SESSION['install_type'])  && $_SESSION['install_type']=='custom'){
254         //$workflow[] = 'download_patches.php';
255         $workflow[] = 'download_modules.php';
256     }
257   }
258
259     $workflow[] = 'register.php';
260
261
262 // increment/decrement the workflow pointer
263 if(!empty($_REQUEST['goto'])) {
264     switch($_REQUEST['goto']) {
265         case $mod_strings['LBL_CHECKSYS_RECHECK']:
266             $next_step = $_REQUEST['current_step'];
267             break;
268         case $mod_strings['LBL_BACK']:
269             $next_step = $_REQUEST['current_step'] - 1;
270             break;
271         case $mod_strings['LBL_NEXT']:
272         case $mod_strings['LBL_START']:
273             $next_step = $_REQUEST['current_step'] + 1;
274             $next_clicked = true;
275             break;
276         case 'SilentInstall':
277             $next_step = 9999;
278             break;
279                 case 'oc_convert':
280             $next_step = 9191;
281             break;
282     }
283 }
284 // Add check here to see if a silent install config file exists; if so then launch silent installer
285 elseif ( is_file('config_si.php') && empty($sugar_config['installer_locked'])) {
286     echo <<<EOHTML
287 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
288 <html>
289 <head>
290    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
291    <meta http-equiv="Content-Style-Type" content="text/css">
292    <meta http-equiv="Refresh" content="1; url=install.php?goto=SilentInstall&cli=true">
293    <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_TITLE_WELCOME']} {$setup_sugar_version} {$mod_strings['LBL_WELCOME_SETUP_WIZARD']}</title>
294    <link REL="SHORTCUT ICON" HREF="{$icon}">
295    <link rel="stylesheet" href="{$css}" type="text/css">
296 </head>
297 <body>
298     <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
299     <tr>
300         <td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
301     <tr>
302       <th width="500">
303                 <p>
304                 <img src="{$sugar_md}" alt="SugarCRM" border="0">
305                 </p>
306                 {$mod_strings['LBL_TITLE_WELCOME']} {$setup_sugar_version} {$mod_strings['LBL_WELCOME_SETUP_WIZARD']}</th>
307
308       <th width="200" height="30" style="text-align: right;"><a href="http://www.sugarcrm.com" target="_blank"><IMG src="{$loginImage}" width="145" height="30" alt="SugarCRM" border="0"></a>
309       </th>
310     </tr>
311     <tr>
312       <td colspan="2"  id="ready_image"><IMG src="include/images/install_themes.jpg" width="698" height="247" alt="Sugar Themes" border="0"></td>
313     </tr>
314
315     <tr>
316       <td colspan="2" id="ready">{$mod_strings['LBL_LAUNCHING_SILENT_INSTALL']} </td>
317     </tr>
318     </table>
319 </body>
320 </html>
321 EOHTML;
322     die();
323 }
324
325
326
327 $exclude_files = array('register.php','download_modules.php');
328 if(isset($next_step) && isset($workflow[$next_step]) && !in_array($workflow[$next_step],$exclude_files) && isset($sugar_config['installer_locked']) && $sugar_config['installer_locked'] == true) {
329     $the_file = 'installDisabled.php';
330         $disabled_title = $mod_strings['LBL_DISABLED_DESCRIPTION'];
331         $disabled_title_2 = $mod_strings['LBL_DISABLED_TITLE_2'];
332         $disabled_text =<<<EOQ
333                 <p>{$mod_strings['LBL_DISABLED_DESCRIPTION']}</p>
334                 <pre>
335                         'installer_locked' => false,
336                 </pre>
337                 <p>{$mod_strings['LBL_DISABLED_DESCRIPTION_2']}</p>
338
339                 <p>{$mod_strings['LBL_DISABLED_HELP_1']} <a href="{$mod_strings['LBL_DISABLED_HELP_LNK']}" target="_blank">{$mod_strings['LBL_DISABLED_HELP_2']}</a>.</p>
340 EOQ;
341 }
342 else{
343 $validation_errors = array();
344 // process the data posted
345 if($next_clicked) {
346         // store the submitted data because the 'Next' button was clicked
347     switch($workflow[trim($_REQUEST['current_step'])]) {
348         case 'welcome.php':
349                 $_SESSION['language'] = $_REQUEST['language'];
350                         $_SESSION['setup_site_admin_user_name'] = 'admin';
351         break;
352       case 'license.php':
353                 $_SESSION['setup_license_accept']   = get_boolean_from_request('setup_license_accept');
354                 $_SESSION['license_submitted']      = true;
355
356
357            // eventually default all vars here, with overrides from config.php
358             if(is_readable('config.php')) {
359                 global $sugar_config;
360                 include_once('config.php');
361             }
362
363             $default_db_type = 'mysql';
364
365             if(!isset($_SESSION['setup_db_type'])) {
366                 $_SESSION['setup_db_type'] = empty($sugar_config['dbconfig']['db_type']) ? $default_db_type : $sugar_config['dbconfig']['db_type'];
367             }
368
369             break;
370         case 'installType.php':
371             $_SESSION['install_type']   = $_REQUEST['install_type'];
372             if(isset($_REQUEST['setup_license_key']) && !empty($_REQUEST['setup_license_key'])){
373                 $_SESSION['setup_license_key']  = $_REQUEST['setup_license_key'];
374             }
375             $_SESSION['licenseKey_submitted']      = true;
376
377
378
379             break;
380
381         case 'systemOptions.php':
382             $_SESSION['setup_db_type'] = $_REQUEST['setup_db_type'];
383             $validation_errors = validate_systemOptions();
384             if(count($validation_errors) > 0) {
385                 $next_step--;
386             }
387             break;
388
389         case 'dbConfig_a.php':
390             //validation is now done through ajax call to checkDBSettings.php
391             if(isset($_REQUEST['setup_db_drop_tables'])){
392                 $_SESSION['setup_db_drop_tables'] = $_REQUEST['setup_db_drop_tables'];
393                 if($_SESSION['setup_db_drop_tables']=== true || $_SESSION['setup_db_drop_tables'] == 'true'){
394                     $_SESSION['setup_db_create_database'] = false;
395                 }
396             }
397             break;
398
399         case 'siteConfig_a.php':
400             if(isset($_REQUEST['setup_site_url'])){$_SESSION['setup_site_url']          = $_REQUEST['setup_site_url'];}
401             if(isset($_REQUEST['setup_system_name'])){$_SESSION['setup_system_name']    = $_REQUEST['setup_system_name'];}
402             $_SESSION['setup_site_admin_user_name']             = $_REQUEST['setup_site_admin_user_name'];
403             $_SESSION['setup_site_admin_password']              = $_REQUEST['setup_site_admin_password'];
404             $_SESSION['setup_site_admin_password_retype']       = $_REQUEST['setup_site_admin_password_retype'];
405             $_SESSION['siteConfig_submitted']               = true;
406
407             $validation_errors = array();
408             $validation_errors = validate_siteConfig('a');
409             if(count($validation_errors) > 0) {
410                 $next_step--;
411             }
412             break;
413         case 'siteConfig_b.php':
414             $_SESSION['setup_site_sugarbeet_automatic_checks'] = get_boolean_from_request('setup_site_sugarbeet_automatic_checks');
415
416             $_SESSION['setup_site_custom_session_path']     = get_boolean_from_request('setup_site_custom_session_path');
417             if($_SESSION['setup_site_custom_session_path']){
418                 $_SESSION['setup_site_session_path']            = $_REQUEST['setup_site_session_path'];
419             }else{
420                 $_SESSION['setup_site_session_path'] = '';
421             }
422
423             $_SESSION['setup_site_custom_log_dir']          = get_boolean_from_request('setup_site_custom_log_dir');
424             if($_SESSION['setup_site_custom_log_dir']){
425                 $_SESSION['setup_site_log_dir']                 = $_REQUEST['setup_site_log_dir'];
426             }else{
427                 $_SESSION['setup_site_log_dir'] = '.';
428             }
429
430             $_SESSION['setup_site_specify_guid']            = get_boolean_from_request('setup_site_specify_guid');
431             if($_SESSION['setup_site_specify_guid']){
432                 $_SESSION['setup_site_guid']                    = $_REQUEST['setup_site_guid'];
433             }else{
434                 $_SESSION['setup_site_guid'] = '';
435             }
436             $_SESSION['siteConfig_submitted']               = true;
437             if(isset($_REQUEST['setup_site_sugarbeet_anonymous_stats'])){
438                 $_SESSION['setup_site_sugarbeet_anonymous_stats'] = get_boolean_from_request('setup_site_sugarbeet_anonymous_stats');
439             }else{
440                 $_SESSION['setup_site_sugarbeet_anonymous_stats'] = 0;
441             }
442
443             $validation_errors = array();
444             $validation_errors = validate_siteConfig('b');
445             if(count($validation_errors) > 0) {
446                 $next_step--;
447             }
448             break;
449 }
450     }
451
452 if($next_step == 9999) {
453     $the_file = 'SilentInstall';
454 }else if($next_step == 9191) {
455         $_SESSION['oc_server_url']      = $_REQUEST['oc_server_url'];
456     $_SESSION['oc_username']    = $_REQUEST['oc_username'];
457     $_SESSION['oc_password']    = $_REQUEST['oc_password'];
458     $the_file = 'oc_convert.php';
459 }
460 else{
461         $the_file = $workflow[$next_step];
462
463 }
464
465 switch($the_file) {
466     case 'welcome.php':
467     case 'license.php':
468                         //
469                         // Check to see if session variables are working properly
470                         //
471                         $_SESSION['test_session'] = 'sessions are available';
472         @session_write_close();
473                         unset($_SESSION['test_session']);
474         @session_start();
475
476                         if(!isset($_SESSION['test_session']))
477                         {
478                 $the_file = 'installDisabled.php';
479                                 // PHP.ini location -
480                                 $phpIniLocation = get_cfg_var("cfg_file_path");
481                                 $disabled_title = $mod_strings['LBL_SESSION_ERR_TITLE'];
482                                 $disabled_title_2 = $mod_strings['LBL_SESSION_ERR_TITLE'];
483                                 $disabled_text = $mod_strings['LBL_SESSION_ERR_DESCRIPTION']."<pre>{$phpIniLocation}</pre>";
484             break;
485                         }
486         // check to see if installer has been disabled
487         if(is_readable('config.php') && (filesize('config.php') > 0)) {
488             include_once('config.php');
489
490             if(!isset($sugar_config['installer_locked']) || $sugar_config['installer_locked'] == true) {
491                 $the_file = 'installDisabled.php';
492                                 $disabled_title = $mod_strings['LBL_DISABLED_DESCRIPTION'];
493                                 $disabled_title_2 = $mod_strings['LBL_DISABLED_TITLE_2'];
494                                 $disabled_text =<<<EOQ
495                                         <p>{$mod_strings['LBL_DISABLED_DESCRIPTION']}</p>
496                                         <pre>
497                                                 'installer_locked' => false,
498                                         </pre>
499                                         <p>{$mod_strings['LBL_DISABLED_DESCRIPTION_2']}</p>
500
501                                         <p>{$mod_strings['LBL_DISABLED_HELP_1']} <a href="{$mod_strings['LBL_DISABLED_HELP_LNK']}" target="_blank">{$mod_strings['LBL_DISABLED_HELP_2']}</a>.</p>
502 EOQ;
503                              //if this is an offline client installation but the conversion did not succeed,
504                             //then try to convert again
505                                         if(isset($sugar_config['disc_client']) && $sugar_config['disc_client'] == true && isset($sugar_config['oc_converted']) && $sugar_config['oc_converted'] == false) {
506                                   header('Location: index.php?entryPoint=oc_convert&first_time=true');
507                                                 exit ();
508                             }
509             }
510         }
511         break;
512     case 'register.php':
513         session_unset();
514         break;
515     case 'SilentInstall':
516         $si_errors = false;
517         pullSilentInstallVarsIntoSession();
518         $validation_errors = validate_dbConfig('a');
519         if(count($validation_errors) > 0) {
520             $the_file = 'dbConfig_a.php';
521             $si_errors = true;
522         }
523         $validation_errors = validate_siteConfig('a');
524         if(count($validation_errors) > 0) {
525             $the_file = 'siteConfig_a.php';
526             $si_errors = true;
527         }
528         $validation_errors = validate_siteConfig('b');
529         if(count($validation_errors) > 0) {
530             $the_file = 'siteConfig_b.php';
531             $si_errors = true;
532         }
533
534         if(!$si_errors){
535             $the_file = 'performSetup.php';
536         }
537         //since this is a SilentInstall we still need to make sure that
538         //the appropriate files are writable
539         // config.php
540         make_writable('./config.php');
541
542         // custom dir
543         make_writable('./custom');
544
545         // modules dir
546         recursive_make_writable('./modules');
547
548         // data dir
549         make_writable('./data');
550         make_writable('./data/upload');
551
552         // cache dir
553         make_writable('./cache/custom_fields');
554         make_writable('./cache/dyn_lay');
555         make_writable('./cache/images');
556         make_writable('./cache/import');
557         make_writable('./cache/layout');
558         make_writable('./cache/pdf');
559         make_writable('./cache/upload');
560         make_writable('./cache/xml');
561
562         // check whether we're getting this request from a command line tool
563         // we want to output brief messages if we're outputting to a command line tool
564         $cli_mode = false;
565         if(isset($_REQUEST['cli']) && ($_REQUEST['cli'] == 'true')) {
566             $_SESSION['cli'] = true;
567             // if we have errors, just shoot them back now
568             if(count($validation_errors) > 0) {
569                 foreach($validation_errors as $error) {
570                     print($mod_strings['ERR_ERROR_GENERAL']."\n");
571                     print("    " . $error . "\n");
572                     print("Exit 1\n");
573                     exit(1);
574                 }
575             }
576         }
577         break;
578         }
579 }
580
581
582 $the_file = clean_string($the_file, 'FILE');
583 // change to require to get a good file load error message if the file is not available.
584 require('install/' . $the_file);
585
586 ?>