Completed
Push — master ( 24ce66...da2f36 )
by Adam
25:35
created
modules/AOR_Reports/aor_utils.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
             if ($_REQUEST['parameter_type'][$key] === 'Date') {
112 112
                 $values = array();
113 113
                 $values[] = $_REQUEST['parameter_value'][0];
114
-                $values[] = $_REQUEST['parameter_value'][1];;
115
-                $values[] = $_REQUEST['parameter_value'][2];;
116
-                $values[] = $_REQUEST['parameter_value'][3];;
114
+                $values[] = $_REQUEST['parameter_value'][1]; ;
115
+                $values[] = $_REQUEST['parameter_value'][2]; ;
116
+                $values[] = $_REQUEST['parameter_value'][3]; ;
117 117
 
118 118
                 $params[$parameterId] = array(
119 119
                     'id' => $parameterId,
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
     $offsetMonths -= 1;
393 393
     // Offset months
394 394
     if ($offsetMonths > 0) {
395
-        $q1start->add(new DateInterval('P' . $offsetMonths . 'M'));
395
+        $q1start->add(new DateInterval('P'.$offsetMonths.'M'));
396 396
     }
397 397
     $q1end = DateTime::createFromFormat(DATE_ISO8601, $q1start->format(DATE_ISO8601));
398 398
     $q1end->add(new DateInterval('P2M'));
Please login to merge, or discard this patch.
install.php 1 patch
Spacing   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
  * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
38 38
  * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
39 39
  */
40
- if(!defined('sugarEntry')) {
40
+ if (!defined('sugarEntry')) {
41 41
     define('sugarEntry', true);
42 42
 }
43 43
 
44 44
 require_once 'include/utils.php';
45 45
 @session_start();
46
-if(isset($_REQUEST['clear_session']) || !empty($_SESSION['loginAttempts'])) {
46
+if (isset($_REQUEST['clear_session']) || !empty($_SESSION['loginAttempts'])) {
47 47
     session_destroy();
48 48
     header('Location: install.php');
49 49
     echo 'session clean, page refresh...';
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 //  recover smtp settings
54
-if(isset($_POST['smtp_tab_selected'])) {
54
+if (isset($_POST['smtp_tab_selected'])) {
55 55
     $_POST = array_merge($_POST, $_POST[$_POST['smtp_tab_selected']]);
56 56
 }
57 57
 
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 	$msg .= constant('SUITECRM_PHP_MIN_VERSION').', ';
68 68
 	$msg .= 'is not recommended due to the large number of fixed bugs, including security fixes, ';
69 69
 	$msg .= 'released in the more modern versions.<br />';
70
- 	$msg .= 'You are using PHP version  '. constant('PHP_VERSION').', which is EOL: <a href="http://php.net/eol.php">http://php.net/eol.php</a>.<br />';
70
+ 	$msg .= 'You are using PHP version  '.constant('PHP_VERSION').', which is EOL: <a href="http://php.net/eol.php">http://php.net/eol.php</a>.<br />';
71 71
 	$msg .= 'Please consider upgrading your PHP version. Instructions on <a href="http://php.net/migration70">http://php.net/migration70</a>. ';
72 72
     die($msg);
73 73
 }
74 74
 
75 75
 $session_id = session_id();
76
-if(empty($session_id)){
76
+if (empty($session_id)) {
77 77
     @session_start();
78 78
 }
79 79
 $GLOBALS['installing'] = true;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 $silentInstall = true;
99 99
 
100 100
 //Todo, check if there is an instance where goto is not set, but a silent install is in place
101
-if(isset($_REQUEST['goto']) && $_REQUEST['goto'] != 'SilentInstall') {
101
+if (isset($_REQUEST['goto']) && $_REQUEST['goto'] != 'SilentInstall') {
102 102
     require_once('jssource/minify.php');
103 103
     $silentInstall = false;
104 104
 }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 setPhpIniSettings();
110 110
 $locale = new Localization();
111 111
 
112
-if(get_magic_quotes_gpc() == 1) {
112
+if (get_magic_quotes_gpc() == 1) {
113 113
     $_REQUEST = array_map("stripslashes_checkstrings", $_REQUEST);
114 114
     $_POST = array_map("stripslashes_checkstrings", $_POST);
115 115
     $_GET = array_map("stripslashes_checkstrings", $_GET);
@@ -130,16 +130,16 @@  discard block
 block discarded – undo
130 130
 
131 131
 ///////////////////////////////////////////////////////////////////////////////
132 132
 ////	INSTALLER LANGUAGE
133
-function getSupportedInstallLanguages(){
133
+function getSupportedInstallLanguages() {
134 134
     $supportedLanguages = array(
135 135
         'en_us'	=> 'English (US)',
136 136
     );
137
-    if(file_exists('install/lang.config.php')){
137
+    if (file_exists('install/lang.config.php')) {
138 138
         include('install/lang.config.php');
139
-        if(!empty($config['languages'])){
139
+        if (!empty($config['languages'])) {
140 140
 
141
-            foreach($config['languages'] as $k=>$v){
142
-                if(file_exists('install/language/' . $k . '.lang.php')){
141
+            foreach ($config['languages'] as $k=>$v) {
142
+                if (file_exists('install/language/'.$k.'.lang.php')) {
143 143
                     $supportedLanguages[$k] = $v;
144 144
                 }
145 145
             }
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
 
152 152
 // after install language is selected, use that pack
153 153
 $default_lang = 'en_us';
154
-if(!isset($_POST['language']) && (!isset($_SESSION['language']) && empty($_SESSION['language']))) {
155
-    if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
154
+if (!isset($_POST['language']) && (!isset($_SESSION['language']) && empty($_SESSION['language']))) {
155
+    if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
156 156
         $lang = parseAcceptLanguage();
157
-        if(isset($supportedLanguages[$lang])) {
157
+        if (isset($supportedLanguages[$lang])) {
158 158
             $_POST['language'] = $lang;
159 159
         } else {
160 160
             $_POST['language'] = $default_lang;
@@ -162,19 +162,19 @@  discard block
 block discarded – undo
162 162
     }
163 163
 }
164 164
 
165
-if(isset($_POST['language'])) {
166
-    $_SESSION['language'] = str_replace('-','_',$_POST['language']);
165
+if (isset($_POST['language'])) {
166
+    $_SESSION['language'] = str_replace('-', '_', $_POST['language']);
167 167
 }
168 168
 
169 169
 $current_language = isset($_SESSION['language']) ? $_SESSION['language'] : $default_lang;
170 170
 
171
-if(file_exists("install/language/{$current_language}.lang.php")) {
171
+if (file_exists("install/language/{$current_language}.lang.php")) {
172 172
     require_once("install/language/{$current_language}.lang.php");
173 173
 } else {
174 174
     require_once("install/language/{$default_lang}.lang.php");
175 175
 }
176 176
 
177
-if($current_language != 'en_us') {
177
+if ($current_language != 'en_us') {
178 178
     $my_mod_strings = $mod_strings;
179 179
     include('install/language/en_us.lang.php');
180 180
     $mod_strings = sugarLangArrayMerge($mod_strings, $my_mod_strings);
@@ -188,40 +188,40 @@  discard block
 block discarded – undo
188 188
 $help_url = get_help_button_url();
189 189
 
190 190
 //if this license print, then redirect and exit,
191
-if(isset($_REQUEST['page']) && $_REQUEST['page'] == 'licensePrint')
191
+if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'licensePrint')
192 192
 {
193 193
     include('install/licensePrint.php');
194 194
     exit ();
195 195
 }
196 196
 
197
-if(isset($_REQUEST['sugar_body_only']) && $_REQUEST['sugar_body_only'] == "1") {
197
+if (isset($_REQUEST['sugar_body_only']) && $_REQUEST['sugar_body_only'] == "1") {
198 198
     //if this is a system check, then just run the check and return,
199 199
     //this is an ajax call and there is no need for further processing
200 200
 
201
-    if(isset($_REQUEST['uploadLogoFrame']) && ($_REQUEST['uploadLogoFrame'])){
201
+    if (isset($_REQUEST['uploadLogoFrame']) && ($_REQUEST['uploadLogoFrame'])) {
202 202
         echo 'I\'m an uploader iframe!';
203 203
         return;
204 204
     }
205 205
 
206 206
     // upload company logo
207
-    if(isset($_REQUEST['uploadLogo']) && ($_REQUEST['uploadLogo'])){
207
+    if (isset($_REQUEST['uploadLogo']) && ($_REQUEST['uploadLogo'])) {
208 208
         $filepath = '';
209 209
         $errors = array();
210 210
 
211
-        switch($_FILES['company_logo']['error']) {
211
+        switch ($_FILES['company_logo']['error']) {
212 212
 
213 213
             case UPLOAD_ERR_OK:
214 214
                 $allowedTypes = array(IMAGETYPE_PNG, IMAGETYPE_JPEG/*, IMAGETYPE_GIF */);
215 215
                 $detectedType = exif_imagetype($_FILES['company_logo']['tmp_name']);
216
-                if(!in_array($detectedType, $allowedTypes)) {
216
+                if (!in_array($detectedType, $allowedTypes)) {
217 217
                     $errors[] = $mod_strings['ERR_UPLOAD_FILETYPE'];
218 218
                 }
219 219
                 else {
220 220
                     // uploaded image stored in the /custom path instead of put into the original theme directory..
221 221
 
222
-                    mkdir_recursive('custom/' . SugarThemeRegistry::current()->getDefaultImagePath(), true);
222
+                    mkdir_recursive('custom/'.SugarThemeRegistry::current()->getDefaultImagePath(), true);
223 223
                     $tmpvar = explode('?', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
224
-                    $destFile = 'custom/' . $tmpvar[0];
224
+                    $destFile = 'custom/'.$tmpvar[0];
225 225
                     if (!move_uploaded_file($_FILES['company_logo']['tmp_name'], $destFile)) {
226 226
                         $errors[] = $mod_strings['ERR_LANG_UPLOAD_1'];
227 227
                     }
@@ -269,13 +269,13 @@  discard block
 block discarded – undo
269 269
 
270 270
         // TODO--low: validate file size & image width/height and save, show status result to client js
271 271
 
272
-        echo "<script>window.top.window.{$_REQUEST['callback']}(" . json_encode($result) . ");</script>";
272
+        echo "<script>window.top.window.{$_REQUEST['callback']}(".json_encode($result).");</script>";
273 273
         return;
274 274
     }
275 275
 
276
-    if(isset($_REQUEST['storeConfig']) && ($_REQUEST['storeConfig'])){
276
+    if (isset($_REQUEST['storeConfig']) && ($_REQUEST['storeConfig'])) {
277 277
         // store configuration by form to session
278
-        if(!isset($_SESSION)) session_start();
278
+        if (!isset($_SESSION)) session_start();
279 279
         $_SESSION = array_merge($_SESSION, $_POST);
280 280
 
281 281
         // TODO--low: don't forget the custom type install settings! validate here..
@@ -289,22 +289,22 @@  discard block
 block discarded – undo
289 289
 //            $si_errors = true;
290 290
 //        }
291 291
 
292
-        if(!empty($sugar_config['dbconfig'])) {
292
+        if (!empty($sugar_config['dbconfig'])) {
293 293
             try {
294 294
                 $db = DBManagerFactory::getInstance();
295 295
                 $db->disconnect();
296
-            } catch (\Exception $e) {
297
-                $validation_errors[] = $mod_strings['LBL_DB_CONN_ERR'] . ': ' . $e->getMessage();
296
+            }catch (\Exception $e) {
297
+                $validation_errors[] = $mod_strings['LBL_DB_CONN_ERR'].': '.$e->getMessage();
298 298
             }
299 299
         }
300 300
 
301 301
         $errors = '';
302
-        if( isset($validation_errors) && is_array($validation_errors)){
303
-            if( count($validation_errors) > 0 ){
302
+        if (isset($validation_errors) && is_array($validation_errors)) {
303
+            if (count($validation_errors) > 0) {
304 304
                 // $errors  = '<div id="errorMsgs">';
305 305
                 $errors .= '<p>'.$mod_strings['LBL_SITECFG_FIX_ERRORS'].'</p><ul>';
306
-                foreach( $validation_errors as $error ){
307
-                    $errors .= '<li class="error">' . $error . '</li>';
306
+                foreach ($validation_errors as $error) {
307
+                    $errors .= '<li class="error">'.$error.'</li>';
308 308
                 }
309 309
                 $errors .= '</ul>'; //</div>';
310 310
             }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
         return;
315 315
     }
316 316
 
317
-    if(isset($_REQUEST['checkInstallSystem']) && ($_REQUEST['checkInstallSystem'])){
317
+    if (isset($_REQUEST['checkInstallSystem']) && ($_REQUEST['checkInstallSystem'])) {
318 318
         require_once('install/installSystemCheck.php');
319 319
         echo runCheck($install_script, $mod_strings);
320 320
         return;
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 
323 323
     //if this is a DB Settings check, then just run the check and return,
324 324
     //this is an ajax call and there is no need for further processing
325
-    if(isset($_REQUEST['checkDBSettings']) && ($_REQUEST['checkDBSettings'])){
325
+    if (isset($_REQUEST['checkDBSettings']) && ($_REQUEST['checkDBSettings'])) {
326 326
         require_once('install/checkDBSettings.php');
327 327
         echo checkDBSettings();
328 328
         return;
@@ -330,13 +330,13 @@  discard block
 block discarded – undo
330 330
 }
331 331
 
332 332
 //maintaining the install_type if earlier set to custom
333
-if(isset($_REQUEST['install_type']) && $_REQUEST['install_type'] == 'custom'){
333
+if (isset($_REQUEST['install_type']) && $_REQUEST['install_type'] == 'custom') {
334 334
     $_SESSION['install_type'] = $_REQUEST['install_type'];
335 335
 }
336 336
 
337 337
 //set the default settings into session
338
-foreach($installer_defaults as $key =>$val){
339
-    if(!isset($_SESSION[$key])){
338
+foreach ($installer_defaults as $key =>$val) {
339
+    if (!isset($_SESSION[$key])) {
340 340
         $_SESSION[$key] = $val;
341 341
     }
342 342
 }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 $next_clicked = false;
348 348
 $next_step = 0;
349 349
 
350
-$workflow = array() ;
350
+$workflow = array();
351 351
 // If less then recommended PHP version, insert old_php.pho into workflow.
352 352
 if (check_php_version() === 0) {
353 353
 	$workflow[] = 'old_php.php';
@@ -366,9 +366,9 @@  discard block
 block discarded – undo
366 366
 //$workflow[] = 'dbConfig_b.php';
367 367
 
368 368
 //define web root, which will be used as default for site_url
369
-if($_SERVER['SERVER_PORT']=='80'){
369
+if ($_SERVER['SERVER_PORT'] == '80') {
370 370
     $web_root = $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
371
-}else{
371
+} else {
372 372
     $web_root = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['PHP_SELF'];
373 373
 }
374 374
 $web_root = str_replace("/install.php", "", $web_root);
@@ -386,16 +386,16 @@  discard block
 block discarded – undo
386 386
     }
387 387
 }
388 388
 
389
-if(empty($sugar_config['cache_dir']) && !empty($_SESSION['cache_dir'])) {
389
+if (empty($sugar_config['cache_dir']) && !empty($_SESSION['cache_dir'])) {
390 390
     $sugar_config['cache_dir'] = $_SESSION['cache_dir'];
391 391
 }
392 392
 
393 393
 // set the form's php var to the loaded config's var else default to sane settings
394
-if(!isset($_SESSION['setup_site_url'])  || empty($_SESSION['setup_site_url'])) {
395
-    if(isset($sugar_config['site_url']) && !empty($sugar_config['site_url'])) {
396
-        $_SESSION['setup_site_url']= $sugar_config['site_url'];
394
+if (!isset($_SESSION['setup_site_url']) || empty($_SESSION['setup_site_url'])) {
395
+    if (isset($sugar_config['site_url']) && !empty($sugar_config['site_url'])) {
396
+        $_SESSION['setup_site_url'] = $sugar_config['site_url'];
397 397
     } else {
398
-        $_SESSION['setup_site_url']= $web_root;
398
+        $_SESSION['setup_site_url'] = $web_root;
399 399
     }
400 400
 }
401 401
 
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
 //$workflow[] = 'confirmSettings.php';
419 419
 $workflow[] = 'performSetup.php';
420 420
 
421
-if(!isset($_SESSION['oc_install']) ||  $_SESSION['oc_install'] == false){
422
-    if(isset($_SESSION['install_type'])  && !empty($_SESSION['install_type'])  && $_SESSION['install_type']=='custom'){
421
+if (!isset($_SESSION['oc_install']) || $_SESSION['oc_install'] == false) {
422
+    if (isset($_SESSION['install_type']) && !empty($_SESSION['install_type']) && $_SESSION['install_type'] == 'custom') {
423 423
         //$workflow[] = 'download_patches.php';
424 424
         $workflow[] = 'download_modules.php';
425 425
     }
@@ -430,8 +430,8 @@  discard block
 block discarded – undo
430 430
 
431 431
 
432 432
 // increment/decrement the workflow pointer
433
-if(!empty($_REQUEST['goto'])) {
434
-    switch($_REQUEST['goto']) {
433
+if (!empty($_REQUEST['goto'])) {
434
+    switch ($_REQUEST['goto']) {
435 435
         case $mod_strings['LBL_CHECKSYS_RECHECK']:
436 436
             $next_step = $_REQUEST['current_step'];
437 437
             break;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
     }
454 454
 }
455 455
 // Add check here to see if a silent install config file exists; if so then launch silent installer
456
-elseif ( is_file('config_si.php') && empty($sugar_config['installer_locked'])) {
456
+elseif (is_file('config_si.php') && empty($sugar_config['installer_locked'])) {
457 457
 
458 458
     $langHeader = get_language_header();
459 459
 
@@ -498,13 +498,13 @@  discard block
 block discarded – undo
498 498
 
499 499
 
500 500
 
501
-$exclude_files = array('complete_install.php','register.php','download_modules.php');
501
+$exclude_files = array('complete_install.php', 'register.php', 'download_modules.php');
502 502
 
503
-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) {
503
+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) {
504 504
     $the_file = 'installDisabled.php';
505 505
     $disabled_title = $mod_strings['LBL_DISABLED_DESCRIPTION'];
506 506
     $disabled_title_2 = $mod_strings['LBL_DISABLED_TITLE_2'];
507
-    $disabled_text =<<<EOQ
507
+    $disabled_text = <<<EOQ
508 508
 		<p>{$mod_strings['LBL_DISABLED_DESCRIPTION']}</p>
509 509
 		<pre>
510 510
 			'installer_locked' => false,
@@ -514,12 +514,12 @@  discard block
 block discarded – undo
514 514
 		<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>
515 515
 EOQ;
516 516
 }
517
-else{
517
+else {
518 518
     $validation_errors = array();
519 519
 // process the data posted
520
-if($next_clicked) {
520
+if ($next_clicked) {
521 521
 	// store the submitted data because the 'Next' button was clicked
522
-    switch($workflow[trim($_REQUEST['current_step'])]) {
522
+    switch ($workflow[trim($_REQUEST['current_step'])]) {
523 523
         case 'old_php.php':
524 524
 		$_SESSION['language'] = $_REQUEST['language'];
525 525
 		$_SESSION['setup_old_php'] = get_boolean_from_request('setup_old_php');
@@ -535,25 +535,25 @@  discard block
 block discarded – undo
535 535
 
536 536
 
537 537
                 // eventually default all vars here, with overrides from config.php
538
-                if(is_readable('config.php')) {
538
+                if (is_readable('config.php')) {
539 539
                     global $sugar_config;
540 540
                     include_once('config.php');
541 541
                 }
542 542
 
543 543
                 $default_db_type = 'mysql';
544 544
 
545
-                if(!isset($_SESSION['setup_db_type'])) {
545
+                if (!isset($_SESSION['setup_db_type'])) {
546 546
                     $_SESSION['setup_db_type'] = empty($sugar_config['dbconfig']['db_type']) ? $default_db_type : $sugar_config['dbconfig']['db_type'];
547 547
                 }
548 548
 
549 549
                 break;
550 550
             //TODO--low: add this functionality to installConfig.php
551 551
             case 'installType.php':
552
-                $_SESSION['install_type']   = $_REQUEST['install_type'];
553
-                if(isset($_REQUEST['setup_license_key']) && !empty($_REQUEST['setup_license_key'])){
554
-                    $_SESSION['setup_license_key']  = $_REQUEST['setup_license_key'];
552
+                $_SESSION['install_type'] = $_REQUEST['install_type'];
553
+                if (isset($_REQUEST['setup_license_key']) && !empty($_REQUEST['setup_license_key'])) {
554
+                    $_SESSION['setup_license_key'] = $_REQUEST['setup_license_key'];
555 555
                 }
556
-                $_SESSION['licenseKey_submitted']      = true;
556
+                $_SESSION['licenseKey_submitted'] = true;
557 557
 
558 558
 
559 559
 
@@ -562,39 +562,39 @@  discard block
 block discarded – undo
562 562
             case 'installConfig.php':
563 563
 
564 564
                 //case 'systemOptions.php':
565
-                if(isset($_REQUEST['setup_db_type'])) {
565
+                if (isset($_REQUEST['setup_db_type'])) {
566 566
                     $_SESSION['setup_db_type'] = $_REQUEST['setup_db_type'];
567 567
                 }
568 568
                 $validation_errors = validate_systemOptions();
569
-                if(count($validation_errors) > 0) {
569
+                if (count($validation_errors) > 0) {
570 570
                     $next_step--;
571 571
                 }
572 572
                 //break;
573 573
 
574 574
                 //case 'dbConfig_a.php':
575 575
                 //validation is now done through ajax call to checkDBSettings.php
576
-                if(isset($_REQUEST['setup_db_drop_tables'])){
576
+                if (isset($_REQUEST['setup_db_drop_tables'])) {
577 577
                     $_SESSION['setup_db_drop_tables'] = $_REQUEST['setup_db_drop_tables'];
578
-                    if($_SESSION['setup_db_drop_tables']=== true || $_SESSION['setup_db_drop_tables'] == 'true'){
578
+                    if ($_SESSION['setup_db_drop_tables'] === true || $_SESSION['setup_db_drop_tables'] == 'true') {
579 579
                         $_SESSION['setup_db_create_database'] = false;
580 580
                     }
581 581
                 }
582 582
                 //break;
583 583
 
584 584
                 //case 'siteConfig_a.php':
585
-                if(isset($_REQUEST['setup_site_url'])){$_SESSION['setup_site_url']          = $_REQUEST['setup_site_url'];}
586
-                if(isset($_REQUEST['setup_system_name'])){$_SESSION['setup_system_name']    = $_REQUEST['setup_system_name'];}
587
-                if(isset($_REQUEST['setup_db_collation'])) {
585
+                if (isset($_REQUEST['setup_site_url'])) {$_SESSION['setup_site_url']          = $_REQUEST['setup_site_url']; }
586
+                if (isset($_REQUEST['setup_system_name'])) {$_SESSION['setup_system_name']    = $_REQUEST['setup_system_name']; }
587
+                if (isset($_REQUEST['setup_db_collation'])) {
588 588
                     $_SESSION['setup_db_options']['collation'] = $_REQUEST['setup_db_collation'];
589 589
                 }
590 590
                 $_SESSION['setup_site_admin_user_name']             = $_REQUEST['setup_site_admin_user_name'];
591 591
                 $_SESSION['setup_site_admin_password']              = $_REQUEST['setup_site_admin_password'];
592 592
                 $_SESSION['setup_site_admin_password_retype']       = $_REQUEST['setup_site_admin_password_retype'];
593
-                $_SESSION['siteConfig_submitted']               = true;
593
+                $_SESSION['siteConfig_submitted'] = true;
594 594
 
595 595
                 $validation_errors = array();
596 596
                 $validation_errors = validate_siteConfig('a');
597
-                if(count($validation_errors) > 0 || $_REQUEST['goto'] == 'resend') {
597
+                if (count($validation_errors) > 0 || $_REQUEST['goto'] == 'resend') {
598 598
                     $next_step--;
599 599
                 }
600 600
                 //break;
@@ -602,56 +602,56 @@  discard block
 block discarded – undo
602 602
                 //case 'siteConfig_b.php':
603 603
                 $_SESSION['setup_site_sugarbeet_automatic_checks'] = get_boolean_from_request('setup_site_sugarbeet_automatic_checks');
604 604
 
605
-                $_SESSION['setup_site_custom_session_path']     = get_boolean_from_request('setup_site_custom_session_path');
606
-                if($_SESSION['setup_site_custom_session_path']){
607
-                    $_SESSION['setup_site_session_path']            = $_REQUEST['setup_site_session_path'];
608
-                }else{
605
+                $_SESSION['setup_site_custom_session_path'] = get_boolean_from_request('setup_site_custom_session_path');
606
+                if ($_SESSION['setup_site_custom_session_path']) {
607
+                    $_SESSION['setup_site_session_path'] = $_REQUEST['setup_site_session_path'];
608
+                } else {
609 609
                     $_SESSION['setup_site_session_path'] = '';
610 610
                 }
611 611
 
612
-                $_SESSION['setup_site_custom_log_dir']          = get_boolean_from_request('setup_site_custom_log_dir');
613
-                if($_SESSION['setup_site_custom_log_dir']){
614
-                    $_SESSION['setup_site_log_dir']                 = $_REQUEST['setup_site_log_dir'];
615
-                }else{
612
+                $_SESSION['setup_site_custom_log_dir'] = get_boolean_from_request('setup_site_custom_log_dir');
613
+                if ($_SESSION['setup_site_custom_log_dir']) {
614
+                    $_SESSION['setup_site_log_dir'] = $_REQUEST['setup_site_log_dir'];
615
+                } else {
616 616
                     $_SESSION['setup_site_log_dir'] = '.';
617 617
                 }
618 618
 
619
-                $_SESSION['setup_site_specify_guid']            = get_boolean_from_request('setup_site_specify_guid');
620
-                if($_SESSION['setup_site_specify_guid']){
621
-                    $_SESSION['setup_site_guid']                    = $_REQUEST['setup_site_guid'];
622
-                }else{
619
+                $_SESSION['setup_site_specify_guid'] = get_boolean_from_request('setup_site_specify_guid');
620
+                if ($_SESSION['setup_site_specify_guid']) {
621
+                    $_SESSION['setup_site_guid'] = $_REQUEST['setup_site_guid'];
622
+                } else {
623 623
                     $_SESSION['setup_site_guid'] = '';
624 624
                 }
625
-                $_SESSION['siteConfig_submitted']               = true;
626
-                if(isset($_REQUEST['setup_site_sugarbeet_anonymous_stats'])){
625
+                $_SESSION['siteConfig_submitted'] = true;
626
+                if (isset($_REQUEST['setup_site_sugarbeet_anonymous_stats'])) {
627 627
                     $_SESSION['setup_site_sugarbeet_anonymous_stats'] = get_boolean_from_request('setup_site_sugarbeet_anonymous_stats');
628
-                }else{
628
+                } else {
629 629
                     $_SESSION['setup_site_sugarbeet_anonymous_stats'] = 0;
630 630
                 }
631 631
 
632 632
                 $validation_errors = array();
633 633
                 $validation_errors = validate_siteConfig('b');
634
-                if(count($validation_errors) > 0) {
634
+                if (count($validation_errors) > 0) {
635 635
                     $next_step--;
636 636
                 }
637 637
                 break;
638 638
         }
639 639
     }
640 640
 
641
-    if($next_step == 9999) {
641
+    if ($next_step == 9999) {
642 642
         $the_file = 'SilentInstall';
643
-    }else if($next_step == 9191) {
644
-        $_SESSION['oc_server_url']	= $_REQUEST['oc_server_url'];
643
+    } else if ($next_step == 9191) {
644
+        $_SESSION['oc_server_url'] = $_REQUEST['oc_server_url'];
645 645
         $_SESSION['oc_username']    = $_REQUEST['oc_username'];
646 646
         $_SESSION['oc_password']   	= $_REQUEST['oc_password'];
647 647
         $the_file = 'oc_convert.php';
648 648
     }
649
-    else{
649
+    else {
650 650
         $the_file = $workflow[$next_step];
651 651
 
652 652
     }
653 653
 
654
-switch($the_file) {
654
+switch ($the_file) {
655 655
     case 'old_php.php':
656 656
     case 'welcome.php':
657 657
     case 'license.php':
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 			unset($_SESSION['test_session']);
664 664
         @session_start();
665 665
 
666
-            if(!isset($_SESSION['test_session']))
666
+            if (!isset($_SESSION['test_session']))
667 667
             {
668 668
                 $the_file = 'installDisabled.php';
669 669
                 // PHP.ini location -
@@ -674,14 +674,14 @@  discard block
 block discarded – undo
674 674
                 break;
675 675
             }
676 676
             // check to see if installer has been disabled
677
-            if(is_readable('config.php') && (filesize('config.php') > 0)) {
677
+            if (is_readable('config.php') && (filesize('config.php') > 0)) {
678 678
                 include_once('config.php');
679 679
 
680
-                if(!isset($sugar_config['installer_locked']) || $sugar_config['installer_locked'] == true) {
680
+                if (!isset($sugar_config['installer_locked']) || $sugar_config['installer_locked'] == true) {
681 681
                     $the_file = 'installDisabled.php';
682 682
                     $disabled_title = $mod_strings['LBL_DISABLED_DESCRIPTION'];
683 683
                     $disabled_title_2 = $mod_strings['LBL_DISABLED_TITLE_2'];
684
-                    $disabled_text =<<<EOQ
684
+                    $disabled_text = <<<EOQ
685 685
 					<p>{$mod_strings['LBL_DISABLED_DESCRIPTION']}</p>
686 686
 					<pre>
687 687
 						'installer_locked' => false,
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 EOQ;
693 693
                     //if this is an offline client installation but the conversion did not succeed,
694 694
                     //then try to convert again
695
-                    if(isset($sugar_config['disc_client']) && $sugar_config['disc_client'] == true && isset($sugar_config['oc_converted']) && $sugar_config['oc_converted'] == false) {
695
+                    if (isset($sugar_config['disc_client']) && $sugar_config['disc_client'] == true && isset($sugar_config['oc_converted']) && $sugar_config['oc_converted'] == false) {
696 696
                         header('Location: index.php?entryPoint=oc_convert&first_time=true');
697 697
                         exit ();
698 698
                     }
@@ -722,22 +722,22 @@  discard block
 block discarded – undo
722 722
             }
723 723
 
724 724
             $validation_errors = validate_dbConfig('a');
725
-            if(count($validation_errors) > 0) {
725
+            if (count($validation_errors) > 0) {
726 726
                 $the_file = 'dbConfig_a.php';
727 727
                 $si_errors = true;
728 728
             }
729 729
             $validation_errors = validate_siteConfig('a');
730
-            if(count($validation_errors) > 0) {
730
+            if (count($validation_errors) > 0) {
731 731
                 $the_file = 'siteConfig_a.php';
732 732
                 $si_errors = true;
733 733
             }
734 734
             $validation_errors = validate_siteConfig('b');
735
-            if(count($validation_errors) > 0) {
735
+            if (count($validation_errors) > 0) {
736 736
                 $the_file = 'siteConfig_b.php';
737 737
                 $si_errors = true;
738 738
             }
739 739
 
740
-            if(!$si_errors){
740
+            if (!$si_errors) {
741 741
                 $the_file = 'performSetup.php';
742 742
             }
743 743
             require_once('jssource/minify.php');
@@ -770,13 +770,13 @@  discard block
 block discarded – undo
770 770
             // check whether we're getting this request from a command line tool
771 771
             // we want to output brief messages if we're outputting to a command line tool
772 772
             $cli_mode = false;
773
-            if(isset($_REQUEST['cli']) && ($_REQUEST['cli'] == 'true')) {
773
+            if (isset($_REQUEST['cli']) && ($_REQUEST['cli'] == 'true')) {
774 774
                 $_SESSION['cli'] = true;
775 775
                 // if we have errors, just shoot them back now
776
-                if(count($validation_errors) > 0) {
777
-                    foreach($validation_errors as $error) {
776
+                if (count($validation_errors) > 0) {
777
+                    foreach ($validation_errors as $error) {
778 778
                         print($mod_strings['ERR_ERROR_GENERAL']."\n");
779
-                        print("    " . $error . "\n");
779
+                        print("    ".$error."\n");
780 780
                         print("Exit 1\n");
781 781
                         exit(1);
782 782
                     }
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 
794 794
 // change to require to get a good file load error message if the file is not available.
795 795
 
796
-require('install/' . $the_file);
796
+require('install/'.$the_file);
797 797
 
798 798
 installerHook('post_installFileRequire', array('the_file' => $the_file));
799 799
 
Please login to merge, or discard this patch.