@@ -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. |
@@ -60,8 +62,7 @@ discard block |
||
60 | 62 | if(empty($_REQUEST['file']) || empty($_REQUEST['guid'])) |
61 | 63 | { |
62 | 64 | echo $mod_strings['LBL_DIAGNOSTIC_DELETE_ERROR']; |
63 | -} |
|
64 | -else |
|
65 | +} else |
|
65 | 66 | { |
66 | 67 | // Make sure the guid and file are valid file names for security purposes |
67 | 68 | clean_string($_REQUEST['guid'], "ALPHANUM"); |
@@ -79,10 +80,10 @@ discard block |
||
79 | 80 | unlink($cachedfile); |
80 | 81 | rmdir(dirname($cachedfile)); |
81 | 82 | echo $mod_strings['LBL_DIAGNOSTIC_DELETED']."<br><br>"; |
83 | + } else { |
|
84 | + echo $mod_strings['LBL_DIAGNOSTIC_FILE'] . $_REQUEST['file'].$mod_strings['LBL_DIAGNOSTIC_ZIP']; |
|
85 | + } |
|
82 | 86 | } |
83 | - else |
|
84 | - echo $mod_strings['LBL_DIAGNOSTIC_FILE'] . $_REQUEST['file'].$mod_strings['LBL_DIAGNOSTIC_ZIP']; |
|
85 | -} |
|
86 | 87 | |
87 | 88 | print "<a href=\"index.php?module=Administration&action=index\">" . $mod_strings['LBL_DIAGNOSTIC_DELETE_RETURN'] . "</a><br>"; |
88 | 89 |
@@ -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. |
@@ -98,8 +100,7 @@ discard block |
||
98 | 100 | foreach($views as $view) { |
99 | 101 | try{ |
100 | 102 | $parser = ParserFactory::getParser($view, $module); |
101 | - } |
|
102 | - catch(Exception $e){ |
|
103 | + } catch(Exception $e){ |
|
103 | 104 | $GLOBALS['log']->fatal("Caught exception in RepairFieldCasing script: ".$e->getMessage()); |
104 | 105 | continue; |
105 | 106 | } |
@@ -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. |
@@ -48,7 +50,9 @@ discard block |
||
48 | 50 | $htaccess_file = getcwd() . "/.htaccess"; |
49 | 51 | $contents = ''; |
50 | 52 | $basePath = parse_url($sugar_config['site_url'], PHP_URL_PATH); |
51 | -if(empty($basePath)) $basePath = '/'; |
|
53 | +if(empty($basePath)) { |
|
54 | + $basePath = '/'; |
|
55 | +} |
|
52 | 56 | |
53 | 57 | $restrict_str = <<<EOQ |
54 | 58 | # BEGIN SUGARCRM RESTRICTIONS |
@@ -74,9 +78,15 @@ discard block |
||
74 | 78 | $skip = false; |
75 | 79 | while($line = fgets($fp)){ |
76 | 80 | |
77 | - if(preg_match('/\s*#\s*BEGIN\s*SUGARCRM\s*RESTRICTIONS/i', $line))$skip = true; |
|
78 | - if(!$skip)$contents .= $line; |
|
79 | - if(preg_match('/\s*#\s*END\s*SUGARCRM\s*RESTRICTIONS/i', $line))$skip = false; |
|
81 | + if(preg_match('/\s*#\s*BEGIN\s*SUGARCRM\s*RESTRICTIONS/i', $line)) { |
|
82 | + $skip = true; |
|
83 | + } |
|
84 | + if(!$skip) { |
|
85 | + $contents .= $line; |
|
86 | + } |
|
87 | + if(preg_match('/\s*#\s*END\s*SUGARCRM\s*RESTRICTIONS/i', $line)) { |
|
88 | + $skip = false; |
|
89 | + } |
|
80 | 90 | } |
81 | 91 | } |
82 | 92 | if(substr($contents, -1) != "\n") { |
@@ -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. |
@@ -178,8 +180,7 @@ discard block |
||
178 | 180 | while( $f = $d->read() ){ |
179 | 181 | if( $f == "." || $f == ".." ){ |
180 | 182 | continue; |
181 | - } |
|
182 | - else if( preg_match("/(.*)\.lang\.php\$/", $f, $match) ){ |
|
183 | + } else if( preg_match("/(.*)\.lang\.php\$/", $f, $match) ){ |
|
183 | 184 | $new_lang_name = $match[1]; |
184 | 185 | } |
185 | 186 | } |
@@ -200,8 +201,9 @@ discard block |
||
200 | 201 | break; |
201 | 202 | case "module": |
202 | 203 | $previous_install = array(); |
203 | - if(!empty($id_name) & !empty($version)) |
|
204 | - $previous_install = $uh->determineIfUpgrade($id_name, $version); |
|
204 | + if(!empty($id_name) & !empty($version)) { |
|
205 | + $previous_install = $uh->determineIfUpgrade($id_name, $version); |
|
206 | + } |
|
205 | 207 | $previous_version = (empty($previous_install['version'])) ? '' : $previous_install['version']; |
206 | 208 | $previous_id = (empty($previous_install['id'])) ? '' : $previous_install['id']; |
207 | 209 | $show_files = false; |
@@ -231,15 +233,16 @@ discard block |
||
231 | 233 | <form action="<?php print( $form_action . "_commit" ); ?>" name="files" method="post" onSubmit="return validateForm(<?php print($require_license); ?>);"> |
232 | 234 | <?php |
233 | 235 | if(empty($new_studio_mod_files)) { |
234 | - if(!empty($mode) && $mode == 'Uninstall') |
|
235 | - echo $mod_strings['LBL_UW_UNINSTALL_READY']; |
|
236 | - else if($mode == 'Disable') |
|
237 | - echo $mod_strings['LBL_UW_DISABLE_READY']; |
|
238 | - else if($mode == 'Enable') |
|
239 | - echo $mod_strings['LBL_UW_ENABLE_READY']; |
|
240 | - else |
|
241 | - echo $mod_strings['LBL_UW_PATCH_READY']; |
|
242 | -} else { |
|
236 | + if(!empty($mode) && $mode == 'Uninstall') { |
|
237 | + echo $mod_strings['LBL_UW_UNINSTALL_READY']; |
|
238 | + } else if($mode == 'Disable') { |
|
239 | + echo $mod_strings['LBL_UW_DISABLE_READY']; |
|
240 | + } else if($mode == 'Enable') { |
|
241 | + echo $mod_strings['LBL_UW_ENABLE_READY']; |
|
242 | + } else { |
|
243 | + echo $mod_strings['LBL_UW_PATCH_READY']; |
|
244 | + } |
|
245 | + } else { |
|
243 | 246 | echo $mod_strings['LBL_UW_PATCH_READY2']; |
244 | 247 | echo '<input type="checkbox" onclick="toggle_these(0, ' . count($new_studio_mod_files) . ', this)"> '.$mod_strings['LBL_UW_CHECK_ALL']; |
245 | 248 | foreach($new_studio_mod_files as $the_file) { |
@@ -255,7 +258,7 @@ discard block |
||
255 | 258 | if($found_readme){ |
256 | 259 | if(file_exists($readme_file) && filesize($readme_file) > 0){ |
257 | 260 | $readme_contents = file_get_contents($readme_file); |
258 | - }elseif(!empty($manifest['readme'])){ |
|
261 | + } elseif(!empty($manifest['readme'])){ |
|
259 | 262 | $readme_contents = $manifest['readme']; |
260 | 263 | } |
261 | 264 | } |
@@ -327,8 +330,7 @@ discard block |
||
327 | 330 | if( $install_type == "langpack" ){ |
328 | 331 | print( $mod_strings['LBL_UW_LANGPACK_READY_UNISTALL'] ); |
329 | 332 | echo '<br><br>'; |
330 | - } |
|
331 | - else if($install_type != "module"){ |
|
333 | + } else if($install_type != "module"){ |
|
332 | 334 | print( $mod_strings['LBL_UW_FILES_REMOVED'] ); |
333 | 335 | } |
334 | 336 | break; |
@@ -369,10 +371,11 @@ discard block |
||
369 | 371 | $cache_html_files = findAllFilesRelative( sugar_cached("layout"), array()); |
370 | 372 | |
371 | 373 | foreach($new_files as $the_file) { |
372 | - if(substr(strtolower($the_file), -5, 5) == '.html' && in_array($the_file, $cache_html_files)) |
|
373 | - array_push($new_studio_mod_files, $the_file); |
|
374 | - else |
|
375 | - array_push($new_sugar_mod_files, $the_file); |
|
374 | + if(substr(strtolower($the_file), -5, 5) == '.html' && in_array($the_file, $cache_html_files)) { |
|
375 | + array_push($new_studio_mod_files, $the_file); |
|
376 | + } else { |
|
377 | + array_push($new_sugar_mod_files, $the_file); |
|
378 | + } |
|
376 | 379 | } |
377 | 380 | |
378 | 381 | echo '<script> |
@@ -427,12 +430,10 @@ discard block |
||
427 | 430 | print( " (no changes)" ); |
428 | 431 | } |
429 | 432 | print( "<br>\n" ); |
430 | - } |
|
431 | - else if( $mode == "Uninstall" && file_exists( $new_file ) ){ |
|
433 | + } else if( $mode == "Uninstall" && file_exists( $new_file ) ){ |
|
432 | 434 | if( md5_file( $unzip_file ) == md5_file( $new_file ) ){ |
433 | 435 | $checked = "checked=\"true\""; |
434 | - } |
|
435 | - else{ |
|
436 | + } else{ |
|
436 | 437 | $highlight_start = "<font color=red>"; |
437 | 438 | $highlight_end = "</font>"; |
438 | 439 | } |
@@ -458,7 +459,7 @@ discard block |
||
458 | 459 | } |
459 | 460 | } |
460 | 461 | return true;'; |
461 | - }else{ |
|
462 | + } else{ |
|
462 | 463 | echo 'return true;'; |
463 | 464 | } |
464 | 465 | echo '}</script>'; |
@@ -472,13 +473,13 @@ discard block |
||
472 | 473 | print('<li>'.$modified_file.'</li>'); |
473 | 474 | } |
474 | 475 | print('</ul>'); |
475 | - }else{ |
|
476 | + } else{ |
|
476 | 477 | echo '<script>' . |
477 | 478 | 'function handleFileChange(){'; |
478 | 479 | echo 'return true;'; |
479 | 480 | echo '}</script>'; |
480 | 481 | } |
481 | -}else{ |
|
482 | +} else{ |
|
482 | 483 | echo '<script>' . |
483 | 484 | 'function handleFileChange(){'; |
484 | 485 | echo 'return true;'; |
@@ -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. |
@@ -48,8 +50,7 @@ discard block |
||
48 | 50 | |
49 | 51 | //remove language cache files |
50 | 52 | LanguageManager::clearLanguageCache(); |
51 | -} |
|
52 | -else{ |
|
53 | +} else{ |
|
53 | 54 | sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); |
54 | 55 | } |
55 | 56 | ?> |
@@ -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. |
@@ -38,7 +40,9 @@ discard block |
||
38 | 40 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39 | 41 | ********************************************************************************/ |
40 | 42 | |
41 | -if(!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
|
43 | +if(!is_admin($current_user)) { |
|
44 | + sugar_die("Unauthorized access to administration."); |
|
45 | +} |
|
42 | 46 | |
43 | 47 | global $timedate; |
44 | 48 |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('sugarEntry') || !sugarEntry) |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) { |
|
3 | 3 | die('Not A Valid Entry Point'); |
4 | +} |
|
4 | 5 | /********************************************************************************* |
5 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
6 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
1 | +<?php if(!defined('sugarEntry') || !sugarEntry) { |
|
2 | + die('Not A Valid Entry Point'); |
|
3 | +} |
|
2 | 4 | /********************************************************************************* |
3 | 5 | * SugarCRM Community Edition is a customer relationship management program developed by |
4 | 6 | * 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. |
@@ -43,14 +45,17 @@ discard block |
||
43 | 45 | //// LOCAL UTILITY |
44 | 46 | function compare($table_name, $db_indexes, $var_indexes) { |
45 | 47 | global $add_index, $drop_index, $change_index; |
46 | - if(empty($change_index))$change_index = array(); |
|
48 | + if(empty($change_index)) { |
|
49 | + $change_index = array(); |
|
50 | + } |
|
47 | 51 | foreach ($var_indexes as $var_i_name=>$var_i_def) { |
48 | 52 | //find corresponding db index with same name |
49 | 53 | //else by columns in the index. |
50 | 54 | $sel_db_index = null; |
51 | 55 | $var_fields_string =''; |
52 | - if(count($var_i_def['fields'])>0) |
|
53 | - $var_fields_string = implode('',$var_i_def['fields']); |
|
56 | + if(count($var_i_def['fields'])>0) { |
|
57 | + $var_fields_string = implode('',$var_i_def['fields']); |
|
58 | + } |
|
54 | 59 | $field_list_match = false; |
55 | 60 | if(isset($db_indexes[$var_i_name])) { |
56 | 61 | $sel_db_index = $db_indexes[$var_i_name]; |
@@ -101,12 +106,16 @@ discard block |
||
101 | 106 | |
102 | 107 | /////////////////////////////////////////////////////////////////////////////// |
103 | 108 | //// PROCESS |
104 | -if(!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
|
109 | +if(!is_admin($current_user)) { |
|
110 | + sugar_die("Unauthorized access to administration."); |
|
111 | +} |
|
105 | 112 | set_time_limit(3600); |
106 | 113 | /** |
107 | 114 | * Note: $_REQUEST['silent'] is set from ModuleInstaller::repair_indices(); |
108 | 115 | */ |
109 | -if(!isset($_REQUEST['silent'])) $_REQUEST['silent'] = false; |
|
116 | +if(!isset($_REQUEST['silent'])) { |
|
117 | + $_REQUEST['silent'] = false; |
|
118 | +} |
|
110 | 119 | |
111 | 120 | $add_index=array(); |
112 | 121 | $drop_index=array(); |