iTx Technologies offre gratuitement
cet espace pour SugarCRM !

title

Body

[fermer]

/ -> install.php (source)

   1  <?php
   2   if(!defined('sugarEntry'))define('sugarEntry', true);
   3  /*********************************************************************************
   4   * SugarCRM is a customer relationship management program developed by
   5   * SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
   6   * 
   7   * This program is free software; you can redistribute it and/or modify it under
   8   * the terms of the GNU 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 General Public License for more
  17   * details.
  18   * 
  19   * You should have received a copy of the GNU 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 General Public License version 3.
  30   * 
  31   * In accordance with Section 7(b) of the GNU 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  //session_destroy();
  38  if (version_compare(phpversion(),'5.1.0') < 0) {
  39      $msg = 'Minimum PHP version required is 5.1.0.  You are using PHP version  '. phpversion();
  40      die($msg);
  41  }
  42  $session_id = session_id();
  43  if(empty($session_id)){
  44      session_start();
  45  }
  46  $GLOBALS['installing'] = true;
  47  define('SUGARCRM_IS_INSTALLING', $GLOBALS['installing']);
  48  $GLOBALS['sql_queries'] = 0;
  49  require_once ('include/SugarLogger/LoggerManager.php');
  50  require_once ('sugar_version.php');
  51  require_once ('include/utils.php');
  52  require_once ('install/install_utils.php');
  53  require_once ('install/install_defaults.php');
  54  require_once ('include/TimeDate.php');
  55  require_once ('include/Localization/Localization.php');
  56  require_once ('include/SugarTheme/SugarTheme.php');
  57  require_once ('include/utils/LogicHook.php');
  58  require_once ('data/SugarBean.php');
  59  require_once ('include/entryPoint.php');
  60  //check to see if the script files need to be rebuilt, add needed variables to request array
  61      $_REQUEST['root_directory'] = getcwd();
  62      $_REQUEST['js_rebuild_concat'] = 'rebuild';
  63      require_once ('jssource/minify.php');
  64  
  65  $timedate = new TimeDate();
  66  // cn: set php.ini settings at entry points
  67  setPhpIniSettings();
  68  $locale = new Localization();
  69  
  70  if(get_magic_quotes_gpc() == 1) {
  71     $_REQUEST = array_map("stripslashes_checkstrings", $_REQUEST);
  72     $_POST = array_map("stripslashes_checkstrings", $_POST);
  73     $_GET = array_map("stripslashes_checkstrings", $_GET);
  74  }
  75  
  76  
  77  $GLOBALS['log'] = LoggerManager::getLogger('SugarCRM');
  78  $setup_sugar_version = $sugar_version;
  79  $install_script = true;
  80  
  81  ///////////////////////////////////////////////////////////////////////////////
  82  ////    INSTALLER LANGUAGE
  83  
  84  $supportedLanguages = array(
  85      'en_us'    => 'English (US)',
  86      'ja'    => 'Japanese - 日本語',
  87      'fr_fr'    => 'French - Français',
  88      'zh_cn' => 'Chinese - 简体中文',
  89  //    'ge_ge'    => 'German - Deutch',
  90  //    'pt_br'    => 'Portuguese (Brazil)',
  91  //    'es_es'    => 'Spanish (Spain) - Español',
  92  );
  93  
  94  // after install language is selected, use that pack
  95  $default_lang = 'en_us';
  96  if(!isset($_POST['language']) && (!isset($_SESSION['language']) && empty($_SESSION['language']))) {
  97      if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
  98          $lang = parseAcceptLanguage();
  99          if(isset($supportedLanguages[$lang])) {
 100              $_POST['language'] = $lang;
 101          } else {
 102              $_POST['language'] = $default_lang;
 103          }
 104      }
 105  }
 106  
 107  if(isset($_POST['language'])) {
 108      $_SESSION['language'] = strtolower(str_replace('-','_',$_POST['language']));
 109  }
 110  
 111  $current_language = isset($_SESSION['language']) ? $_SESSION['language'] : $default_lang;
 112  
 113  if(file_exists("install/language/{$current_language}.lang.php")) {
 114      require_once("install/language/{$current_language}.lang.php");
 115  } else {
 116      require_once("install/language/{$default_lang}.lang.php");
 117  }
 118  
 119  if($current_language != 'en_us') {
 120      $my_mod_strings = $mod_strings;
 121      include ('install/language/en_us.lang.php');
 122      $mod_strings = sugarArrayMerge($mod_strings, $my_mod_strings);
 123  }
 124  ////    END INSTALLER LANGUAGE
 125  ///////////////////////////////////////////////////////////////////////////////
 126  
 127  //get the url for the helper link
 128  $help_url = get_help_button_url();
 129  
 130  
 131  
 132  //if this license print, then redirect and exit,
 133  if(isset($_REQUEST['page']) && $_REQUEST['page'] == 'licensePrint')
 134  {
 135      include ('install/licensePrint.php');
 136      exit ();
 137  }
 138  
 139  //check to see if mysqli is enabled
 140  if(function_exists('mysqli_connect')){
 141      $_SESSION['mysql_type'] = 'mysqli';
 142  }
 143  
 144  //if this is a system check, then just run the check and return,
 145  //this is an ajax call and there is no need for further processing
 146  if(isset($_REQUEST['checkInstallSystem']) && ($_REQUEST['checkInstallSystem'])){
 147      require_once ('install/installSystemCheck.php');
 148      echo runCheck($install_script, $mod_strings);
 149      return;
 150  }
 151  
 152  //if this is a DB Settings check, then just run the check and return,
 153  //this is an ajax call and there is no need for further processing
 154  if(isset($_REQUEST['checkDBSettings']) && ($_REQUEST['checkDBSettings'])){
 155      require_once ('install/checkDBSettings.php');
 156      echo checkDBSettings();
 157      return;
 158  }
 159  
 160  //maintaining the install_type if earlier set to custom
 161  if(isset($_REQUEST['install_type']) && $_REQUEST['install_type'] == 'custom'){
 162      $_SESSION['install_type'] = $_REQUEST['install_type'];
 163  }
 164  
 165  //set the default settings into session
 166  foreach($installer_defaults as $key =>$val){
 167      if(!isset($_SESSION[$key])){
 168          $_SESSION[$key] = $val;
 169      }
 170  }
 171  
 172  // always perform
 173  clean_special_arguments();
 174  print_debug_comment();
 175  $next_clicked = false;
 176  $next_step = 0;
 177  
 178  // use a simple array to map out the steps of the installer page flow
 179  $workflow = array(  'welcome.php',
 180                      'license.php',
 181                      'installType.php',
 182  );
 183  
 184  
 185  
 186  
 187  
 188  $workflow[] =  'systemOptions.php';
 189  $workflow[] = 'dbConfig_a.php';
 190  //$workflow[] = 'dbConfig_b.php';
 191  
 192  //define web root, which will be used as default for site_url
 193  if($_SERVER['SERVER_PORT']=='80'){
 194      $web_root = $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
 195  }else{
 196      $web_root = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['PHP_SELF'];
 197  }
 198  $web_root = str_replace("/install.php", "", $web_root);
 199  $web_root = "http://$web_root";
 200  
 201   if(!isset($_SESSION['oc_install']) ||  $_SESSION['oc_install'] == false) {
 202      $workflow[] = 'siteConfig_a.php';
 203      if(isset($_SESSION['install_type'])  && !empty($_SESSION['install_type'])  && $_SESSION['install_type']=='custom'){
 204          $workflow[] = 'siteConfig_b.php';
 205      }
 206   } else {
 207      if(is_readable('config.php')) {
 208          require_once ('config.php');
 209  
 210  
 211  
 212  
 213  
 214  
 215  
 216  
 217  
 218  
 219  
 220  
 221      }
 222   }
 223  
 224     // set the form's php var to the loaded config's var else default to sane settings
 225      if(!isset($_SESSION['setup_site_url'])  || empty($_SESSION['setup_site_url'])){
 226          if(isset($sugar_config['site_url']) && !empty($sugar_config['site_url'])){
 227              $_SESSION['setup_site_url']= $sugar_config['site_url'];
 228          }else{
 229           $_SESSION['setup_site_url']= $web_root;
 230          }
 231      }
 232      if(!isset($_SESSION['setup_system_name']) || empty($_SESSION['setup_system_name'])){$_SESSION['setup_system_name'] = 'SugarCRM';}
 233      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']  :  '';}
 234      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']      : '.';}
 235      if(!isset($_SESSION['setup_site_guid']) || empty($_SESSION['setup_site_guid'])){$_SESSION['setup_site_guid']                        = (isset($sugar_config['unique_key']))    ? $sugar_config['unique_key']   :  '';}
 236  
 237  
 238  
 239  
 240  
 241  
 242  
 243  
 244  
 245  
 246  
 247  
 248  
 249  
 250  
 251  
 252  
 253    $workflow[] = 'localization.php';
 254    $workflow[] = 'confirmSettings.php';
 255    $workflow[] = 'performSetup.php';
 256  
 257    if(!isset($_SESSION['oc_install']) ||  $_SESSION['oc_install'] == false){
 258      if(isset($_SESSION['install_type'])  && !empty($_SESSION['install_type'])  && $_SESSION['install_type']=='custom'){
 259          //$workflow[] = 'download_patches.php';
 260          $workflow[] = 'download_modules.php';
 261      }
 262    }
 263  
 264      $workflow[] = 'register.php';
 265  
 266  
 267  // increment/decrement the workflow pointer
 268  if(!empty($_REQUEST['goto'])) {
 269      switch($_REQUEST['goto']) {
 270          case $mod_strings['LBL_CHECKSYS_RECHECK']:
 271              $next_step = $_REQUEST['current_step'];
 272              break;
 273          case $mod_strings['LBL_BACK']:
 274              $next_step = $_REQUEST['current_step'] - 1;
 275              break;
 276          case $mod_strings['LBL_NEXT']:
 277          case $mod_strings['LBL_START']:
 278              $next_step = $_REQUEST['current_step'] + 1;
 279              $next_clicked = true;
 280              break;
 281          case 'SilentInstall':
 282              $next_step = 9999;
 283              break;
 284          case 'oc_convert':
 285              $next_step = 9191;
 286              break;
 287      }
 288  }
 289  // Add check here to see if a silent install config file exists; if so then launch silent installer
 290  elseif ( is_file('config_si.php') && empty($sugar_config['installer_locked'])) {
 291      echo <<<EOHTML
 292  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 293  <html>
 294  <head>
 295     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 296     <meta http-equiv="Content-Style-Type" content="text/css">
 297     <meta http-equiv="Refresh" content="1; url=install.php?goto=SilentInstall&cli=true">
 298     <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_TITLE_WELCOME']} {$setup_sugar_version} {$mod_strings['LBL_WELCOME_SETUP_WIZARD']}</title>
 299     <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
 300     <link rel="stylesheet" href="install/install.css" type="text/css">
 301  </head>
 302  <body>
 303      <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
 304      <tr>
 305          <td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
 306      <tr>
 307        <th width="500">
 308          <p><img src="include/images/sugar_md.png" alt="SugarCRM" border="0"></p>
 309          {$mod_strings['LBL_TITLE_WELCOME']} {$setup_sugar_version} {$mod_strings['LBL_WELCOME_SETUP_WIZARD']}</th>
 310  
 311        <th width="200" height="30" style="text-align: right;"><a href="http://www.sugarcrm.com" target=
 312            "_blank"><IMG src="include/images/sugarcrm_login.png" width="145" height="30" alt="SugarCRM" border="0"></a>
 313        </th>
 314      </tr>
 315     <tr>
 316        <td colspan="2"  id="ready_image"><IMG src="include/images/install_themes.jpg" width="698" height="190" alt="Sugar Themes" border="0"></td>
 317      </tr>
 318  
 319      <tr>
 320        <td colspan="2" id="ready">{$mod_strings['LBL_LAUNCHING_SILENT_INSTALL']} </td>
 321      </tr>
 322      </table>
 323  </body>
 324  </html>
 325  EOHTML;
 326      die();
 327  }
 328  
 329  
 330  
 331  
 332  
 333  
 334  
 335  $exclude_files = array('register.php','download_modules.php');
 336  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) {
 337      $the_file = 'installDisabled.php';
 338      $disabled_title = $mod_strings['LBL_DISABLED_DESCRIPTION'];
 339      $disabled_title_2 = $mod_strings['LBL_DISABLED_TITLE_2'];
 340      $disabled_text =<<<EOQ
 341          <p>{$mod_strings['LBL_DISABLED_DESCRIPTION']}</p>
 342          <pre>
 343              'installer_locked' => false,
 344          </pre>
 345          <p>{$mod_strings['LBL_DISABLED_DESCRIPTION_2']}</p>
 346  
 347          <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>
 348  EOQ;
 349  }
 350  else{
 351  $validation_errors = array();
 352  // process the data posted
 353  if($next_clicked) {
 354      // store the submitted data because the 'Next' button was clicked
 355      switch($workflow[trim($_REQUEST['current_step'])]) {
 356          case 'welcome.php':
 357          break;
 358        case 'license.php':
 359                  $_SESSION['setup_license_accept']   = get_boolean_from_request('setup_license_accept');
 360                  $_SESSION['license_submitted']      = true;
 361                  $_SESSION['language']               = $_REQUEST['language'];
 362  
 363             // eventually default all vars here, with overrides from config.php
 364              if(is_readable('config.php')) {
 365                  global $sugar_config;
 366                  include_once ('config.php');
 367              }
 368  
 369              $default_db_type = 'mysql';
 370  
 371  
 372  
 373  
 374  
 375  
 376  
 377              if(!isset($_SESSION['setup_db_type'])) {
 378                  $_SESSION['setup_db_type'] = empty($sugar_config['dbconfig']['db_type']) ? $default_db_type : $sugar_config['dbconfig']['db_type'];
 379              }
 380  
 381              break;
 382          case 'installType.php':
 383              $_SESSION['install_type']   = $_REQUEST['install_type'];
 384              if(isset($_REQUEST['setup_license_key']) && !empty($_REQUEST['setup_license_key'])){
 385                  $_SESSION['setup_license_key']  = $_REQUEST['setup_license_key'];
 386              }
 387              $_SESSION['licenseKey_submitted']      = true;
 388  
 389  
 390  
 391  
 392  
 393  
 394  
 395  
 396  
 397  
 398  
 399  
 400              break;
 401  
 402          case 'systemOptions.php':
 403              $_SESSION['setup_db_type'] = $_REQUEST['setup_db_type'];
 404              $validation_errors = validate_systemOptions();
 405              if(count($validation_errors) > 0) {
 406                  $next_step--;
 407              }
 408              break;
 409  
 410          case 'dbConfig_a.php':
 411              //validation is now done through ajax call to checkDBSettings.php
 412              if(isset($_REQUEST['setup_db_drop_tables'])){
 413                  $_SESSION['setup_db_drop_tables'] = $_REQUEST['setup_db_drop_tables'];
 414                  if($_SESSION['setup_db_drop_tables']=== true || $_SESSION['setup_db_drop_tables'] == 'true'){
 415                      $_SESSION['setup_db_create_database'] = false;
 416                  }
 417              }
 418              break;
 419  
 420          case 'siteConfig_a.php':
 421              if(isset($_REQUEST['setup_site_url'])){$_SESSION['setup_site_url']          = $_REQUEST['setup_site_url'];}
 422              if(isset($_REQUEST['setup_system_name'])){$_SESSION['setup_system_name']    = $_REQUEST['setup_system_name'];}
 423              $_SESSION['setup_site_admin_password']              = $_REQUEST['setup_site_admin_password'];
 424              $_SESSION['setup_site_admin_password_retype']       = $_REQUEST['setup_site_admin_password_retype'];
 425              $_SESSION['siteConfig_submitted']               = true;
 426  
 427              $validation_errors = array();
 428              $validation_errors = validate_siteConfig('a');
 429              if(count($validation_errors) > 0) {
 430                  $next_step--;
 431              }
 432              break;
 433          case 'siteConfig_b.php':
 434              $_SESSION['setup_site_sugarbeet_automatic_checks'] = get_boolean_from_request('setup_site_sugarbeet_automatic_checks');
 435  
 436              $_SESSION['setup_site_custom_session_path']     = get_boolean_from_request('setup_site_custom_session_path');
 437              if($_SESSION['setup_site_custom_session_path']){
 438                  $_SESSION['setup_site_session_path']            = $_REQUEST['setup_site_session_path'];
 439              }else{
 440                  $_SESSION['setup_site_session_path'] = '';
 441              }
 442  
 443              $_SESSION['setup_site_custom_log_dir']          = get_boolean_from_request('setup_site_custom_log_dir');
 444              if($_SESSION['setup_site_custom_log_dir']){
 445                  $_SESSION['setup_site_log_dir']                 = $_REQUEST['setup_site_log_dir'];
 446              }else{
 447                  $_SESSION['setup_site_log_dir'] = '.';
 448              }
 449  
 450              $_SESSION['setup_site_specify_guid']            = get_boolean_from_request('setup_site_specify_guid');
 451              if($_SESSION['setup_site_specify_guid']){
 452                  $_SESSION['setup_site_guid']                    = $_REQUEST['setup_site_guid'];
 453              }else{
 454                  $_SESSION['setup_site_guid'] = '';
 455              }
 456              $_SESSION['siteConfig_submitted']               = true;
 457              if(isset($_REQUEST['setup_site_sugarbeet_anonymous_stats'])){
 458                  $_SESSION['setup_site_sugarbeet_anonymous_stats'] = get_boolean_from_request('setup_site_sugarbeet_anonymous_stats');
 459              }else{
 460                  $_SESSION['setup_site_sugarbeet_anonymous_stats'] = 0;
 461              }
 462  
 463              $validation_errors = array();
 464              $validation_errors = validate_siteConfig('b');
 465              if(count($validation_errors) > 0) {
 466                  $next_step--;
 467              }
 468              break;
 469  
 470  
 471  
 472  
 473  
 474  
 475  
 476  
 477  
 478  
 479  
 480  
 481  
 482  
 483  
 484  
 485  
 486  
 487  
 488  
 489  
 490  
 491  
 492  
 493  
 494  
 495  
 496  
 497  
 498          case 'localization.php':
 499              $_SESSION['default_date_format'] = $_REQUEST['default_date_format'];
 500              $_SESSION['default_time_format'] = $_REQUEST['default_time_format'];
 501              if(isset($_REQUEST['default_language'])){$_SESSION['default_language'] = $_REQUEST['default_language'];}
 502              if(isset($_REQUEST['default_locale_name_format'])){$_SESSION['default_locale_name_format'] = $_REQUEST['default_locale_name_format'];}
 503              if(isset($_REQUEST['default_email_charset'])){$_SESSION['default_email_charset'] = $_REQUEST['default_email_charset'];}
 504              if(isset($_REQUEST['default_export_charset'])){$_SESSION['default_export_charset'] = $_REQUEST['default_export_charset'];}
 505              if(isset($_REQUEST['export_delimiter'])){$_SESSION['export_delimiter'] = $_REQUEST['export_delimiter'];}
 506              $_SESSION['default_currency_name'] = $_REQUEST['default_currency_name'];
 507              $_SESSION['default_currency_symbol'] = $_REQUEST['default_currency_symbol'];
 508              $_SESSION['default_currency_iso4217'] = $_REQUEST['default_currency_iso4217'];
 509              $_SESSION['default_currency_significant_digits'] = $_REQUEST['default_currency_significant_digits'];
 510              $_SESSION['default_number_grouping_seperator'] = $_REQUEST['default_number_grouping_seperator'];
 511              $_SESSION['default_decimal_seperator'] = $_REQUEST['default_decimal_seperator'];
 512  
 513              $validation_errors = validate_localization();
 514              $validation_errors = array();
 515              if(count($validation_errors) > 0) {
 516                  $next_step--;
 517                  }
 518          break;
 519  }
 520      }
 521  
 522  if($next_step == 9999) {
 523      $the_file = 'SilentInstall';
 524  }else if($next_step == 9191) {
 525      $_SESSION['oc_server_url']    = $_REQUEST['oc_server_url'];
 526      $_SESSION['oc_username']    = $_REQUEST['oc_username'];
 527      $_SESSION['oc_password']       = $_REQUEST['oc_password'];
 528      $the_file = 'oc_convert.php';
 529  }
 530  else{
 531          $the_file = $workflow[$next_step];
 532  
 533  }
 534  
 535  switch($the_file) {
 536      case 'welcome.php':
 537      case 'license.php':
 538          // check to see if installer has been disabled
 539          if(is_readable('config.php') && (filesize('config.php') > 0)) {
 540              include_once ('config.php');
 541              //
 542              // Check to see if session variables are working properly
 543              //
 544              $_SESSION['test_session'] = 'sessions are available';
 545              session_write_close();
 546              unset($_SESSION['test_session']);
 547              session_start();
 548  
 549              if(!isset($_SESSION['test_session']))
 550              {
 551                  $the_file = 'installDisabled.php';
 552                  // PHP.ini location -
 553                  $phpIniLocation = get_cfg_var("cfg_file_path");
 554                  $disabled_title = $mod_strings['LBL_SESSION_ERR_TITLE'];
 555                  $disabled_title_2 = $mod_strings['LBL_SESSION_ERR_TITLE'];
 556                  $disabled_text = $mod_strings['LBL_SESSION_ERR_DESCRIPTION']."<pre>{$phpIniLocation}</pre>";
 557              }
 558              elseif(!isset($sugar_config['installer_locked']) || $sugar_config['installer_locked'] == true) {
 559                  $the_file = 'installDisabled.php';
 560                  $disabled_title = $mod_strings['LBL_DISABLED_DESCRIPTION'];
 561                  $disabled_title_2 = $mod_strings['LBL_DISABLED_TITLE_2'];
 562                  $disabled_text =<<<EOQ
 563                      <p>{$mod_strings['LBL_DISABLED_DESCRIPTION']}</p>
 564                      <pre>
 565                          'installer_locked' => false,
 566                      </pre>
 567                      <p>{$mod_strings['LBL_DISABLED_DESCRIPTION_2']}</p>
 568  
 569                      <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>
 570  EOQ;
 571                                  //if this is an offline client installation but the conversion did not succeed,
 572                  //then try to convert again
 573                  if(isset($sugar_config['disc_client']) && $sugar_config['disc_client'] == true && isset($sugar_config['oc_converted']) && $sugar_config['oc_converted'] == false) {
 574                       header('Location: index.php?entryPoint=oc_convert&first_time=true');
 575                      exit ();
 576                  }
 577              }
 578          }
 579          break;
 580      case 'register.php':
 581          session_unset();
 582          break;
 583      case 'SilentInstall':
 584          $si_errors = false;
 585          pullSilentInstallVarsIntoSession();
 586          $validation_errors = validate_dbConfig('a');
 587          if(count($validation_errors) > 0) {
 588              $the_file = 'dbConfig_a.php';
 589              $si_errors = true;
 590          }
 591          $validation_errors = validate_siteConfig('a');
 592          if(count($validation_errors) > 0) {
 593              $the_file = 'siteConfig_a.php';
 594              $si_errors = true;
 595          }
 596          $validation_errors = validate_siteConfig('b');
 597          if(count($validation_errors) > 0) {
 598              $the_file = 'siteConfig_b.php';
 599              $si_errors = true;
 600          }
 601  
 602          if(!$si_errors){
 603              $the_file = 'performSetup.php';
 604          }
 605          //since this is a SilentInstall we still need to make sure that
 606          //the appropriate files are writable
 607          // config.php
 608          make_writable('./config.php');
 609  
 610          // custom dir
 611          make_writable('./custom');
 612  
 613          // modules dir
 614          recursive_make_writable('./modules');
 615  
 616          // data dir
 617          make_writable('./data');
 618          make_writable('./data/upload');
 619  
 620          // cache dir
 621          make_writable('./cache/custom_fields');
 622          make_writable('./cache/dyn_lay');
 623          make_writable('./cache/images');
 624          make_writable('./cache/import');
 625          make_writable('./cache/layout');
 626          make_writable('./cache/pdf');
 627          make_writable('./cache/upload');
 628          make_writable('./cache/xml');
 629  
 630          // check whether we're getting this request from a command line tool
 631          // we want to output brief messages if we're outputting to a command line tool
 632          $cli_mode = false;
 633          if(isset($_REQUEST['cli']) && ($_REQUEST['cli'] == 'true')) {
 634              $_SESSION['cli'] = true;
 635              // if we have errors, just shoot them back now
 636              if(count($validation_errors) > 0) {
 637                  foreach($validation_errors as $error) {
 638                      print($mod_strings['ERR_ERROR_GENERAL']."\n");
 639                      print("    " . $error . "\n");
 640                      print("Exit 1\n");
 641                      exit(1);
 642                  }
 643              }
 644          }
 645  
 646  
 647  
 648  
 649  
 650  
 651  
 652  
 653  
 654  
 655          break;
 656      }
 657  }
 658  
 659  
 660  $the_file = clean_string($the_file, 'FILE');
 661  // change to require to get a good file load error message if the file is not available.
 662  $css = 'install/install.css';
 663  $icon = 'include/images/sugar_icon.ico';
 664  $sugar_md = 'include/images/sugar_md.png';
 665  $loginImage = 'include/images/sugarcrm_login.png';
 666  $common = 'install/installCommon.js';
 667  require('install/' . $the_file);
 668  
 669  ?>


Generé en: Thu Mar 4 09:44:50 2010 | Cross-referenced par PHPXref 0.7