2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
40 global $sugar_config,$db;
42 if( !isset( $install_script ) || !$install_script ){
43 die($mod_strings['ERR_NO_DIRECT_SCRIPT']);
54 $dbCreate = "({$mod_strings['LBL_CONFIRM_WILL']} ";
55 if(!$_SESSION['setup_db_create_database']){
56 $dbCreate .= $mod_strings['LBL_CONFIRM_NOT'];
58 $dbCreate .= " {$mod_strings['LBL_CONFIRM_BE_CREATED']})";
60 $dbUser = "{$_SESSION['setup_db_sugarsales_user']} ({$mod_strings['LBL_CONFIRM_WILL']} ";
61 if( $_SESSION['setup_db_create_sugarsales_user'] != 1 ){
62 $dbUser .= $mod_strings['LBL_CONFIRM_NOT'];
64 $dbUser .= " {$mod_strings['LBL_CONFIRM_BE_CREATED']})";
65 $yesNoDropCreate = $mod_strings['LBL_NO'];
66 if ($_SESSION['setup_db_drop_tables']===true ||$_SESSION['setup_db_drop_tables'] == 'true'){
67 $yesNoDropCreate = $mod_strings['LBL_YES'];
69 $yesNoSugarUpdates = ($_SESSION['setup_site_sugarbeet']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
70 $yesNoCustomSession = ($_SESSION['setup_site_custom_session_path']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
71 $yesNoCustomLog = ($_SESSION['setup_site_custom_log_dir']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
72 $yesNoCustomId = ($_SESSION['setup_site_specify_guid']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
73 $demoData = ($_SESSION['demoData'] == 'en_us') ? ($mod_strings['LBL_YES']) : ($_SESSION['demoData']);
74 // Populate the default date format, time format, and language for the system
75 $defaultDateFormat = "";
76 $defaultTimeFormat = "";
77 $defaultLanguages = "";
79 $sugar_config_defaults = get_sugar_config_defaults();
80 if(isset($_REQUEST['default_language'])){
81 $defaultLanguages = $sugar_config_defaults['languages'][$_REQUEST['default_language']];
84 ///////////////////////////////////////////////////////////////////////////////
88 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
91 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
92 <meta http-equiv="Content-Script-Type" content="text/javascript">
93 <meta http-equiv="Content-Style-Type" content="text/css">
94 <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_CONFIRM_TITLE']}</title>
95 <link REL="SHORTCUT ICON" HREF="$icon">
96 <link rel="stylesheet" href="$css" type="text/css" />
98 <body onload="javascript:document.getElementById('defaultFocus').focus();">
99 <form action="install.php" method="post" name="setConfig" id="form">
100 <input type="hidden" name="current_step" value="{$next_step}">
101 <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
102 <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
106 <img src="{$sugar_md}" alt="SugarCRM" border="0">
108 {$mod_strings['LBL_CONFIRM_TITLE']}</th>
109 <th width="200" style="text-align: right;"><a href="http://www.sugarcrm.com" target="_blank"><IMG src="$loginImage" width="145" height="30" alt="SugarCRM" border="0"></a>
115 <table width="100%" cellpadding="0" cellpadding="0" border="0" class="StyleDottedHr">
116 <tr><th colspan="3" align="left">{$mod_strings['LBL_DBCONF_TITLE']}</th></tr>
121 <td><b>{$mod_strings['LBL_DBCONF_DB_NAME']}</b></td>
123 {$_SESSION['setup_db_database_name']} {$dbCreate}
131 <td><b>{$mod_strings['LBL_DBCONF_DB_ADMIN_USER']}</b></td>
132 <td>{$_SESSION['setup_db_admin_user_name']}</td>
136 <td><b>{$mod_strings['LBL_DBCONF_DEMO_DATA']}</b></td>
140 if($yesNoDropCreate){
145 <td><b>{$mod_strings['LBL_DBCONF_DB_DROP']}</b></td>
146 <td>{$yesNoDropCreate}</td>
153 if(isset($_SESSION['install_type']) && !empty($_SESSION['install_type']) && $_SESSION['install_type']=='custom'){
156 <tr><td colspan="3" align="left"></td></tr>
158 <th colspan="3" align="left">{$mod_strings['LBL_SITECFG_TITLE']}</th>
162 <td><b>{$mod_strings['LBL_SITECFG_URL']}</b></td>
163 <td>{$_SESSION['setup_site_url']}</td>
166 <tr><td colspan="3" align="left"></td></tr>
167 <th colspan="3" align="left">{$mod_strings['LBL_SITECFG_SUGAR_UPDATES']}</th>
171 <td><b>{$mod_strings['LBL_SITECFG_SUGAR_UP']}</b></td>
172 <td>{$yesNoSugarUpdates}</td>
175 <tr><td colspan="3" align="left"></td></tr>
176 <th colspan="3" align="left">{$mod_strings['LBL_SITECFG_SITE_SECURITY']}</th>
180 <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_SESSION']}?</b></td>
181 <td>{$yesNoCustomSession}</td>
185 <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_LOG']}?</b></td>
186 <td>{$yesNoCustomLog}</td>
190 <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_ID']}?</b></td>
191 <td>{$yesNoCustomId}</td>
196 if(isset($_SESSION['licenseKey_submitted']) && ($_SESSION['licenseKey_submitted'])
197 && (isset($GLOBALS['db']) && !empty($GLOBALS['db']))){
209 <tr><td colspan="3" align="left"></td></tr>
210 <tr><th colspan="3" align="left">{$mod_strings['LBL_SYSTEM_CREDS']}</th></tr>
213 <td><b>{$mod_strings['LBL_DBCONF_DB_USER']}</b></td>
215 {$_SESSION['setup_db_sugarsales_user']}
220 <td><b>{$mod_strings['LBL_DBCONF_DB_PASSWORD']}</b></td>
222 <span id='hide_db_admin_pass'>{$mod_strings['LBL_HIDDEN']}</span>
223 <span style='display:none' id='show_db_admin_pass'>{$_SESSION['setup_db_sugarsales_password']}</span>
228 <td><b>{$mod_strings['LBL_SITECFG_ADMIN_Name']}</b></td>
235 <td><b>{$mod_strings['LBL_SITECFG_ADMIN_PASS']}</b></td>
237 <span id='hide_site_admin_pass'>{$mod_strings['LBL_HIDDEN']}</span>
238 <span style='display:none' id='show_site_admin_pass'>{$_SESSION['setup_site_admin_password']}</span>
250 <tr><td colspan="3" align="left"></td></tr><tr><th colspan="3" align="left">'.$mod_strings['LBL_SYSTEM_ENV'].'</th></tr>';
256 <td><b>'.$mod_strings['LBL_CHECKSYS_PHPVER'].'</b></td>
257 <td >'.constant('PHP_VERSION').'</td>
261 //Begin List of already known good variables. These were checked during the initial sys check
266 <td><strong>'.$mod_strings['LBL_CHECKSYS_XML'].'</strong></td>
267 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
277 <td><strong>'.$mod_strings['LBL_CHECKSYS_MBSTRING'].'</strong></td>
278 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
285 <td><strong>'.$mod_strings['LBL_CHECKSYS_CONFIG'].'</strong></td>
286 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
295 <td><strong>'.$mod_strings['LBL_CHECKSYS_CUSTOM'].'</strong></td>
296 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
304 <td><strong>'.$mod_strings['LBL_CHECKSYS_MODULE'].'</strong></td>
305 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
313 <td><strong>'.$mod_strings['LBL_CHECKSYS_DATA'].'</strong></td>
314 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
322 <td><strong>'.$mod_strings['LBL_CHECKSYS_CACHE'].'</strong></td>
323 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
325 // End already known to be good
329 // CL - fix for 9183 (if memory_limit is enabled we will honor it and check it; otherwise use unlimited)
330 $memory_limit = ini_get('memory_limit');
331 if(empty($memory_limit)){
332 $memory_limit = "-1";
334 if(!defined('SUGARCRM_MIN_MEM')) {
335 define('SUGARCRM_MIN_MEM', 40);
337 $sugarMinMem = constant('SUGARCRM_MIN_MEM');
338 // logic based on: http://us2.php.net/manual/en/ini.core.php#ini.memory-limit
339 if( $memory_limit == "" ){ // memory_limit disabled at compile time, no memory limit
340 $memory_msg = "<b>{$mod_strings['LBL_CHECKSYS_MEM_OK']}</b>";
341 } elseif( $memory_limit == "-1" ){ // memory_limit enabled, but set to unlimited
342 $memory_msg = "{$mod_strings['LBL_CHECKSYS_MEM_UNLIMITED']}";
344 $mem_display = $memory_limit;
345 rtrim($memory_limit, 'M');
346 $memory_limit_int = (int) $memory_limit;
347 $SUGARCRM_MIN_MEM = (int) constant('SUGARCRM_MIN_MEM');
348 if( $memory_limit_int < constant('SUGARCRM_MIN_MEM') ){
349 $memory_msg = "<span class='stop'><b>$memory_limit{$mod_strings['ERR_CHECKSYS_MEM_LIMIT_1']}" . constant('SUGARCRM_MIN_MEM') . "{$mod_strings['ERR_CHECKSYS_MEM_LIMIT_2']}</b></span>";
350 $memory_msg = str_replace('$memory_limit', $mem_display, $memory_msg);
352 $memory_msg = "{$mod_strings['LBL_CHECKSYS_OK']} ({$memory_limit})";
359 <td><strong>'.$mod_strings['LBL_CHECKSYS_MEM'].'</strong></td>
360 <td >'.$memory_msg.'</td>
364 if(function_exists('gzclose')) {
365 $zlibStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
367 $zlibStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_ZLIB']}</b></span>";
372 <td><strong>'.$mod_strings['LBL_CHECKSYS_ZLIB'].'</strong></td>
373 <td >'.$zlibStatus.'</td>
377 if(class_exists("ZipArchive")) {
378 $zipStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
380 $zipStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_ZIP']}</b></span>";
385 <td><strong>'.$mod_strings['LBL_CHECKSYS_ZIP'].'</strong></td>
386 <td >'.$zipStatus.'</td>
392 if(function_exists('imap_open')) {
393 $imapStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
395 $imapStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_IMAP']}</b></span>";
401 <td><strong>'.$mod_strings['LBL_CHECKSYS_IMAP'].'</strong></td>
402 <td >'.$imapStatus.'</td>
407 if(function_exists('curl_init')) {
408 $curlStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
410 $curlStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_CURL']}</b></span>";
416 <td><strong>'.$mod_strings['LBL_CHECKSYS_CURL'].'</strong></td>
417 <td >'.$curlStatus.'</td>
421 //CHECK UPLOAD FILE SIZE
422 $upload_max_filesize = ini_get('upload_max_filesize');
423 $upload_max_filesize_bytes = return_bytes($upload_max_filesize);
424 if(!defined('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')){
425 define('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES', 6 * 1024 * 1024);
428 if($upload_max_filesize_bytes > constant('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')) {
429 $fileMaxStatus = "{$mod_strings['LBL_CHECKSYS_OK']}</font>";
431 $fileMaxStatus = "<span class='stop'><b>{$mod_strings['ERR_UPLOAD_MAX_FILESIZE']}</font></b></span>";
437 <td><strong>'.$mod_strings['LBL_UPLOAD_MAX_FILESIZE_TITLE'].'</strong></td>
438 <td >'.$fileMaxStatus.'</td>
446 $phpIniLocation = get_cfg_var("cfg_file_path");
450 <td><strong>'.$mod_strings['LBL_CHECKSYS_PHP_INI'].'</strong></td>
451 <td >'.$phpIniLocation.'</td>
462 <td align="right" colspan="2">
463 <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
464 <tr><th align="left" colspan="2"> </th></tr>
468 if ( !isset($sugar_config['default_language']) )
469 $sugar_config['default_language'] = $_SESSION['default_language'];
470 if ( !isset($sugar_config['cache_dir']) )
471 $sugar_config['cache_dir'] = $sugar_config_defaults['cache_dir'];
472 if ( !isset($sugar_config['site_url']) )
473 $sugar_config['site_url'] = $_SESSION['setup_site_url'];
474 if ( !isset($sugar_config['translation_string_prefix']) )
475 $sugar_config['translation_string_prefix'] = $sugar_config_defaults['translation_string_prefix'];
476 $mod_strings_scheduler = return_module_language($GLOBALS['current_language'], 'Schedulers');
479 if (!isset($_SERVER['Path'])) {
480 $_SERVER['Path'] = getenv('Path');
483 if(isset($_SERVER['Path']) && !empty($_SERVER['Path'])) { // IIS IUSR_xxx may not have access to Path or it is not set
484 if(!strpos($_SERVER['Path'], 'php')) {
485 $error = '<em>'.$mod_strings_scheduler['LBL_NO_PHP_CLI'].'</em>';
490 <td align="left" colspan="2">
492 '.$mod_strings_scheduler['LBL_CRON_WINDOWS_DESC'].'<br>
494 cd '.realpath('./').'<br>
501 if(isset($_SERVER['Path']) && !empty($_SERVER['Path'])) { // some Linux servers do not make this available
502 if(!strpos($_SERVER['PATH'], 'php')) {
503 $error = '<em>'.$mod_strings_scheduler['LBL_NO_PHP_CLI'].'</em>';
508 <td align="left" colspan="2">
510 '.$mod_strings_scheduler['LBL_CRON_INSTRUCTIONS_LINUX'].'
512 '.$mod_strings_scheduler['LBL_CRON_LINUX_DESC'].'<br>
513 * * * * *
514 cd '.realpath('./').'; php -f cron.php > /dev/null 2>&1
528 <td colspan='3' align='right'>
529 <input type="button" class="button" name="print_summary" value="{$mod_strings['LBL_PRINT_SUMM']}"
530 onClick='window.print()' onCluck='window.open("install.php?current_step="+(document.setConfig.current_step.value -1)+"&goto={$mod_strings["LBL_NEXT"]}&print=true");' />
534 <td align="right" colspan="2">
536 <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
539 <input type="button" class="button" id="show_pass_button" value="{$mod_strings['LBL_SHOW_PASS']}"
540 onClick='togglePass();' />
543 <input type="hidden" name="goto" id="goto">
544 <input class="button" type="button" value="{$mod_strings['LBL_BACK']}" onclick="document.getElementById('goto').value='{$mod_strings['LBL_BACK']}';document.getElementById('form').submit();" />
547 <input class="button" type="button" value="{$mod_strings['LBL_LANG_BUTTON_COMMIT']}" onclick="document.getElementById('goto').value='{$mod_strings['LBL_NEXT']}';document.getElementById('form').submit();" id="defaultFocus"/>
557 function togglePass(){
558 if(document.getElementById('show_site_admin_pass').style.display == ''){
559 document.getElementById('show_pass_button').value = "{$mod_strings['LBL_SHOW_PASS']}";
560 document.getElementById('hide_site_admin_pass').style.display = '';
561 document.getElementById('hide_db_admin_pass').style.display = '';
562 document.getElementById('show_site_admin_pass').style.display = 'none';
563 document.getElementById('show_db_admin_pass').style.display = 'none';
566 document.getElementById('show_pass_button').value = "{$mod_strings['LBL_HIDE_PASS']}";
567 document.getElementById('show_site_admin_pass').style.display = '';
568 document.getElementById('show_db_admin_pass').style.display = '';
569 document.getElementById('hide_site_admin_pass').style.display = 'none';
570 document.getElementById('hide_db_admin_pass').style.display = 'none';