@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -243,8 +245,9 @@ discard block |
||
243 | 245 | $focus = new $bean(); |
244 | 246 | } |
245 | 247 | |
246 | - if ( $bean == 'Configurator' ) |
|
247 | - continue; |
|
248 | + if ( $bean == 'Configurator' ) { |
|
249 | + continue; |
|
250 | + } |
|
248 | 251 | |
249 | 252 | $table_name = $focus->table_name; |
250 | 253 | //installStatus(sprintf($mod_strings['STAT_CREATE_DB_TABLE'], $focus->table_name )); |
@@ -278,8 +281,9 @@ discard block |
||
278 | 281 | if( $bean == "User" ){ |
279 | 282 | $new_tables = 1; |
280 | 283 | } |
281 | - if($bean == "Administration") |
|
282 | - $new_config = 1; |
|
284 | + if($bean == "Administration") { |
|
285 | + $new_config = 1; |
|
286 | + } |
|
283 | 287 | |
284 | 288 | |
285 | 289 | } |
@@ -441,8 +445,9 @@ discard block |
||
441 | 445 | } |
442 | 446 | if ($fp && (!isset($_SESSION['oc_install']) || $_SESSION['oc_install'] == false)) { |
443 | 447 | @fclose($fp); |
444 | - if ($next_step == 9999) |
|
445 | - $next_step = 8; |
|
448 | + if ($next_step == 9999) { |
|
449 | + $next_step = 8; |
|
450 | + } |
|
446 | 451 | $fpResult = <<<FP |
447 | 452 | <form action="install.php" method="post" name="form" id="form"> |
448 | 453 | <input type="hidden" name="current_step" value="{$next_step}"> |
@@ -460,7 +465,7 @@ discard block |
||
460 | 465 | |
461 | 466 | if( isset($_SESSION['setup_site_sugarbeet_automatic_checks']) && $_SESSION['setup_site_sugarbeet_automatic_checks'] == true){ |
462 | 467 | set_CheckUpdates_config_setting('automatic'); |
463 | - }else{ |
|
468 | + } else{ |
|
464 | 469 | set_CheckUpdates_config_setting('manual'); |
465 | 470 | } |
466 | 471 | if(!empty($_SESSION['setup_system_name'])){ |
@@ -591,10 +596,18 @@ discard block |
||
591 | 596 | |
592 | 597 | installLog('handleOverride'); |
593 | 598 | // add local settings to config overrides |
594 | -if(!empty($_SESSION['default_date_format'])) $sugar_config['default_date_format'] = $_SESSION['default_date_format']; |
|
595 | -if(!empty($_SESSION['default_time_format'])) $sugar_config['default_date_format'] = $_SESSION['default_time_format']; |
|
596 | -if(!empty($_SESSION['default_language'])) $sugar_config['default_language'] = $_SESSION['default_language']; |
|
597 | -if(!empty($_SESSION['default_locale_name_format'])) $sugar_config['default_locale_name_format'] = $_SESSION['default_locale_name_format']; |
|
599 | +if(!empty($_SESSION['default_date_format'])) { |
|
600 | + $sugar_config['default_date_format'] = $_SESSION['default_date_format']; |
|
601 | +} |
|
602 | +if(!empty($_SESSION['default_time_format'])) { |
|
603 | + $sugar_config['default_date_format'] = $_SESSION['default_time_format']; |
|
604 | +} |
|
605 | +if(!empty($_SESSION['default_language'])) { |
|
606 | + $sugar_config['default_language'] = $_SESSION['default_language']; |
|
607 | +} |
|
608 | +if(!empty($_SESSION['default_locale_name_format'])) { |
|
609 | + $sugar_config['default_locale_name_format'] = $_SESSION['default_locale_name_format']; |
|
610 | +} |
|
598 | 611 | //$configurator->handleOverride(); |
599 | 612 | |
600 | 613 | |
@@ -675,7 +688,9 @@ discard block |
||
675 | 688 | |
676 | 689 | // restore superglobals and vars |
677 | 690 | $GLOBALS = $varStack['GLOBALS']; |
678 | -foreach($varStack['defined_vars'] as $__key => $__value) $$__key = $__value; |
|
691 | +foreach($varStack['defined_vars'] as $__key => $__value) { |
|
692 | + $$__key = $__value; |
|
693 | +} |
|
679 | 694 | |
680 | 695 | |
681 | 696 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -89,7 +91,9 @@ discard block |
||
89 | 91 | $out = "<select name=\"$name\">"; |
90 | 92 | foreach($options as $key => $value) { |
91 | 93 | $selected = ''; |
92 | - if($key==$default) $selected = ' selected="selected"'; |
|
94 | + if($key==$default) { |
|
95 | + $selected = ' selected="selected"'; |
|
96 | + } |
|
93 | 97 | $out .= "<option label=\"$value\" value=\"$key\"$selected>$value</option>"; |
94 | 98 | } |
95 | 99 | $out .= "</select>"; |
@@ -275,8 +279,7 @@ discard block |
||
275 | 279 | if(!empty($value)) { |
276 | 280 | if(!empty($value['required'])) { |
277 | 281 | $form .= "<span class=\"required\">*</span>"; |
278 | - } |
|
279 | - else { |
|
282 | + } else { |
|
280 | 283 | } |
281 | 284 | if(!empty($_SESSION[$name])) { |
282 | 285 | $sessval = $_SESSION[$name]; |
@@ -295,7 +298,7 @@ discard block |
||
295 | 298 | //if the type is password, set a hidden field to capture the value. This is so that we can properly encode special characters, which is a limitation with password fields |
296 | 299 | if($type=='password'){ |
297 | 300 | $form .= "</div><div class=\"install_block\"><label>{$mod_strings['LBL_DBCONF_TITLE_PSWD_INFO_LABEL']}</label><span> </span><input type='$type' name='{$name}_entry' id='{$name}_entry' value='".urldecode($sessval)."'><input type='hidden' name='$name' id='$name' value='".urldecode($sessval)."'></div><div class=\"install_block\">"; |
298 | - }else{ |
|
301 | + } else{ |
|
299 | 302 | $form .= "<input type='$type' name='$name' id='$name' value='$sessval'>"; |
300 | 303 | } |
301 | 304 | |
@@ -559,7 +562,9 @@ discard block |
||
559 | 562 | $notify_allow_default_outbound_checked = empty($_SESSION['notify_allow_default_outbound']) ? '' : ' checked="checked" '; |
560 | 563 | |
561 | 564 | // set default smtp toggle buttons selected value |
562 | - if(empty($_SESSION['smtp_tab_selected'])) $_SESSION['smtp_tab_selected'] = 'smtp_tab_other'; |
|
565 | + if(empty($_SESSION['smtp_tab_selected'])) { |
|
566 | + $_SESSION['smtp_tab_selected'] = 'smtp_tab_other'; |
|
567 | + } |
|
563 | 568 | |
564 | 569 | $out .= <<<EOQ |
565 | 570 | <div class="floatbox full" id="fb2"> |
@@ -1705,28 +1710,37 @@ discard block |
||
1705 | 1710 | |
1706 | 1711 | |
1707 | 1712 | if( is_file("config.php") ){ |
1708 | - if(!empty($sugar_config['default_theme'])) |
|
1709 | - $_SESSION['site_default_theme'] = $sugar_config['default_theme']; |
|
1713 | + if(!empty($sugar_config['default_theme'])) { |
|
1714 | + $_SESSION['site_default_theme'] = $sugar_config['default_theme']; |
|
1715 | + } |
|
1710 | 1716 | |
1711 | - if(!empty($sugar_config['disable_persistent_connections'])) |
|
1712 | - $_SESSION['disable_persistent_connections'] = |
|
1717 | + if(!empty($sugar_config['disable_persistent_connections'])) { |
|
1718 | + $_SESSION['disable_persistent_connections'] = |
|
1713 | 1719 | $sugar_config['disable_persistent_connections']; |
1714 | - if(!empty($sugar_config['default_language'])) |
|
1715 | - $_SESSION['default_language'] = $sugar_config['default_language']; |
|
1716 | - if(!empty($sugar_config['translation_string_prefix'])) |
|
1717 | - $_SESSION['translation_string_prefix'] = $sugar_config['translation_string_prefix']; |
|
1718 | - if(!empty($sugar_config['default_charset'])) |
|
1719 | - $_SESSION['default_charset'] = $sugar_config['default_charset']; |
|
1720 | - |
|
1721 | - if(!empty($sugar_config['default_currency_name'])) |
|
1722 | - $_SESSION['default_currency_name'] = $sugar_config['default_currency_name']; |
|
1723 | - if(!empty($sugar_config['default_currency_symbol'])) |
|
1724 | - $_SESSION['default_currency_symbol'] = $sugar_config['default_currency_symbol']; |
|
1725 | - if(!empty($sugar_config['default_currency_iso4217'])) |
|
1726 | - $_SESSION['default_currency_iso4217'] = $sugar_config['default_currency_iso4217']; |
|
1727 | - |
|
1728 | - if(!empty($sugar_config['rss_cache_time'])) |
|
1729 | - $_SESSION['rss_cache_time'] = $sugar_config['rss_cache_time']; |
|
1720 | + } |
|
1721 | + if(!empty($sugar_config['default_language'])) { |
|
1722 | + $_SESSION['default_language'] = $sugar_config['default_language']; |
|
1723 | + } |
|
1724 | + if(!empty($sugar_config['translation_string_prefix'])) { |
|
1725 | + $_SESSION['translation_string_prefix'] = $sugar_config['translation_string_prefix']; |
|
1726 | + } |
|
1727 | + if(!empty($sugar_config['default_charset'])) { |
|
1728 | + $_SESSION['default_charset'] = $sugar_config['default_charset']; |
|
1729 | + } |
|
1730 | + |
|
1731 | + if(!empty($sugar_config['default_currency_name'])) { |
|
1732 | + $_SESSION['default_currency_name'] = $sugar_config['default_currency_name']; |
|
1733 | + } |
|
1734 | + if(!empty($sugar_config['default_currency_symbol'])) { |
|
1735 | + $_SESSION['default_currency_symbol'] = $sugar_config['default_currency_symbol']; |
|
1736 | + } |
|
1737 | + if(!empty($sugar_config['default_currency_iso4217'])) { |
|
1738 | + $_SESSION['default_currency_iso4217'] = $sugar_config['default_currency_iso4217']; |
|
1739 | + } |
|
1740 | + |
|
1741 | + if(!empty($sugar_config['rss_cache_time'])) { |
|
1742 | + $_SESSION['rss_cache_time'] = $sugar_config['rss_cache_time']; |
|
1743 | + } |
|
1730 | 1744 | if(!empty($sugar_config['languages'])) |
1731 | 1745 | { |
1732 | 1746 | // We need to encode the languages in a way that can be retrieved later. |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if(!empty($name_value_list)){ |
74 | 74 | $name_value_list = PackageManager::fromNameValueList($name_value_list); |
75 | 75 | return $name_value_list['description']; |
76 | - }else { |
|
76 | + } else { |
|
77 | 77 | return ''; |
78 | 78 | } |
79 | 79 | } |
@@ -119,8 +119,9 @@ discard block |
||
119 | 119 | //check to see if we already this one installed |
120 | 120 | $result = $uh->determineIfUpgrade($myrelease['id_name'], $myrelease['version']); |
121 | 121 | $enable = false; |
122 | - if($result == true || is_array($result)) |
|
123 | - $enable = true; |
|
122 | + if($result == true || is_array($result)) { |
|
123 | + $enable = true; |
|
124 | + } |
|
124 | 125 | $nodes[$mypack['category_id']]['packages'][$mypack['id']]['releases'][$myrelease['id']] = array('id' => $myrelease['id'], 'version' => $myrelease['version'], 'label' => $myrelease['description'], 'category_id' => $mypack['category_id'], 'package_id' => $mypack['id'], 'type' => 'release', 'enable' => $enable); |
125 | 126 | } |
126 | 127 | } |
@@ -198,7 +199,7 @@ discard block |
||
198 | 199 | $filepath = PackageManagerComm::performDownload($filename); |
199 | 200 | return $filepath; |
200 | 201 | } |
201 | - }else{ |
|
202 | + } else{ |
|
202 | 203 | return null; |
203 | 204 | } |
204 | 205 | } |
@@ -216,10 +217,11 @@ discard block |
||
216 | 217 | PackageManager::setCredentials($username, $password, $systemname); |
217 | 218 | PackageManagerComm::clearSession(); |
218 | 219 | $result = PackageManagerComm::login($terms_checked); |
219 | - if(is_array($result)) |
|
220 | - return $result; |
|
221 | - else |
|
222 | - return true; |
|
220 | + if(is_array($result)) { |
|
221 | + return $result; |
|
222 | + } else { |
|
223 | + return true; |
|
224 | + } |
|
223 | 225 | } |
224 | 226 | |
225 | 227 | function setCredentials($username, $password, $systemname){ |
@@ -270,7 +272,7 @@ discard block |
||
270 | 272 | if(!empty($release_id) || !empty($package_id)){ |
271 | 273 | $documents = PackageManagerComm::getDocumentation($package_id, $release_id); |
272 | 274 | return $documents; |
273 | - }else{ |
|
275 | + } else{ |
|
274 | 276 | return null; |
275 | 277 | } |
276 | 278 | } |
@@ -465,8 +467,9 @@ discard block |
||
465 | 467 | $base_tmp_upgrade_dir = "$base_upgrade_dir/temp"; |
466 | 468 | $manifest_file = $this->extractManifest( $base_filename,$base_tmp_upgrade_dir); |
467 | 469 | $GLOBALS['log']->debug("Manifest: ".$manifest_file); |
468 | - if($view == 'module') |
|
469 | - $license_file = $this->extractFile($base_filename, 'LICENSE.txt', $base_tmp_upgrade_dir); |
|
470 | + if($view == 'module') { |
|
471 | + $license_file = $this->extractFile($base_filename, 'LICENSE.txt', $base_tmp_upgrade_dir); |
|
472 | + } |
|
470 | 473 | if(is_file($manifest_file)){ |
471 | 474 | $GLOBALS['log']->debug("VALIDATING MANIFEST". $manifest_file); |
472 | 475 | require_once( $manifest_file ); |
@@ -477,14 +480,16 @@ discard block |
||
477 | 480 | if( $view == "module" ){ |
478 | 481 | if ($upgrade_zip_type != "module" && $upgrade_zip_type != "theme" && $upgrade_zip_type != "langpack"){ |
479 | 482 | $this->unlinkTempFiles(); |
480 | - if($display_messages) |
|
481 | - die($mod_strings['ERR_UW_NOT_ACCEPTIBLE_TYPE']); |
|
483 | + if($display_messages) { |
|
484 | + die($mod_strings['ERR_UW_NOT_ACCEPTIBLE_TYPE']); |
|
485 | + } |
|
482 | 486 | } |
483 | - }elseif( $view == "default" ){ |
|
487 | + } elseif( $view == "default" ){ |
|
484 | 488 | if($upgrade_zip_type != "patch" ){ |
485 | 489 | $this->unlinkTempFiles(); |
486 | - if($display_messages) |
|
487 | - die($mod_strings['ERR_UW_ONLY_PATCHES']); |
|
490 | + if($display_messages) { |
|
491 | + die($mod_strings['ERR_UW_ONLY_PATCHES']); |
|
492 | + } |
|
488 | 493 | } |
489 | 494 | } |
490 | 495 | |
@@ -502,20 +507,24 @@ discard block |
||
502 | 507 | |
503 | 508 | if( copy( $tempFile , $target_path ) ){ |
504 | 509 | copy( $manifest_file, $target_manifest ); |
505 | - if($display_messages) |
|
506 | - $messages = '<script>ajaxStatus.flashStatus("' .$base_filename.$mod_strings['LBL_UW_UPLOAD_SUCCESS'] . ', 5000");</script>'; |
|
507 | - }else{ |
|
508 | - if($display_messages) |
|
509 | - $messages = '<script>ajaxStatus.flashStatus("' .$mod_strings['ERR_UW_UPLOAD_ERROR'] . ', 5000");</script>'; |
|
510 | + if($display_messages) { |
|
511 | + $messages = '<script>ajaxStatus.flashStatus("' .$base_filename.$mod_strings['LBL_UW_UPLOAD_SUCCESS'] . ', 5000");</script>'; |
|
512 | + } |
|
513 | + } else{ |
|
514 | + if($display_messages) { |
|
515 | + $messages = '<script>ajaxStatus.flashStatus("' .$mod_strings['ERR_UW_UPLOAD_ERROR'] . ', 5000");</script>'; |
|
516 | + } |
|
510 | 517 | } |
511 | 518 | }//fi |
512 | 519 | else{ |
513 | 520 | $this->unlinkTempFiles(); |
514 | - if($display_messages) |
|
515 | - die($mod_strings['ERR_UW_NO_MANIFEST']); |
|
521 | + if($display_messages) { |
|
522 | + die($mod_strings['ERR_UW_NO_MANIFEST']); |
|
523 | + } |
|
524 | + } |
|
525 | + if(isset($messages)) { |
|
526 | + return $messages; |
|
516 | 527 | } |
517 | - if(isset($messages)) |
|
518 | - return $messages; |
|
519 | 528 | } |
520 | 529 | |
521 | 530 | function unlinkTempFiles() { |
@@ -553,14 +562,15 @@ discard block |
||
553 | 562 | $version = $manifest['version']; |
554 | 563 | $uh = new UpgradeHistory(); |
555 | 564 | $previous_install = array(); |
556 | - if(!empty($id_name) & !empty($version)) |
|
557 | - $previous_install = $uh->determineIfUpgrade($id_name, $version); |
|
565 | + if(!empty($id_name) & !empty($version)) { |
|
566 | + $previous_install = $uh->determineIfUpgrade($id_name, $version); |
|
567 | + } |
|
558 | 568 | $previous_version = (empty($previous_install['version'])) ? '' : $previous_install['version']; |
559 | 569 | $previous_id = (empty($previous_install['id'])) ? '' : $previous_install['id']; |
560 | 570 | |
561 | 571 | if(!empty($previous_version)){ |
562 | 572 | $mi->install($unzip_dir, true, $previous_version); |
563 | - }else{ |
|
573 | + } else{ |
|
564 | 574 | $mi->install($unzip_dir); |
565 | 575 | } |
566 | 576 | $GLOBALS['log']->debug("INSTALLED: ".$file); |
@@ -597,7 +607,9 @@ discard block |
||
597 | 607 | $base_upgrade_dir = $this->upload_dir.'/upgrades'; |
598 | 608 | $base_tmp_upgrade_dir = "$base_upgrade_dir/temp"; |
599 | 609 | if(is_file($found->filename)){ |
600 | - if(!isset($GLOBALS['mi_remove_tables']))$GLOBALS['mi_remove_tables'] = true; |
|
610 | + if(!isset($GLOBALS['mi_remove_tables'])) { |
|
611 | + $GLOBALS['mi_remove_tables'] = true; |
|
612 | + } |
|
601 | 613 | $unzip_dir = mk_temp_dir( $base_tmp_upgrade_dir ); |
602 | 614 | unzip($found->filename, $unzip_dir ); |
603 | 615 | $mi = new ModuleInstaller(); |
@@ -606,7 +618,7 @@ discard block |
||
606 | 618 | $found->delete(); |
607 | 619 | unlink(remove_file_extension( $found->filename ) . '-manifest.php'); |
608 | 620 | unlink($found->filename); |
609 | - }else{ |
|
621 | + } else{ |
|
610 | 622 | //file(s_ have been deleted or are not found in the directory, allow database delete to happen but no need to change filesystem |
611 | 623 | $found->delete(); |
612 | 624 | } |
@@ -752,7 +764,7 @@ discard block |
||
752 | 764 | if(is_file($license_file)){ |
753 | 765 | $contents = file_get_contents($license_file); |
754 | 766 | return $contents; |
755 | - }else{ |
|
767 | + } else{ |
|
756 | 768 | return null; |
757 | 769 | } |
758 | 770 | } |
@@ -834,7 +846,7 @@ discard block |
||
834 | 846 | $serial_manifest['upgrade_manifest'] = (isset($upgrade_manifest) ? $upgrade_manifest : ''); |
835 | 847 | $installed->manifest = base64_encode(serialize($serial_manifest)); |
836 | 848 | $installed->save(); |
837 | - }else{ |
|
849 | + } else{ |
|
838 | 850 | $serial_manifest = unserialize(base64_decode($installed->manifest)); |
839 | 851 | $manifest = $serial_manifest['manifest']; |
840 | 852 | } |
@@ -844,8 +856,9 @@ discard block |
||
844 | 856 | $uninstallable = true; |
845 | 857 | } |
846 | 858 | $enabled = $installed->enabled; |
847 | - if(!$enabled) |
|
848 | - $enabled_string = 'DISABLED'; |
|
859 | + if(!$enabled) { |
|
860 | + $enabled_string = 'DISABLED'; |
|
861 | + } |
|
849 | 862 | $file_uninstall = $filename; |
850 | 863 | if(!$uninstallable){ |
851 | 864 | $file_uninstall = 'UNINSTALLABLE'; |
@@ -86,8 +86,9 @@ discard block |
||
86 | 86 | |
87 | 87 | $form2 = "<table class='tabForm' width='100%' cellpadding='0' cellspacing='0' width='100%' border='0'>"; |
88 | 88 | $form2 .= $error_html; |
89 | - if(!$isAlive) |
|
90 | - $form2 .= "<tr><td><span id='span_display_html'>".$header_text."</span></td></tr>"; |
|
89 | + if(!$isAlive) { |
|
90 | + $form2 .= "<tr><td><span id='span_display_html'>".$header_text."</span></td></tr>"; |
|
91 | + } |
|
91 | 92 | $form2 .= "</table>"; |
92 | 93 | |
93 | 94 | $tree = null; |
@@ -101,14 +102,14 @@ discard block |
||
101 | 102 | $form2 .= "<tr><td></td><td align='left'>"; |
102 | 103 | if($isAlive){ |
103 | 104 | $form2 .= "<input type='button' id='modifCredentialsBtn' class='button' onClick='PackageManager.showLoginDialog(true);' value='".$mod_strings['LBL_MODIFY_CREDENTIALS']."'>"; |
104 | - }else{ |
|
105 | + } else{ |
|
105 | 106 | $form2 .= "<input type='button' id='modifCredentialsBtn' class='button' onClick='PackageManager.showLoginDialog(true);' value='".$mod_strings['LBL_MODIFY_CREDENTIALS']."'style='display:none;'>"; |
106 | 107 | } |
107 | 108 | $form2 .= "</td><td align='left'><div id='workingStatusDiv' style='display:none;'>".SugarThemeRegistry::current()->getImage("sqsWait","border='0' align='bottom'",null,null,'.gif',"Loading")."</div></td><td align='right'>"; |
108 | 109 | |
109 | 110 | if($isAlive){ |
110 | 111 | $form2 .= "<slot><a class=\"listViewTdToolsS1\" id='href_animate' onClick=\"PackageManager.toggleDiv('span_animate_server_div', 'catview');\"><span id='span_animate_server_div'><img src='".SugarThemeRegistry::current()->getImageURL('basic_search.gif')."' width='8' height='8' border='0'> Collapse</span></a></slot>"; |
111 | - }else{ |
|
112 | + } else{ |
|
112 | 113 | $form2 .= "<slot><a class=\"listViewTdToolsS1\" id='href_animate' onClick=\"PackageManager.toggleDiv('span_animate_server_div', 'catview');\"><span id='span_animate_server_div' style='display:none;'><img src='".SugarThemeRegistry::current()->getImageURL('basic_search.gif')."' width='8' height='8' border='0'> Collapse</span></a></slot>"; |
113 | 114 | } |
114 | 115 | $form2 .= "</td></tr></table>"; |
@@ -123,8 +124,7 @@ discard block |
||
123 | 124 | if (UploadStream::getSuhosinStatus() == false) |
124 | 125 | { |
125 | 126 | $ss->assign('ERR_SUHOSIN', true); |
126 | - } |
|
127 | - else |
|
127 | + } else |
|
128 | 128 | { |
129 | 129 | $ss->assign('scripts', PackageManagerDisplay::getDisplayScript($install)); |
130 | 130 | } |
@@ -168,8 +168,9 @@ discard block |
||
168 | 168 | $display = 'block'; |
169 | 169 | //} |
170 | 170 | $form2 = "<table class='tabForm' width='100%' cellpadding='0' cellspacing='0' width='100%' border='0'>"; |
171 | - if(!$isAlive) |
|
172 | - $form2 .= "<tr><td><span id='span_display_html'>".$header_text."</span></td></tr>"; |
|
171 | + if(!$isAlive) { |
|
172 | + $form2 .= "<tr><td><span id='span_display_html'>".$header_text."</span></td></tr>"; |
|
173 | + } |
|
173 | 174 | $form2 .= "</table>"; |
174 | 175 | $form2 .= "<table width='100%'><tr><td align='left'>"; |
175 | 176 | if($show_login){ |
@@ -182,8 +183,9 @@ discard block |
||
182 | 183 | $form2 .= "<div id='selectView' style='display:".$selectViewStyle."'>"; |
183 | 184 | $form2 .= " <div id='patch_downloads' class='ygrid-mso' style='height:205px; display: ".$display.";'></div>"; |
184 | 185 | $form2 .= "</div>"; |
185 | - if(!$show_login) |
|
186 | - $loginViewStyle = 'none'; |
|
186 | + if(!$show_login) { |
|
187 | + $loginViewStyle = 'none'; |
|
188 | + } |
|
187 | 189 | //$form2 .= "<div id='loginView' style='display:".$loginViewStyle."'>"; |
188 | 190 | //$form2 .= PackageManagerDisplay::buildLoginPanel($mod_strings, $isAlive); |
189 | 191 | //$form2 .= "</div>"; |
@@ -199,8 +201,9 @@ discard block |
||
199 | 201 | $type_str = '"'; |
200 | 202 | foreach($types as $type){ |
201 | 203 | $type_str .= "'".$type."'"; |
202 | - if($index < $count) |
|
203 | - $type_str .= ","; |
|
204 | + if($index < $count) { |
|
205 | + $type_str .= ","; |
|
206 | + } |
|
204 | 207 | $index++; |
205 | 208 | } |
206 | 209 | $type_str .= '"'; |
@@ -286,8 +289,9 @@ discard block |
||
286 | 289 | $output .= "</td></tr></table>"; |
287 | 290 | // } |
288 | 291 | $output .= "</div>"; |
289 | - if(!$show_login) |
|
290 | - $loginViewStyle = 'none'; |
|
292 | + if(!$show_login) { |
|
293 | + $loginViewStyle = 'none'; |
|
294 | + } |
|
291 | 295 | // $output .= "<div id='loginView' style='display:".$loginViewStyle."'>"; |
292 | 296 | // jchi ,#24296 :commented code because we are currently not using depot, in the future this may change so you can put this code back in. |
293 | 297 | //$output .= PackageManagerDisplay::buildLoginPanel($mod_strings, $display); |
@@ -307,8 +311,9 @@ discard block |
||
307 | 311 | static function buildTreeView($div_id, $isAlive = true){ |
308 | 312 | $tree = new Tree($div_id); |
309 | 313 | $nodes = array(); |
310 | - if($isAlive) |
|
311 | - $nodes = PackageManager::getCategories(''); |
|
314 | + if($isAlive) { |
|
315 | + $nodes = PackageManager::getCategories(''); |
|
316 | + } |
|
312 | 317 | |
313 | 318 | foreach($nodes as $arr_node){ |
314 | 319 | $node = new Node($arr_node['id'], $arr_node['label']); |
@@ -399,7 +404,7 @@ discard block |
||
399 | 404 | $patches = PackageManagerDisplay::createJavascriptPackageArray($releases); |
400 | 405 | $ss->assign('PATCHES', $patches); |
401 | 406 | $ss->assign('GRID_TYPE', implode(',', $types)); |
402 | - }else{ |
|
407 | + } else{ |
|
403 | 408 | $pm = new PackageManager(); |
404 | 409 | $releases = $pm->getPackagesInStaging(); |
405 | 410 | $patches = PackageManagerDisplay::createJavascriptModuleArray($releases); |
@@ -410,8 +415,9 @@ discard block |
||
410 | 415 | $ss->assign('UPGARDE_WIZARD_URL', 'index.php?module=UpgradeWizard&action=index'); |
411 | 416 | $ss->assign('module_load', 'true'); |
412 | 417 | } |
413 | - if(!empty($GLOBALS['ML_STATUS_MESSAGE'])) |
|
414 | - $ss->assign('ML_STATUS_MESSAGE',$GLOBALS['ML_STATUS_MESSAGE']); |
|
418 | + if(!empty($GLOBALS['ML_STATUS_MESSAGE'])) { |
|
419 | + $ss->assign('ML_STATUS_MESSAGE',$GLOBALS['ML_STATUS_MESSAGE']); |
|
420 | + } |
|
415 | 421 | |
416 | 422 | //Bug 24064. Checking and Defining labels since these might not be cached during Upgrade |
417 | 423 | if(!isset($mod_strings['LBL_ML_INSTALL']) || empty($mod_strings['LBL_ML_INSTALL'])){ |
@@ -467,8 +473,9 @@ discard block |
||
467 | 473 | $output .= "["; |
468 | 474 | $output .= "'".$release['description']."', '".$release['version']."', '".$release['build_number']."', '".$release['id']."'"; |
469 | 475 | $output .= "]"; |
470 | - if($index < $count) |
|
471 | - $output .= ","; |
|
476 | + if($index < $count) { |
|
477 | + $output .= ","; |
|
478 | + } |
|
472 | 479 | $index++; |
473 | 480 | } |
474 | 481 | } |
@@ -484,13 +491,15 @@ discard block |
||
484 | 491 | foreach($modules as $module){ |
485 | 492 | $output .= "["; |
486 | 493 | $output .= "'".$module['name']."', '".$module['file_install']."', '".$module['file']."', '"; |
487 | - if(!empty($module['enabled'])) |
|
488 | - $output .= $module['enabled'].'_'.$module['file']."', '"; |
|
494 | + if(!empty($module['enabled'])) { |
|
495 | + $output .= $module['enabled'].'_'.$module['file']."', '"; |
|
496 | + } |
|
489 | 497 | |
490 | 498 | $description = js_escape($module['description']); |
491 | 499 | $output .= $module['type']."', '".$module['version']."', '".$module['published_date']."', '".$module['uninstallable']."', '".$description."'".(isset($module['upload_file'])?" , '".$module['upload_file']."']":"]"); |
492 | - if($index < $count) |
|
493 | - $output .= ","; |
|
500 | + if($index < $count) { |
|
501 | + $output .= ","; |
|
502 | + } |
|
494 | 503 | $index++; |
495 | 504 | } |
496 | 505 | |
@@ -529,16 +538,15 @@ discard block |
||
529 | 538 | if(!function_exists('curl_init') && $show_login){ |
530 | 539 | $header_text = "<font color='red'><b>".$mod_strings['ERR_ENABLE_CURL']."</b></font>"; |
531 | 540 | $show_login = false; |
532 | - }else{ |
|
541 | + } else{ |
|
533 | 542 | $credentials = PackageManager::getCredentials(); |
534 | 543 | if(empty($credentials['username']) || empty($credentials['password'])){ |
535 | 544 | //$header_text = "<font color='red'><b>".$mod_strings['ERR_CREDENTIALS_MISSING']."</b></font>"; |
536 | - } |
|
537 | - else{ |
|
545 | + } else{ |
|
538 | 546 | $result = PackageManagerComm::login(); |
539 | 547 | if((is_array($result) && !empty($result['faultcode'])) || $result == false){ |
540 | 548 | $header_text = "<font color='red'><b>".$result['faultstring']."</b></font>"; |
541 | - }else{ |
|
549 | + } else{ |
|
542 | 550 | $header_text = PackageManager::getPromotion(); |
543 | 551 | $isAlive = true; |
544 | 552 | } |
@@ -576,8 +584,7 @@ discard block |
||
576 | 584 | && is_file($filename) && !empty($manifest['is_uninstallable'])) |
577 | 585 | { |
578 | 586 | $link = urlencode( $filename ); |
579 | - } |
|
580 | - else |
|
587 | + } else |
|
581 | 588 | { |
582 | 589 | $link = 'false'; |
583 | 590 | } |
@@ -607,8 +614,7 @@ discard block |
||
607 | 614 | $manifest_copy_files_from_dir = isset($manifest['copy_files']['from_dir']) ? clean_path($manifest['copy_files']['from_dir']) : ""; |
608 | 615 | $manifest_icon = clean_path($manifest['icon']); |
609 | 616 | $icon = "<img src=\"" . $manifest_copy_files_to_dir . ($manifest_copy_files_from_dir != "" ? substr($manifest_icon, strlen($manifest_copy_files_from_dir)+1) : $manifest_icon ) . "\">"; |
610 | - } |
|
611 | - else |
|
617 | + } else |
|
612 | 618 | { |
613 | 619 | $icon = getImageForType( $manifest['type'] ); |
614 | 620 | } |
@@ -109,8 +109,9 @@ discard block |
||
109 | 109 | $type_str = ''; |
110 | 110 | foreach($types as $type){ |
111 | 111 | $type_str .= "'".$type."'"; |
112 | - if($index < $count) |
|
113 | - $type_str .= ","; |
|
112 | + if($index < $count) { |
|
113 | + $type_str .= ","; |
|
114 | + } |
|
114 | 115 | $index++; |
115 | 116 | } |
116 | 117 | |
@@ -295,18 +296,20 @@ discard block |
||
295 | 296 | } |
296 | 297 | if(isset($_REQUEST['terms_checked'])) { |
297 | 298 | $terms_checked = $_REQUEST['terms_checked']; |
298 | - if($terms_checked == 'on') |
|
299 | - $terms_checked = true; |
|
299 | + if($terms_checked == 'on') { |
|
300 | + $terms_checked = true; |
|
301 | + } |
|
300 | 302 | } |
301 | 303 | |
302 | 304 | if(!empty($username) && !empty($password)){ |
303 | 305 | $password = md5($password); |
304 | 306 | $result = PackageManager::authenticate($username, $password, $servername, $terms_checked); |
305 | - if(!is_array($result) && $result == true) |
|
306 | - $status = 'success'; |
|
307 | - else |
|
308 | - $status = $result['faultstring']; |
|
309 | - }else{ |
|
307 | + if(!is_array($result) && $result == true) { |
|
308 | + $status = 'success'; |
|
309 | + } else { |
|
310 | + $status = $result['faultstring']; |
|
311 | + } |
|
312 | + } else{ |
|
310 | 313 | $status = 'failed'; |
311 | 314 | } |
312 | 315 |
@@ -107,25 +107,29 @@ discard block |
||
107 | 107 | require('sugar_version.php'); |
108 | 108 | require('config.php'); |
109 | 109 | $credentials = PackageManager::getCredentials(); |
110 | - if(empty($license))loadLicense(); |
|
110 | + if(empty($license)) { |
|
111 | + loadLicense(); |
|
112 | + } |
|
111 | 113 | $info = sugarEncode('2813', serialize(getSystemInfo(true))); |
112 | 114 | $pm = new PackageManager(); |
113 | 115 | $installed = $pm->buildInstalledReleases(); |
114 | 116 | $installed = base64_encode(serialize($installed)); |
115 | 117 | $params = array('installed_modules' => $installed, 'terms_checked' => $terms_checked, 'system_name' => $credentials['system_name']); |
116 | 118 | $terms_version = (!empty($_SESSION['SugarDepot_TermsVersion']) ? $_SESSION['SugarDepot_TermsVersion'] : ''); |
117 | - if(!empty($terms_version)) |
|
118 | - $params['terms_version'] = $terms_version; |
|
119 | + if(!empty($terms_version)) { |
|
120 | + $params['terms_version'] = $terms_version; |
|
121 | + } |
|
119 | 122 | |
120 | 123 | $result = $GLOBALS['SugarDepot']->call('depotLogin', array(array('user_name' => $credentials['username'], 'password' => $credentials['password']),'info'=>$info, 'params' => $params)); |
121 | 124 | PackageManagerComm::errorCheck(); |
122 | - if(!is_array($result)) |
|
123 | - $_SESSION['SugarDepotSessionID'] = $result; |
|
125 | + if(!is_array($result)) { |
|
126 | + $_SESSION['SugarDepotSessionID'] = $result; |
|
127 | + } |
|
124 | 128 | $GLOBALS['log']->debug("End SugarDepot Login"); |
125 | 129 | return $result; |
130 | + } else { |
|
131 | + return $_SESSION['SugarDepotSessionID']; |
|
126 | 132 | } |
127 | - else |
|
128 | - return $_SESSION['SugarDepotSessionID']; |
|
129 | 133 | } |
130 | 134 | |
131 | 135 | /** |
@@ -301,7 +305,7 @@ discard block |
||
301 | 305 | $status = $GLOBALS['SugarDepot']->call('sugarPing', array()); |
302 | 306 | if(empty($status) || $GLOBALS['SugarDepot']->getError() || $status != ACTIVE_STATUS){ |
303 | 307 | return false; |
304 | - }else{ |
|
308 | + } else{ |
|
305 | 309 | return true; |
306 | 310 | } |
307 | 311 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | - if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | + if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | + } |
|
3 | 5 | |
4 | 6 | $suitecrm_version = '7.5.1'; |
5 | 7 | $suitecrm_timestamp = '2015-01-26 17:00'; |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!defined('sugarEntry'))define('sugarEntry', true); |
|
3 | -/********************************************************************************* |
|
2 | + if(!defined('sugarEntry')) { |
|
3 | + define('sugarEntry', true); |
|
4 | + } |
|
5 | + /********************************************************************************* |
|
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
6 | 8 | |
@@ -193,8 +195,7 @@ discard block |
||
193 | 195 | $detectedType = exif_imagetype($_FILES['company_logo']['tmp_name']); |
194 | 196 | if(!in_array($detectedType, $allowedTypes)) { |
195 | 197 | $errors[] = $mod_strings['ERR_UPLOAD_FILETYPE']; |
196 | - } |
|
197 | - else { |
|
198 | + } else { |
|
198 | 199 | // uploaded image stored in the /custom path instead of put into the original theme directory.. |
199 | 200 | |
200 | 201 | mkdir_recursive('custom/' . SugarThemeRegistry::current()->getDefaultImagePath(), true); |
@@ -202,8 +203,7 @@ discard block |
||
202 | 203 | $destFile = 'custom/' . $tmpvar[0]; |
203 | 204 | if (!move_uploaded_file($_FILES['company_logo']['tmp_name'], $destFile)) { |
204 | 205 | $errors[] = $mod_strings['ERR_LANG_UPLOAD_1']; |
205 | - } |
|
206 | - else { |
|
206 | + } else { |
|
207 | 207 | $filepath = $destFile; |
208 | 208 | } |
209 | 209 | } |
@@ -253,7 +253,9 @@ discard block |
||
253 | 253 | |
254 | 254 | if(isset($_REQUEST['storeConfig']) && ($_REQUEST['storeConfig'])){ |
255 | 255 | // store configuration by form to session |
256 | - if(!isset($_SESSION)) session_start(); |
|
256 | + if(!isset($_SESSION)) { |
|
257 | + session_start(); |
|
258 | + } |
|
257 | 259 | $_SESSION = array_merge($_SESSION, $_POST); |
258 | 260 | |
259 | 261 | // TODO--low: don't forget the custom type install settings! validate here.. |
@@ -330,7 +332,7 @@ discard block |
||
330 | 332 | //define web root, which will be used as default for site_url |
331 | 333 | if($_SERVER['SERVER_PORT']=='80'){ |
332 | 334 | $web_root = $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; |
333 | -}else{ |
|
335 | +} else{ |
|
334 | 336 | $web_root = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['PHP_SELF']; |
335 | 337 | } |
336 | 338 | $web_root = str_replace("/install.php", "", $web_root); |
@@ -475,8 +477,7 @@ discard block |
||
475 | 477 | |
476 | 478 | <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> |
477 | 479 | EOQ; |
478 | -} |
|
479 | -else{ |
|
480 | +} else{ |
|
480 | 481 | $validation_errors = array(); |
481 | 482 | // process the data posted |
482 | 483 | if($next_clicked) { |
@@ -562,27 +563,27 @@ discard block |
||
562 | 563 | $_SESSION['setup_site_custom_session_path'] = get_boolean_from_request('setup_site_custom_session_path'); |
563 | 564 | if($_SESSION['setup_site_custom_session_path']){ |
564 | 565 | $_SESSION['setup_site_session_path'] = $_REQUEST['setup_site_session_path']; |
565 | - }else{ |
|
566 | + } else{ |
|
566 | 567 | $_SESSION['setup_site_session_path'] = ''; |
567 | 568 | } |
568 | 569 | |
569 | 570 | $_SESSION['setup_site_custom_log_dir'] = get_boolean_from_request('setup_site_custom_log_dir'); |
570 | 571 | if($_SESSION['setup_site_custom_log_dir']){ |
571 | 572 | $_SESSION['setup_site_log_dir'] = $_REQUEST['setup_site_log_dir']; |
572 | - }else{ |
|
573 | + } else{ |
|
573 | 574 | $_SESSION['setup_site_log_dir'] = '.'; |
574 | 575 | } |
575 | 576 | |
576 | 577 | $_SESSION['setup_site_specify_guid'] = get_boolean_from_request('setup_site_specify_guid'); |
577 | 578 | if($_SESSION['setup_site_specify_guid']){ |
578 | 579 | $_SESSION['setup_site_guid'] = $_REQUEST['setup_site_guid']; |
579 | - }else{ |
|
580 | + } else{ |
|
580 | 581 | $_SESSION['setup_site_guid'] = ''; |
581 | 582 | } |
582 | 583 | $_SESSION['siteConfig_submitted'] = true; |
583 | 584 | if(isset($_REQUEST['setup_site_sugarbeet_anonymous_stats'])){ |
584 | 585 | $_SESSION['setup_site_sugarbeet_anonymous_stats'] = get_boolean_from_request('setup_site_sugarbeet_anonymous_stats'); |
585 | - }else{ |
|
586 | + } else{ |
|
586 | 587 | $_SESSION['setup_site_sugarbeet_anonymous_stats'] = 0; |
587 | 588 | } |
588 | 589 | |
@@ -597,13 +598,12 @@ discard block |
||
597 | 598 | |
598 | 599 | if($next_step == 9999) { |
599 | 600 | $the_file = 'SilentInstall'; |
600 | -}else if($next_step == 9191) { |
|
601 | +} else if($next_step == 9191) { |
|
601 | 602 | $_SESSION['oc_server_url'] = $_REQUEST['oc_server_url']; |
602 | 603 | $_SESSION['oc_username'] = $_REQUEST['oc_username']; |
603 | 604 | $_SESSION['oc_password'] = $_REQUEST['oc_password']; |
604 | 605 | $the_file = 'oc_convert.php'; |
605 | -} |
|
606 | -else{ |
|
606 | +} else{ |
|
607 | 607 | $the_file = $workflow[$next_step]; |
608 | 608 | |
609 | 609 | } |