@@ -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. |
@@ -169,14 +171,12 @@ discard block |
||
169 | 171 | if( $install_type != "module" ){ |
170 | 172 | if( !isset($_REQUEST['zip_from_dir']) || ($_REQUEST['zip_from_dir'] == "") ){ |
171 | 173 | $zip_from_dir = "."; |
172 | - } |
|
173 | - else{ |
|
174 | + } else{ |
|
174 | 175 | $zip_from_dir = $_REQUEST['zip_from_dir']; |
175 | 176 | } |
176 | 177 | if( !isset($_REQUEST['zip_to_dir']) || ($_REQUEST['zip_to_dir'] == "") ){ |
177 | 178 | $zip_to_dir = "."; |
178 | - } |
|
179 | - else{ |
|
179 | + } else{ |
|
180 | 180 | $zip_to_dir = $_REQUEST['zip_to_dir']; |
181 | 181 | } |
182 | 182 | } |
@@ -262,10 +262,11 @@ discard block |
||
262 | 262 | |
263 | 263 | $sugar_home_dir = getCwd(); |
264 | 264 | $dest_file = clean_path( "$sugar_home_dir/$zip_to_dir/$file_to_copy" ); |
265 | - if($zip_to_dir != '.') |
|
266 | - $rest_file = clean_path("$rest_dir/$zip_to_dir/$file_to_copy"); |
|
267 | - else |
|
268 | - $rest_file = clean_path("$rest_dir/$file_to_copy"); |
|
265 | + if($zip_to_dir != '.') { |
|
266 | + $rest_file = clean_path("$rest_dir/$zip_to_dir/$file_to_copy"); |
|
267 | + } else { |
|
268 | + $rest_file = clean_path("$rest_dir/$file_to_copy"); |
|
269 | + } |
|
269 | 270 | |
270 | 271 | switch( $mode ){ |
271 | 272 | case "Install": |
@@ -273,8 +274,9 @@ discard block |
||
273 | 274 | |
274 | 275 | if($install_type=="patch" && is_file($dest_file)) |
275 | 276 | { |
276 | - if(!is_dir(dirname( $rest_file ))) |
|
277 | - mkdir_recursive( dirname( $rest_file ) ); |
|
277 | + if(!is_dir(dirname( $rest_file ))) { |
|
278 | + mkdir_recursive( dirname( $rest_file ) ); |
|
279 | + } |
|
278 | 280 | |
279 | 281 | copy( $dest_file, $rest_file); |
280 | 282 | sugar_touch( $rest_file, filemtime($dest_file) ); |
@@ -290,8 +292,7 @@ discard block |
||
290 | 292 | { |
291 | 293 | copy( $rest_file, $dest_file); |
292 | 294 | sugar_touch( $dest_file, filemtime($rest_file) ); |
293 | - } |
|
294 | - elseif(file_exists($dest_file) && !unlink($dest_file)) |
|
295 | + } elseif(file_exists($dest_file) && !unlink($dest_file)) |
|
295 | 296 | { |
296 | 297 | die($mod_strings['ERR_UW_REMOVE_FAILED'].$dest_file); |
297 | 298 | } |
@@ -315,8 +316,7 @@ discard block |
||
315 | 316 | |
316 | 317 | if( $mode == "Install" || $mode=="Enable" ){ |
317 | 318 | $sugar_config['languages'] = $sugar_config['languages'] + array( $_REQUEST['new_lang_name'] => $_REQUEST['new_lang_desc'] ); |
318 | - } |
|
319 | - else if( $mode == "Uninstall" || $mode=="Disable" ){ |
|
319 | + } else if( $mode == "Uninstall" || $mode=="Disable" ){ |
|
320 | 320 | $new_langs = array(); |
321 | 321 | $old_langs = $sugar_config['languages']; |
322 | 322 | foreach( $old_langs as $key => $value ){ |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | //here we can determine if this is an upgrade or a new version |
354 | 354 | if(!empty($previous_version)){ |
355 | 355 | $mi->install( "$unzip_dir", true, $previous_version); |
356 | - }else{ |
|
356 | + } else{ |
|
357 | 357 | $mi->install( "$unzip_dir" ); |
358 | 358 | } |
359 | 359 | |
@@ -366,24 +366,27 @@ discard block |
||
366 | 366 | } |
367 | 367 | break; |
368 | 368 | case "Uninstall": |
369 | - if($remove_tables == 'false') |
|
370 | - $GLOBALS['mi_remove_tables'] = false; |
|
371 | - else |
|
372 | - $GLOBALS['mi_remove_tables'] = true; |
|
369 | + if($remove_tables == 'false') { |
|
370 | + $GLOBALS['mi_remove_tables'] = false; |
|
371 | + } else { |
|
372 | + $GLOBALS['mi_remove_tables'] = true; |
|
373 | + } |
|
373 | 374 | $mi->uninstall( "$unzip_dir" ); |
374 | 375 | break; |
375 | 376 | case "Disable": |
376 | - if(!$overwrite_files) |
|
377 | - $GLOBALS['mi_overwrite_files'] = false; |
|
378 | - else |
|
379 | - $GLOBALS['mi_overwrite_files'] = true; |
|
377 | + if(!$overwrite_files) { |
|
378 | + $GLOBALS['mi_overwrite_files'] = false; |
|
379 | + } else { |
|
380 | + $GLOBALS['mi_overwrite_files'] = true; |
|
381 | + } |
|
380 | 382 | $mi->disable( "$unzip_dir" ); |
381 | 383 | break; |
382 | 384 | case "Enable": |
383 | - if(!$overwrite_files) |
|
384 | - $GLOBALS['mi_overwrite_files'] = false; |
|
385 | - else |
|
386 | - $GLOBALS['mi_overwrite_files'] = true; |
|
385 | + if(!$overwrite_files) { |
|
386 | + $GLOBALS['mi_overwrite_files'] = false; |
|
387 | + } else { |
|
388 | + $GLOBALS['mi_overwrite_files'] = true; |
|
389 | + } |
|
387 | 390 | $mi->enable( "$unzip_dir" ); |
388 | 391 | break; |
389 | 392 | default: |
@@ -473,8 +476,9 @@ discard block |
||
473 | 476 | if (!empty($manifest['post_install_url'])) |
474 | 477 | { |
475 | 478 | $url_conf = $manifest['post_install_url']; |
476 | - if (is_string($url_conf)) |
|
477 | - $url_conf = array('url' => $url_conf); |
|
479 | + if (is_string($url_conf)) { |
|
480 | + $url_conf = array('url' => $url_conf); |
|
481 | + } |
|
478 | 482 | if (isset($url_conf['type']) && $url_conf['type'] == 'popup') |
479 | 483 | { |
480 | 484 | echo '<script type="text/javascript">window.open("' . $url_conf['url'] |
@@ -543,8 +547,9 @@ discard block |
||
543 | 547 | print( "<input type=submit value=\"{$mod_strings['LBL_UW_BTN_BACK_TO_MOD_LOADER']}\" /><br>" ); |
544 | 548 | echo "</div>"; |
545 | 549 | echo "<br>"; |
546 | -if(isset($lang_changed_string)) |
|
550 | +if(isset($lang_changed_string)) { |
|
547 | 551 | print($lang_changed_string); |
552 | +} |
|
548 | 553 | if ($install_type != "module" && $install_type != "langpack"){ |
549 | 554 | if( sizeof( $files_to_handle ) > 0 ){ |
550 | 555 | echo '<div style="text-align: left; cursor: hand; cursor: pointer; text-decoration: underline;" onclick=\'this.style.display="none"; toggleDisplay("more");\' id="all_text">' . SugarThemeRegistry::current()->getImage('advanced_search', '', null, null, ".gif", $mod_strings['LBL_ADVANCED_SEARCH']) . ' Show Details</div><div id=\'more\' style=\'display: none\'> |
@@ -556,8 +561,7 @@ discard block |
||
556 | 561 | } |
557 | 562 | print( "</ul>\n" ); |
558 | 563 | echo '</div>'; |
559 | - } |
|
560 | - else if( $mode != 'Disable' && $mode !='Enable' ){ |
|
564 | + } else if( $mode != 'Disable' && $mode !='Enable' ){ |
|
561 | 565 | print( "{$mod_strings['LBL_UW_NO_FILES_SELECTED']} $file_action.<br>\n" ); |
562 | 566 | } |
563 | 567 |
@@ -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. |
@@ -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(); |
@@ -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. |
@@ -95,9 +97,9 @@ discard block |
||
95 | 97 | if (isset($_REQUEST['system_ldap_enabled']) && $_REQUEST['system_ldap_enabled'] == 'on') { |
96 | 98 | $_POST['system_ldap_enabled'] = 1; |
97 | 99 | clearPasswordSettings(); |
98 | - } |
|
99 | - else |
|
100 | - $_POST['system_ldap_enabled'] = 0; |
|
100 | + } else { |
|
101 | + $_POST['system_ldap_enabled'] = 0; |
|
102 | + } |
|
101 | 103 | |
102 | 104 | |
103 | 105 | if(isset($_REQUEST['authenticationClass'])) |
@@ -114,18 +116,21 @@ discard block |
||
114 | 116 | $_POST['ldap_group_attr_req_dn'] = 0; |
115 | 117 | } |
116 | 118 | |
117 | - if (isset($_REQUEST['ldap_group_checkbox']) && $_REQUEST['ldap_group_checkbox'] == 'on') |
|
118 | - $_POST['ldap_group'] = 1; |
|
119 | - else |
|
120 | - $_POST['ldap_group'] = 0; |
|
119 | + if (isset($_REQUEST['ldap_group_checkbox']) && $_REQUEST['ldap_group_checkbox'] == 'on') { |
|
120 | + $_POST['ldap_group'] = 1; |
|
121 | + } else { |
|
122 | + $_POST['ldap_group'] = 0; |
|
123 | + } |
|
121 | 124 | |
122 | - if (isset($_REQUEST['ldap_authentication_checkbox']) && $_REQUEST['ldap_authentication_checkbox'] == 'on') |
|
123 | - $_POST['ldap_authentication'] = 1; |
|
124 | - else |
|
125 | - $_POST['ldap_authentication'] = 0; |
|
125 | + if (isset($_REQUEST['ldap_authentication_checkbox']) && $_REQUEST['ldap_authentication_checkbox'] == 'on') { |
|
126 | + $_POST['ldap_authentication'] = 1; |
|
127 | + } else { |
|
128 | + $_POST['ldap_authentication'] = 0; |
|
129 | + } |
|
126 | 130 | |
127 | - if( isset($_REQUEST['passwordsetting_lockoutexpirationtime']) && is_numeric($_REQUEST['passwordsetting_lockoutexpirationtime']) ) |
|
128 | - $_POST['passwordsetting_lockoutexpiration'] = 2; |
|
131 | + if( isset($_REQUEST['passwordsetting_lockoutexpirationtime']) && is_numeric($_REQUEST['passwordsetting_lockoutexpirationtime']) ) { |
|
132 | + $_POST['passwordsetting_lockoutexpiration'] = 2; |
|
133 | + } |
|
129 | 134 | |
130 | 135 | $configurator->saveConfig(); |
131 | 136 | |
@@ -142,7 +147,9 @@ discard block |
||
142 | 147 | $sugar_smarty = new Sugar_Smarty(); |
143 | 148 | |
144 | 149 | // if no IMAP libraries available, disable Save/Test Settings |
145 | -if(!function_exists('imap_open')) $sugar_smarty->assign('IE_DISABLED', 'DISABLED'); |
|
150 | +if(!function_exists('imap_open')) { |
|
151 | + $sugar_smarty->assign('IE_DISABLED', 'DISABLED'); |
|
152 | +} |
|
146 | 153 | |
147 | 154 | $config_strings=return_module_language($GLOBALS['current_language'],'Configurator'); |
148 | 155 | $sugar_smarty->assign('CONF', $config_strings); |
@@ -167,7 +174,7 @@ discard block |
||
167 | 174 | if(!function_exists('mcrypt_cbc')){ |
168 | 175 | $sugar_smarty->assign("LDAP_ENC_KEY_READONLY", 'readonly'); |
169 | 176 | $sugar_smarty->assign("LDAP_ENC_KEY_DESC", $config_strings['LDAP_ENC_KEY_NO_FUNC_DESC']); |
170 | -}else{ |
|
177 | +} else{ |
|
171 | 178 | $sugar_smarty->assign("LDAP_ENC_KEY_DESC", $config_strings['LBL_LDAP_ENC_KEY_DESC']); |
172 | 179 | } |
173 | 180 | $sugar_smarty->assign("settings", $focus->settings); |
@@ -175,10 +182,10 @@ discard block |
||
175 | 182 | if ($valid_public_key){ |
176 | 183 | if(!empty($focus->settings['captcha_on'])){ |
177 | 184 | $sugar_smarty->assign("CAPTCHA_CONFIG_DISPLAY", 'inline'); |
178 | - }else{ |
|
185 | + } else{ |
|
179 | 186 | $sugar_smarty->assign("CAPTCHA_CONFIG_DISPLAY", 'none'); |
180 | 187 | } |
181 | -}else{ |
|
188 | +} else{ |
|
182 | 189 | $sugar_smarty->assign("CAPTCHA_CONFIG_DISPLAY", 'inline'); |
183 | 190 | } |
184 | 191 | |
@@ -194,9 +201,9 @@ discard block |
||
194 | 201 | $mail->setMailerForSystem(); |
195 | 202 | if($mail->Mailer == 'smtp' && $mail->Host ==''){ |
196 | 203 | $sugar_smarty->assign("SMTP_SERVER_NOT_SET", '1'); |
197 | - } |
|
198 | -else |
|
204 | + } else { |
|
199 | 205 | $sugar_smarty->assign("SMTP_SERVER_NOT_SET", '0'); |
206 | +} |
|
200 | 207 | |
201 | 208 | $focus = new InboundEmail(); |
202 | 209 | $focus->checkImap(); |
@@ -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. |
@@ -56,8 +58,7 @@ discard block |
||
56 | 58 | $config_check = $mod_strings['MSG_CONFIG_FILE_READY_FOR_REBUILD']; |
57 | 59 | $disable_config_rebuild = ''; |
58 | 60 | $config_file_ready = true; |
59 | -} |
|
60 | -else { |
|
61 | +} else { |
|
61 | 62 | $config_check = $mod_strings['MSG_MAKE_CONFIG_FILE_WRITABLE']; |
62 | 63 | } |
63 | 64 | |
@@ -70,8 +71,7 @@ discard block |
||
70 | 71 | if ( rebuildConfigFile($clean_config, $sugar_version) ) { |
71 | 72 | $config_check = $mod_strings['MSG_CONFIG_FILE_REBUILD_SUCCESS']; |
72 | 73 | $disable_config_rebuild = 'disabled="disabled"'; |
73 | - } |
|
74 | - else { |
|
74 | + } else { |
|
75 | 75 | $config_check = $mod_strings['MSG_CONFIG_FILE_REBUILD_FAILED']; |
76 | 76 | } |
77 | 77 |