This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
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-2013 SugarCRM Inc. |
||
6 | |||
7 | * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. |
||
8 | * Copyright (C) 2011 - 2014 Salesagility Ltd. |
||
9 | * |
||
10 | * This program is free software; you can redistribute it and/or modify it under |
||
11 | * the terms of the GNU Affero General Public License version 3 as published by the |
||
12 | * Free Software Foundation with the addition of the following permission added |
||
13 | * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK |
||
14 | * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY |
||
15 | * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. |
||
16 | * |
||
17 | * This program is distributed in the hope that it will be useful, but WITHOUT |
||
18 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
||
19 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
||
20 | * details. |
||
21 | * |
||
22 | * You should have received a copy of the GNU Affero General Public License along with |
||
23 | * this program; if not, see http://www.gnu.org/licenses or write to the Free |
||
24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
||
25 | * 02110-1301 USA. |
||
26 | * |
||
27 | * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, |
||
28 | * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. |
||
29 | * |
||
30 | * The interactive user interfaces in modified source and object code versions |
||
31 | * of this program must display Appropriate Legal Notices, as required under |
||
32 | * Section 5 of the GNU Affero General Public License version 3. |
||
33 | * |
||
34 | * In accordance with Section 7(b) of the GNU Affero General Public License version 3, |
||
35 | * these Appropriate Legal Notices must retain the display of the "Powered by |
||
36 | * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not |
||
37 | * reasonably feasible for technical reasons, the Appropriate Legal Notices must |
||
38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
||
39 | ********************************************************************************/ |
||
40 | |||
41 | |||
42 | |||
43 | global $sugar_config, $db, $app_strings; |
||
44 | if (isset($sugar_config['default_language']) == false) |
||
0 ignored issues
–
show
|
|||
45 | { |
||
46 | $sugar_config['default_language'] = $GLOBALS['current_language']; |
||
47 | } |
||
48 | $app_strings = return_application_language($GLOBALS['current_language']); |
||
49 | |||
50 | if( !isset( $install_script ) || !$install_script ){ |
||
51 | die($mod_strings['ERR_NO_DIRECT_SCRIPT']); |
||
52 | } |
||
53 | |||
54 | $db = getDbConnection(); |
||
55 | |||
56 | $dbCreate = "({$mod_strings['LBL_CONFIRM_WILL']} "; |
||
57 | if(!$_SESSION['setup_db_create_database']){ |
||
58 | $dbCreate .= $mod_strings['LBL_CONFIRM_NOT']; |
||
59 | } |
||
60 | $dbCreate .= " {$mod_strings['LBL_CONFIRM_BE_CREATED']})"; |
||
61 | |||
62 | $dbUser = "{$_SESSION['setup_db_sugarsales_user']} ({$mod_strings['LBL_CONFIRM_WILL']} "; |
||
63 | if( $_SESSION['setup_db_create_sugarsales_user'] != 1 ){ |
||
64 | $dbUser .= $mod_strings['LBL_CONFIRM_NOT']; |
||
65 | } |
||
66 | $dbUser .= " {$mod_strings['LBL_CONFIRM_BE_CREATED']})"; |
||
67 | $yesNoDropCreate = $mod_strings['LBL_NO']; |
||
68 | if ($_SESSION['setup_db_drop_tables']===true ||$_SESSION['setup_db_drop_tables'] == 'true'){ |
||
69 | $yesNoDropCreate = $mod_strings['LBL_YES']; |
||
70 | } |
||
71 | $_SESSION['setup_site_sugarbeet'] = false; |
||
72 | $yesNoSugarUpdates = ($_SESSION['setup_site_sugarbeet']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO']; |
||
73 | $yesNoCustomSession = ($_SESSION['setup_site_custom_session_path']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO']; |
||
74 | $yesNoCustomLog = ($_SESSION['setup_site_custom_log_dir']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO']; |
||
75 | $yesNoCustomId = ($_SESSION['setup_site_specify_guid']) ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO']; |
||
76 | $demoData = ($_SESSION['demoData'] == 'en_us') ? ($mod_strings['LBL_YES']) : ($_SESSION['demoData']); |
||
77 | // Populate the default date format, time format, and language for the system |
||
78 | $defaultDateFormat = ""; |
||
79 | $defaultTimeFormat = ""; |
||
80 | $defaultLanguages = ""; |
||
81 | |||
82 | $sugar_config_defaults = get_sugar_config_defaults(); |
||
83 | if(isset($_REQUEST['default_language'])){ |
||
84 | $defaultLanguages = $sugar_config_defaults['languages'][$_REQUEST['default_language']]; |
||
85 | } |
||
86 | |||
87 | /////////////////////////////////////////////////////////////////////////////// |
||
88 | //// START OUTPUT |
||
89 | $langHeader = get_language_header(); |
||
90 | |||
91 | $out =<<<EOQ |
||
92 | <!DOCTYPE HTML> |
||
93 | <html {$langHeader}> |
||
94 | <head> |
||
95 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
||
96 | <meta http-equiv="Content-Script-Type" content="text/javascript"> |
||
97 | <meta http-equiv="Content-Style-Type" content="text/css"> |
||
98 | <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_CONFIRM_TITLE']}</title> |
||
99 | <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico"> |
||
100 | <link rel="stylesheet" href="install/install.css" type="text/css" /> |
||
101 | <link rel="stylesheet" href="themes/Suite7/css/fontello.css"> |
||
102 | <link rel="stylesheet" href="themes/Suite7/css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/fontello-ie7.css"><![endif]--> |
||
103 | <link rel='stylesheet' type='text/css' href='include/javascript/yui/build/container/assets/container.css' /> |
||
104 | <script type="text/javascript" src="install/installCommon.js"></script> |
||
105 | <script type="text/javascript" src="install/siteConfig.js"></script> |
||
106 | </head> |
||
107 | <body onload="javascript:document.getElementById('button_next2').focus();"> |
||
108 | <!--SuiteCRM installer--> |
||
109 | <div id="install_container"> |
||
110 | <div id="install_box"> |
||
111 | <header id="install_header"> |
||
112 | <div id="steps"><p>{$mod_strings['LBL_STEP7']}</p><i class="icon-progress-0" id="complete"></i><i class="icon-progress-1" id="complete"></i><i class="icon-progress-2" id="complete"></i><i class="icon-progress-3" id="complete"></i><i class="icon-progress-4" id="complete"></i><i class="icon-progress-5" id="complete"></i><i class="icon-progress-6" id="complete"></i><i class="icon-progress-7"></i></div> |
||
113 | <div class="install_img"><a href="https://suitecrm.com"><img src="{$sugar_md}" alt="SuiteCRM"></a></div> |
||
114 | </header> |
||
115 | <form action="install.php" method="post" name="setConfig" id="form"> |
||
116 | <div id="install_content"> |
||
117 | <input type="hidden" name="current_step" value="{$next_step}"> |
||
118 | <input type="hidden" name="current_step" value="{$next_step}"> |
||
119 | <h2>{$mod_strings['LBL_CONFIRM_TITLE']}</h2> |
||
120 | <hr> |
||
121 | <div id="confsettings"> |
||
122 | <div class="dbcred"> |
||
123 | <h3>{$mod_strings['LBL_DBCONF_TITLE']}</h3> |
||
124 | <p><b>{$mod_strings['LBL_CONFIRM_DB_TYPE']}</b> {$_SESSION['setup_db_type']}</p> |
||
125 | <p><b>{$mod_strings['LBL_DBCONF_HOST_NAME']}</b> {$_SESSION['setup_db_host_name']}</p> |
||
126 | <p><b>{$mod_strings['LBL_DBCONF_DB_NAME']}</b> {$_SESSION['setup_db_database_name']} {$dbCreate}</p> |
||
127 | <p><b>{$mod_strings['LBL_DBCONF_DB_ADMIN_USER']}</b> {$_SESSION['setup_db_admin_user_name']}</p> |
||
128 | <p><b>{$mod_strings['LBL_DBCONF_DEMO_DATA']}</b> {$demoData}</p> |
||
129 | |||
130 | EOQ; |
||
131 | |||
132 | if($yesNoDropCreate){ |
||
133 | |||
134 | $out .=<<<EOQ |
||
135 | <p><b>{$mod_strings['LBL_DBCONF_DB_DROP']}</b> {$yesNoDropCreate}</p> |
||
136 | </div> |
||
137 | |||
138 | EOQ; |
||
139 | |||
140 | } |
||
141 | |||
142 | |||
143 | if(isset($_SESSION['install_type']) && !empty($_SESSION['install_type']) && $_SESSION['install_type']=='custom'){ |
||
144 | $out .=<<<EOQ |
||
145 | |||
146 | <div class="sitecred"> |
||
147 | <h3>{$mod_strings['LBL_SITECFG_TITLE']}</h3> |
||
148 | <p><b>{$mod_strings['LBL_SITECFG_URL']}</b> {$_SESSION['setup_site_url']}</p> |
||
149 | <h3 style='display:none'>{$mod_strings['LBL_SITECFG_SUGAR_UPDATES']}</h3> |
||
150 | <p style='display:none'><b>{$mod_strings['LBL_SITECFG_SUGAR_UP']}</b> {$yesNoSugarUpdates}</p> |
||
151 | <h3>{$mod_strings['LBL_SITECFG_SITE_SECURITY']}</h3> |
||
152 | <p><b>{$mod_strings['LBL_SITECFG_CUSTOM_SESSION']}?</b> {$yesNoCustomSession}</p> |
||
153 | <p><b>{$mod_strings['LBL_SITECFG_CUSTOM_LOG']}?</b> {$yesNoCustomLog}</p> |
||
154 | <p><b>{$mod_strings['LBL_SITECFG_CUSTOM_ID']}?</b> {$yesNoCustomId}</p> |
||
155 | </div> |
||
156 | EOQ; |
||
157 | } |
||
158 | |||
159 | $out .=<<<EOQ |
||
160 | |||
161 | <div class="sitecred"> |
||
162 | <h3>{$mod_strings['LBL_SYSTEM_CREDS']}</h3> |
||
163 | <p><b>{$mod_strings['LBL_DBCONF_DB_USER']}</b> {$_SESSION['setup_db_sugarsales_user']}</p> |
||
164 | <p><b>{$mod_strings['LBL_DBCONF_DB_PASSWORD']}</b> <span id='hide_db_admin_pass'>{$mod_strings['LBL_HIDDEN']}</span></p> |
||
165 | <p><span style='display:none' id='show_db_admin_pass'>{$_SESSION['setup_db_sugarsales_password']}</span></p> |
||
166 | <p><b>{$mod_strings['LBL_SITECFG_ADMIN_Name']}</b> Admin</p> |
||
167 | <p><b>{$mod_strings['LBL_SITECFG_ADMIN_PASS']}</b> <span id='hide_site_admin_pass'>{$mod_strings['LBL_HIDDEN']}</span></p> |
||
168 | <p><span style='display:none' id='show_site_admin_pass'>{$_SESSION['setup_site_admin_password']}</span></p> |
||
169 | </div> |
||
170 | |||
171 | EOQ; |
||
172 | |||
173 | $envString = ' |
||
174 | |||
175 | <h3>'.$mod_strings['LBL_SYSTEM_ENV'].'</h3>'; |
||
176 | |||
177 | // PHP VERSION |
||
178 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_PHPVER'].'</b> '.constant('PHP_VERSION').'</p>'; |
||
179 | |||
180 | |||
181 | //Begin List of already known good variables. These were checked during the initial sys check |
||
182 | // XML Parsing |
||
183 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_XML'].'</b> '.$mod_strings['LBL_CHECKSYS_OK'].'</p>'; |
||
184 | |||
185 | |||
186 | |||
187 | // mbstrings |
||
188 | |||
189 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_MBSTRING'].'</b> '.$mod_strings['LBL_CHECKSYS_OK'].'</p>'; |
||
190 | |||
191 | // config.php |
||
192 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_CONFIG'].'</b> '.$mod_strings['LBL_CHECKSYS_OK'].'</p>'; |
||
193 | |||
194 | // custom dir |
||
195 | |||
196 | |||
197 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_CUSTOM'].'</b> '.$mod_strings['LBL_CHECKSYS_OK'].'</p>'; |
||
198 | |||
199 | |||
200 | // modules dir |
||
201 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_MODULE'].'</b> '.$mod_strings['LBL_CHECKSYS_OK'].'</p'; |
||
202 | |||
203 | // upload dir |
||
204 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_UPLOAD'].'</b> '.$mod_strings['LBL_CHECKSYS_OK'].'</p>'; |
||
205 | |||
206 | // data dir |
||
207 | |||
208 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_DATA'].'</b> '.$mod_strings['LBL_CHECKSYS_OK'].'</p>'; |
||
209 | |||
210 | // cache dir |
||
211 | $error_found = true; |
||
212 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_CACHE'].'</b> '.$mod_strings['LBL_CHECKSYS_OK'].'</p>'; |
||
213 | // End already known to be good |
||
214 | |||
215 | // memory limit |
||
216 | $memory_msg = ""; |
||
217 | // CL - fix for 9183 (if memory_limit is enabled we will honor it and check it; otherwise use unlimited) |
||
218 | $memory_limit = ini_get('memory_limit'); |
||
219 | if(empty($memory_limit)){ |
||
220 | $memory_limit = "-1"; |
||
221 | } |
||
222 | if(!defined('SUGARCRM_MIN_MEM')) { |
||
223 | define('SUGARCRM_MIN_MEM', 40*1024*1024); |
||
224 | } |
||
225 | $sugarMinMem = constant('SUGARCRM_MIN_MEM'); |
||
226 | // logic based on: http://us2.php.net/manual/en/ini.core.php#ini.memory-limit |
||
227 | if( $memory_limit == "" ){ // memory_limit disabled at compile time, no memory limit |
||
228 | $memory_msg = "<b>{$mod_strings['LBL_CHECKSYS_MEM_OK']}</b>"; |
||
229 | } elseif( $memory_limit == "-1" ){ // memory_limit enabled, but set to unlimited |
||
230 | $memory_msg = "{$mod_strings['LBL_CHECKSYS_MEM_UNLIMITED']}"; |
||
231 | } else { |
||
232 | $mem_display = $memory_limit; |
||
233 | preg_match('/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $memory_limit, $matches); |
||
234 | $num = (float)$matches[1]; |
||
235 | // Don't break so that it falls through to the next case. |
||
236 | switch (strtoupper($matches[2])) { |
||
237 | case 'G': |
||
0 ignored issues
–
show
|
|||
238 | $num = $num * 1024; |
||
239 | case 'M': |
||
0 ignored issues
–
show
|
|||
240 | $num = $num * 1024; |
||
241 | case 'K': |
||
242 | $num = $num * 1024; |
||
243 | } |
||
244 | $memory_limit_int = intval($num); |
||
245 | $SUGARCRM_MIN_MEM = (int) constant('SUGARCRM_MIN_MEM'); |
||
246 | if( $memory_limit_int < constant('SUGARCRM_MIN_MEM') ){ |
||
247 | // Bug59667: The string ERR_CHECKSYS_MEM_LIMIT_2 already has 'M' in it, |
||
248 | // so we divide the constant by 1024*1024. |
||
249 | $min_mem_in_megs = constant('SUGARCRM_MIN_MEM')/(1024*1024); |
||
250 | $memory_msg = "<span class='stop'><b>$memory_limit{$mod_strings['ERR_CHECKSYS_MEM_LIMIT_1']}" . $min_mem_in_megs . "{$mod_strings['ERR_CHECKSYS_MEM_LIMIT_2']}</b></span>"; |
||
251 | $memory_msg = str_replace('$memory_limit', $mem_display, $memory_msg); |
||
252 | } else { |
||
253 | $memory_msg = "{$mod_strings['LBL_CHECKSYS_OK']} ({$memory_limit})"; |
||
254 | } |
||
255 | } |
||
256 | |||
257 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_MEM'].'</strong></b> '.$memory_msg.'</p>'; |
||
258 | |||
259 | // zlib |
||
260 | if(function_exists('gzclose')) { |
||
261 | $zlibStatus = "{$mod_strings['LBL_CHECKSYS_OK']}"; |
||
262 | } else { |
||
263 | $zlibStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_ZLIB']}</b></span>"; |
||
264 | } |
||
265 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_ZLIB'].'</b> '.$zlibStatus.'</p>'; |
||
266 | |||
267 | // zip |
||
268 | if(class_exists("ZipArchive")) { |
||
269 | $zipStatus = "{$mod_strings['LBL_CHECKSYS_OK']}"; |
||
270 | } else { |
||
271 | $zipStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_ZIP']}</b></span>"; |
||
272 | } |
||
273 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_ZIP'].'</b> '.$zipStatus.'</p>'; |
||
274 | |||
275 | // PCRE |
||
276 | if(defined('PCRE_VERSION')) { |
||
277 | if (version_compare(PCRE_VERSION, '7.0') < 0) { |
||
278 | $pcreStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_PCRE_VER']}</b></span>"; |
||
279 | } |
||
280 | else { |
||
281 | $pcreStatus = "{$mod_strings['LBL_CHECKSYS_OK']}"; |
||
282 | } |
||
283 | } else { |
||
284 | $pcreStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_PCRE']}</b></span>"; |
||
285 | } |
||
286 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_PCRE'].'</b> '.$pcreStatus.'</p>'; |
||
287 | |||
288 | // imap |
||
289 | if(function_exists('imap_open')) { |
||
290 | $imapStatus = "{$mod_strings['LBL_CHECKSYS_OK']}"; |
||
291 | } else { |
||
292 | $imapStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_IMAP']}</b></span>"; |
||
293 | } |
||
294 | |||
295 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_IMAP'].'</b> '.$imapStatus.'</p>'; |
||
296 | |||
297 | |||
298 | // cURL |
||
299 | if(function_exists('curl_init')) { |
||
300 | $curlStatus = "{$mod_strings['LBL_CHECKSYS_OK']}"; |
||
301 | } else { |
||
302 | $curlStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_CURL']}</b></span>"; |
||
303 | } |
||
304 | |||
305 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_CURL'].'</b> '.$curlStatus.'</p>'; |
||
306 | |||
307 | |||
308 | //CHECK UPLOAD FILE SIZE |
||
309 | $upload_max_filesize = ini_get('upload_max_filesize'); |
||
310 | $upload_max_filesize_bytes = return_bytes($upload_max_filesize); |
||
311 | if(!defined('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')){ |
||
312 | define('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES', 6 * 1024 * 1024); |
||
313 | } |
||
314 | |||
315 | if($upload_max_filesize_bytes > constant('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')) { |
||
316 | $fileMaxStatus = "{$mod_strings['LBL_CHECKSYS_OK']}</font>"; |
||
317 | } else { |
||
318 | $fileMaxStatus = "<span class='stop'><b>{$mod_strings['ERR_UPLOAD_MAX_FILESIZE']}</font></b></span>"; |
||
319 | } |
||
320 | |||
321 | $envString .='<p><b>'.$mod_strings['LBL_UPLOAD_MAX_FILESIZE_TITLE'].'</b> '.$fileMaxStatus.'</p>'; |
||
322 | |||
323 | //CHECK Sprite support |
||
324 | if(function_exists('imagecreatetruecolor')) |
||
325 | { |
||
326 | $spriteSupportStatus = "{$mod_strings['LBL_CHECKSYS_OK']}</font>"; |
||
327 | }else{ |
||
328 | $spriteSupportStatus = "<span class='stop'><b>{$mod_strings['ERROR_SPRITE_SUPPORT']}</b></span>"; |
||
329 | } |
||
330 | $envString .='<p><b>'.$mod_strings['LBL_SPRITE_SUPPORT'].'</b> '.$spriteSupportStatus.'</p>'; |
||
331 | |||
332 | // Suhosin allow to use upload:// |
||
333 | if (UploadStream::getSuhosinStatus() == true || (strpos(ini_get('suhosin.perdir'), 'e') !== false && strpos($_SERVER["SERVER_SOFTWARE"],'Microsoft-IIS') === false)) |
||
0 ignored issues
–
show
|
|||
334 | { |
||
335 | $suhosinStatus = "{$mod_strings['LBL_CHECKSYS_OK']}"; |
||
336 | } |
||
337 | else |
||
338 | { |
||
339 | $suhosinStatus = "<span class='stop'><b>{$app_strings['ERR_SUHOSIN']}</b></span>"; |
||
340 | } |
||
341 | $envString .= "<p><b>{$mod_strings['LBL_STREAM']} (" . UploadStream::STREAM_NAME . "://)</b> " . $suhosinStatus . "</p>"; |
||
342 | |||
343 | // PHP.ini |
||
344 | $phpIniLocation = get_cfg_var("cfg_file_path"); |
||
345 | $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_PHP_INI'].'</b> '.$phpIniLocation.'</p>'; |
||
346 | |||
347 | $out .=<<<EOQ |
||
348 | |||
349 | <div id="syscred"> |
||
350 | |||
351 | EOQ; |
||
352 | |||
353 | $out .= $envString; |
||
354 | |||
355 | $out .=<<<EOQ |
||
356 | |||
357 | </div> |
||
358 | EOQ; |
||
359 | |||
360 | |||
361 | // CRON Settings |
||
362 | if ( !isset($sugar_config['default_language']) ) |
||
363 | $sugar_config['default_language'] = $_SESSION['default_language']; |
||
364 | if ( !isset($sugar_config['cache_dir']) ) |
||
365 | $sugar_config['cache_dir'] = $sugar_config_defaults['cache_dir']; |
||
366 | if ( !isset($sugar_config['site_url']) ) |
||
367 | $sugar_config['site_url'] = $_SESSION['setup_site_url']; |
||
368 | if ( !isset($sugar_config['translation_string_prefix']) ) |
||
369 | $sugar_config['translation_string_prefix'] = $sugar_config_defaults['translation_string_prefix']; |
||
370 | $mod_strings_scheduler = return_module_language($GLOBALS['current_language'], 'Schedulers'); |
||
371 | $error = ''; |
||
372 | |||
373 | if (!isset($_SERVER['Path'])) { |
||
374 | $_SERVER['Path'] = getenv('Path'); |
||
375 | } |
||
376 | if(is_windows()) { |
||
377 | if(isset($_SERVER['Path']) && !empty($_SERVER['Path'])) { // IIS IUSR_xxx may not have access to Path or it is not set |
||
378 | if(!strpos($_SERVER['Path'], 'php')) { |
||
0 ignored issues
–
show
This
if statement is empty and can be removed.
This check looks for the bodies of These if (rand(1, 6) > 3) {
//print "Check failed";
} else {
print "Check succeeded";
}
could be turned into if (rand(1, 6) <= 3) {
print "Check succeeded";
}
This is much more concise to read. ![]() |
|||
379 | // $error = '<em>'.$mod_strings_scheduler['LBL_NO_PHP_CLI'].'</em>'; |
||
380 | } |
||
381 | } |
||
382 | $cronString = '<p><b>'.$mod_strings_scheduler['LBL_CRON_WINDOWS_DESC'].'</b><br> |
||
383 | cd '.realpath('./').'<br> |
||
384 | php.exe -f cron.php |
||
385 | <br>'.$error.'</p> |
||
386 | '; |
||
387 | } else { |
||
388 | if(isset($_SERVER['Path']) && !empty($_SERVER['Path'])) { // some Linux servers do not make this available |
||
389 | if(!strpos($_SERVER['PATH'], 'php')) { |
||
0 ignored issues
–
show
This
if statement is empty and can be removed.
This check looks for the bodies of These if (rand(1, 6) > 3) {
//print "Check failed";
} else {
print "Check succeeded";
}
could be turned into if (rand(1, 6) <= 3) {
print "Check succeeded";
}
This is much more concise to read. ![]() |
|||
390 | // $error = '<em>'.$mod_strings_scheduler['LBL_NO_PHP_CLI'].'</em>'; |
||
391 | } |
||
392 | } |
||
393 | $cronString = '<p><b>'.$mod_strings_scheduler['LBL_CRON_INSTRUCTIONS_LINUX'].'</b><br> '.$mod_strings_scheduler['LBL_CRON_LINUX_DESC'].'<br> |
||
394 | * * * * * |
||
395 | cd '.realpath('./').'; php -f cron.php > /dev/null 2>&1 |
||
396 | <br><br><hr><br>'.$error.'</p> |
||
397 | '; |
||
398 | } |
||
399 | |||
400 | $out .= $cronString; |
||
401 | |||
402 | $out .=<<<EOQ |
||
403 | <input type="button" class="button" name="print_summary" id="button_print_summary_settings" value="{$mod_strings['LBL_PRINT_SUMM']}" |
||
404 | onClick='window.print()' onCluck='window.open("install.php?current_step="+(document.setConfig.current_step.value -1)+"&goto={$mod_strings["LBL_NEXT"]}&print=true");' /> |
||
405 | <input type="button" class="button" id="show_pass_button" value="{$mod_strings['LBL_SHOW_PASS']}" |
||
406 | onClick='togglePass();' /> |
||
407 | <input type="hidden" name="goto" id="goto"> |
||
408 | </div> |
||
409 | </div> |
||
410 | <div id="installcontrols"> |
||
411 | <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();" /> |
||
412 | <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"/> |
||
413 | </div> |
||
414 | </form> |
||
415 | <br> |
||
416 | </div> |
||
417 | |||
418 | <footer id="install_footer"> |
||
419 | <p id="footer_links"><a href="https://suitecrm.com" target="_blank">Visit suitecrm.com</a> | <a href="https://suitecrm.com/index.php?option=com_kunena&view=category&Itemid=1137&layout=list" target="_blank">Support Forums</a> | <a href="https://suitecrm.com/wiki/index.php/Installation" target="_blank">Installation Guide</a> | <a href="LICENSE.txt" target="_blank">License</a> |
||
420 | </footer> |
||
421 | </div> |
||
422 | <script> |
||
423 | function togglePass(){ |
||
424 | if(document.getElementById('show_site_admin_pass').style.display == ''){ |
||
425 | document.getElementById('show_pass_button').value = "{$mod_strings['LBL_SHOW_PASS']}"; |
||
426 | document.getElementById('hide_site_admin_pass').style.display = ''; |
||
427 | document.getElementById('hide_db_admin_pass').style.display = ''; |
||
428 | document.getElementById('show_site_admin_pass').style.display = 'none'; |
||
429 | document.getElementById('show_db_admin_pass').style.display = 'none'; |
||
430 | |||
431 | }else{ |
||
432 | document.getElementById('show_pass_button').value = "{$mod_strings['LBL_HIDE_PASS']}"; |
||
433 | document.getElementById('show_site_admin_pass').style.display = ''; |
||
434 | document.getElementById('show_db_admin_pass').style.display = ''; |
||
435 | document.getElementById('hide_site_admin_pass').style.display = 'none'; |
||
436 | document.getElementById('hide_db_admin_pass').style.display = 'none'; |
||
437 | |||
438 | } |
||
439 | } |
||
440 | </script> |
||
441 | </body> |
||
442 | </html> |
||
443 | |||
444 | EOQ; |
||
445 | echo $out; |
||
446 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.