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-2012 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, $app_strings;
41 if (isset($sugar_config['default_language']) == false)
43 $sugar_config['default_language'] = $GLOBALS['current_language'];
45 $app_strings = return_application_language($GLOBALS['current_language']);
47 if( !isset( $install_script ) || !$install_script ){
48 die($mod_strings['ERR_NO_DIRECT_SCRIPT']);
51 $db = getDbConnection();
53 $dbCreate = "({$mod_strings['LBL_CONFIRM_WILL']} ";
54 if(!$_SESSION['setup_db_create_database']){
55 $dbCreate .= $mod_strings['LBL_CONFIRM_NOT'];
57 $dbCreate .= " {$mod_strings['LBL_CONFIRM_BE_CREATED']})";
59 $dbUser = "{$_SESSION['setup_db_sugarsales_user']} ({$mod_strings['LBL_CONFIRM_WILL']} ";
60 if( $_SESSION['setup_db_create_sugarsales_user'] != 1 ){
61 $dbUser .= $mod_strings['LBL_CONFIRM_NOT'];
63 $dbUser .= " {$mod_strings['LBL_CONFIRM_BE_CREATED']})";
64 $yesNoDropCreate = $mod_strings['LBL_NO'];
65 if ($_SESSION['setup_db_drop_tables']===true ||$_SESSION['setup_db_drop_tables'] == 'true'){
66 $yesNoDropCreate = $mod_strings['LBL_YES'];
68 $yesNoSugarUpdates = ($_SESSION['setup_site_sugarbeet']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
69 $yesNoCustomSession = ($_SESSION['setup_site_custom_session_path']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
70 $yesNoCustomLog = ($_SESSION['setup_site_custom_log_dir']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
71 $yesNoCustomId = ($_SESSION['setup_site_specify_guid']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
72 $demoData = ($_SESSION['demoData'] == 'en_us') ? ($mod_strings['LBL_YES']) : ($_SESSION['demoData']);
73 // Populate the default date format, time format, and language for the system
74 $defaultDateFormat = "";
75 $defaultTimeFormat = "";
76 $defaultLanguages = "";
78 $sugar_config_defaults = get_sugar_config_defaults();
79 if(isset($_REQUEST['default_language'])){
80 $defaultLanguages = $sugar_config_defaults['languages'][$_REQUEST['default_language']];
83 ///////////////////////////////////////////////////////////////////////////////
85 $langHeader = get_language_header();
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('button_next2').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" 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>
117 <tr><td></td><td><b>{$mod_strings['LBL_CONFIRM_DB_TYPE']}</b></td><td>{$_SESSION['setup_db_type']}</td></tr>
118 <tr><td></td><td><b>{$mod_strings['LBL_DBCONF_HOST_NAME']}</b></td><td>{$_SESSION['setup_db_host_name']}</td></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>
198 <tr><td colspan="3" align="left"></td></tr>
199 <tr><th colspan="3" align="left">{$mod_strings['LBL_SYSTEM_CREDS']}</th></tr>
202 <td><b>{$mod_strings['LBL_DBCONF_DB_USER']}</b></td>
204 {$_SESSION['setup_db_sugarsales_user']}
209 <td><b>{$mod_strings['LBL_DBCONF_DB_PASSWORD']}</b></td>
211 <span id='hide_db_admin_pass'>{$mod_strings['LBL_HIDDEN']}</span>
212 <span style='display:none' id='show_db_admin_pass'>{$_SESSION['setup_db_sugarsales_password']}</span>
217 <td><b>{$mod_strings['LBL_SITECFG_ADMIN_Name']}</b></td>
224 <td><b>{$mod_strings['LBL_SITECFG_ADMIN_PASS']}</b></td>
226 <span id='hide_site_admin_pass'>{$mod_strings['LBL_HIDDEN']}</span>
227 <span style='display:none' id='show_site_admin_pass'>{$_SESSION['setup_site_admin_password']}</span>
239 <tr><td colspan="3" align="left"></td></tr><tr><th colspan="3" align="left">'.$mod_strings['LBL_SYSTEM_ENV'].'</th></tr>';
245 <td><b>'.$mod_strings['LBL_CHECKSYS_PHPVER'].'</b></td>
246 <td >'.constant('PHP_VERSION').'</td>
250 //Begin List of already known good variables. These were checked during the initial sys check
255 <td><strong>'.$mod_strings['LBL_CHECKSYS_XML'].'</strong></td>
256 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
266 <td><strong>'.$mod_strings['LBL_CHECKSYS_MBSTRING'].'</strong></td>
267 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
274 <td><strong>'.$mod_strings['LBL_CHECKSYS_CONFIG'].'</strong></td>
275 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
284 <td><strong>'.$mod_strings['LBL_CHECKSYS_CUSTOM'].'</strong></td>
285 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
293 <td><strong>'.$mod_strings['LBL_CHECKSYS_MODULE'].'</strong></td>
294 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
301 <td><strong>'.$mod_strings['LBL_CHECKSYS_UPLOAD'].'</strong></td>
302 <td>'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
310 <td><strong>'.$mod_strings['LBL_CHECKSYS_DATA'].'</strong></td>
311 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
319 <td><strong>'.$mod_strings['LBL_CHECKSYS_CACHE'].'</strong></td>
320 <td >'.$mod_strings['LBL_CHECKSYS_OK'].'</td>
322 // End already known to be good
326 // CL - fix for 9183 (if memory_limit is enabled we will honor it and check it; otherwise use unlimited)
327 $memory_limit = ini_get('memory_limit');
328 if(empty($memory_limit)){
329 $memory_limit = "-1";
331 if(!defined('SUGARCRM_MIN_MEM')) {
332 define('SUGARCRM_MIN_MEM', 40*1024*1024);
334 $sugarMinMem = constant('SUGARCRM_MIN_MEM');
335 // logic based on: http://us2.php.net/manual/en/ini.core.php#ini.memory-limit
336 if( $memory_limit == "" ){ // memory_limit disabled at compile time, no memory limit
337 $memory_msg = "<b>{$mod_strings['LBL_CHECKSYS_MEM_OK']}</b>";
338 } elseif( $memory_limit == "-1" ){ // memory_limit enabled, but set to unlimited
339 $memory_msg = "{$mod_strings['LBL_CHECKSYS_MEM_UNLIMITED']}";
341 $mem_display = $memory_limit;
342 preg_match('/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $memory_limit, $matches);
343 $num = (float)$matches[1];
344 // Don't break so that it falls through to the next case.
345 switch (strtoupper($matches[2])) {
353 $memory_limit_int = intval($num);
354 $SUGARCRM_MIN_MEM = (int) constant('SUGARCRM_MIN_MEM');
355 if( $memory_limit_int < constant('SUGARCRM_MIN_MEM') ){
356 $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>";
357 $memory_msg = str_replace('$memory_limit', $mem_display, $memory_msg);
359 $memory_msg = "{$mod_strings['LBL_CHECKSYS_OK']} ({$memory_limit})";
366 <td><strong>'.$mod_strings['LBL_CHECKSYS_MEM'].'</strong></td>
367 <td >'.$memory_msg.'</td>
371 if(function_exists('gzclose')) {
372 $zlibStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
374 $zlibStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_ZLIB']}</b></span>";
379 <td><strong>'.$mod_strings['LBL_CHECKSYS_ZLIB'].'</strong></td>
380 <td >'.$zlibStatus.'</td>
384 if(class_exists("ZipArchive")) {
385 $zipStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
387 $zipStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_ZIP']}</b></span>";
392 <td><strong>'.$mod_strings['LBL_CHECKSYS_ZIP'].'</strong></td>
393 <td >'.$zipStatus.'</td>
399 if(function_exists('imap_open')) {
400 $imapStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
402 $imapStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_IMAP']}</b></span>";
408 <td><strong>'.$mod_strings['LBL_CHECKSYS_IMAP'].'</strong></td>
409 <td >'.$imapStatus.'</td>
414 if(function_exists('curl_init')) {
415 $curlStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
417 $curlStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_CURL']}</b></span>";
423 <td><strong>'.$mod_strings['LBL_CHECKSYS_CURL'].'</strong></td>
424 <td >'.$curlStatus.'</td>
428 //CHECK UPLOAD FILE SIZE
429 $upload_max_filesize = ini_get('upload_max_filesize');
430 $upload_max_filesize_bytes = return_bytes($upload_max_filesize);
431 if(!defined('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')){
432 define('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES', 6 * 1024 * 1024);
435 if($upload_max_filesize_bytes > constant('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')) {
436 $fileMaxStatus = "{$mod_strings['LBL_CHECKSYS_OK']}</font>";
438 $fileMaxStatus = "<span class='stop'><b>{$mod_strings['ERR_UPLOAD_MAX_FILESIZE']}</font></b></span>";
444 <td><strong>'.$mod_strings['LBL_UPLOAD_MAX_FILESIZE_TITLE'].'</strong></td>
445 <td >'.$fileMaxStatus.'</td>
448 //CHECK Sprite support
449 if(function_exists('imagecreatetruecolor'))
451 $spriteSupportStatus = "{$mod_strings['LBL_CHECKSYS_OK']}</font>";
453 $spriteSupportStatus = "<span class='stop'><b>{$mod_strings['ERROR_SPRITE_SUPPORT']}</b></span>";
458 <td><strong>'.$mod_strings['LBL_SPRITE_SUPPORT'].'</strong></td>
459 <td >'.$spriteSupportStatus.'</td>
462 // Suhosin allow to use upload://
463 if (UploadStream::getSuhosinStatus() == true || (strpos(ini_get('suhosin.perdir'), 'e') !== false && strpos($_SERVER["SERVER_SOFTWARE"],'Microsoft-IIS') === false))
465 $suhosinStatus = "{$mod_strings['LBL_CHECKSYS_OK']}";
469 $suhosinStatus = "<span class='stop'><b>{$app_strings['ERR_SUHOSIN']}</b></span>";
474 <td><strong>PHP allows to use stream (' . UploadStream::STREAM_NAME . '://)</strong></td>
475 <td>' . $suhosinStatus . '</td>
480 $phpIniLocation = get_cfg_var("cfg_file_path");
484 <td><strong>'.$mod_strings['LBL_CHECKSYS_PHP_INI'].'</strong></td>
485 <td >'.$phpIniLocation.'</td>
496 <td align="right" colspan="2">
497 <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
498 <tr><th align="left" colspan="2"> </th></tr>
502 if ( !isset($sugar_config['default_language']) )
503 $sugar_config['default_language'] = $_SESSION['default_language'];
504 if ( !isset($sugar_config['cache_dir']) )
505 $sugar_config['cache_dir'] = $sugar_config_defaults['cache_dir'];
506 if ( !isset($sugar_config['site_url']) )
507 $sugar_config['site_url'] = $_SESSION['setup_site_url'];
508 if ( !isset($sugar_config['translation_string_prefix']) )
509 $sugar_config['translation_string_prefix'] = $sugar_config_defaults['translation_string_prefix'];
510 $mod_strings_scheduler = return_module_language($GLOBALS['current_language'], 'Schedulers');
513 if (!isset($_SERVER['Path'])) {
514 $_SERVER['Path'] = getenv('Path');
517 if(isset($_SERVER['Path']) && !empty($_SERVER['Path'])) { // IIS IUSR_xxx may not have access to Path or it is not set
518 if(!strpos($_SERVER['Path'], 'php')) {
519 // $error = '<em>'.$mod_strings_scheduler['LBL_NO_PHP_CLI'].'</em>';
524 <td align="left" colspan="2">
526 '.$mod_strings_scheduler['LBL_CRON_WINDOWS_DESC'].'<br>
528 cd '.realpath('./').'<br>
535 if(isset($_SERVER['Path']) && !empty($_SERVER['Path'])) { // some Linux servers do not make this available
536 if(!strpos($_SERVER['PATH'], 'php')) {
537 // $error = '<em>'.$mod_strings_scheduler['LBL_NO_PHP_CLI'].'</em>';
542 <td align="left" colspan="2">
544 '.$mod_strings_scheduler['LBL_CRON_INSTRUCTIONS_LINUX'].'
546 '.$mod_strings_scheduler['LBL_CRON_LINUX_DESC'].'<br>
547 * * * * *
548 cd '.realpath('./').'; php -f cron.php > /dev/null 2>&1
562 <td colspan='3' align='right'>
563 <input type="button" class="button" name="print_summary" id="button_print_summary_settings" value="{$mod_strings['LBL_PRINT_SUMM']}"
564 onClick='window.print()' onCluck='window.open("install.php?current_step="+(document.setConfig.current_step.value -1)+"&goto={$mod_strings["LBL_NEXT"]}&print=true");' />
568 <td align="right" colspan="2">
570 <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
573 <input type="button" class="button" id="show_pass_button" value="{$mod_strings['LBL_SHOW_PASS']}"
574 onClick='togglePass();' />
577 <input type="hidden" name="goto" id="goto">
578 <input class="button" type="button" value="{$mod_strings['LBL_BACK']}" id="button_back_settings" onclick="document.getElementById('goto').value='{$mod_strings['LBL_BACK']}';document.getElementById('form').submit();" />
581 <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="button_next2"/>
591 function togglePass(){
592 if(document.getElementById('show_site_admin_pass').style.display == ''){
593 document.getElementById('show_pass_button').value = "{$mod_strings['LBL_SHOW_PASS']}";
594 document.getElementById('hide_site_admin_pass').style.display = '';
595 document.getElementById('hide_db_admin_pass').style.display = '';
596 document.getElementById('show_site_admin_pass').style.display = 'none';
597 document.getElementById('show_db_admin_pass').style.display = 'none';
600 document.getElementById('show_pass_button').value = "{$mod_strings['LBL_HIDE_PASS']}";
601 document.getElementById('show_site_admin_pass').style.display = '';
602 document.getElementById('show_db_admin_pass').style.display = '';
603 document.getElementById('hide_site_admin_pass').style.display = 'none';
604 document.getElementById('hide_db_admin_pass').style.display = 'none';