@@ -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. |
@@ -94,13 +96,13 @@ discard block |
||
94 | 96 | |
95 | 97 | if(empty($patch_to_check->id_name)){ |
96 | 98 | $where = " WHERE name = '$patch_to_check->name' "; |
97 | - }else{ |
|
99 | + } else{ |
|
98 | 100 | $where = " WHERE id_name = '$patch_to_check->id_name' "; |
99 | 101 | } |
100 | 102 | |
101 | 103 | if(!empty($patch_to_check->id)){ |
102 | 104 | $where .= " AND id != '$patch_to_check->id' "; |
103 | - }else{ |
|
105 | + } else{ |
|
104 | 106 | $where .= " AND id is not null "; |
105 | 107 | } |
106 | 108 | |
@@ -129,7 +131,7 @@ discard block |
||
129 | 131 | $result = $this->db->query($query); |
130 | 132 | if(empty($result)){ |
131 | 133 | return null; |
132 | - }else{ |
|
134 | + } else{ |
|
133 | 135 | $temp_version = 0; |
134 | 136 | $id = ''; |
135 | 137 | while($row = $this->db->fetchByAssoc($result)) |
@@ -139,10 +141,11 @@ discard block |
||
139 | 141 | $id = $row['id']; |
140 | 142 | } |
141 | 143 | }//end while |
142 | - if($this->is_right_version_greater(explode('.', $temp_version), explode('.', $version), false)) |
|
143 | - return array('id' => $id, 'version' => $temp_version); |
|
144 | - else |
|
145 | - return null; |
|
144 | + if($this->is_right_version_greater(explode('.', $temp_version), explode('.', $version), false)) { |
|
145 | + return array('id' => $id, 'version' => $temp_version); |
|
146 | + } else { |
|
147 | + return null; |
|
148 | + } |
|
146 | 149 | } |
147 | 150 | } |
148 | 151 | |
@@ -171,7 +174,7 @@ discard block |
||
171 | 174 | //we have found a match |
172 | 175 | //if the patch_to_check version is greater than the found version |
173 | 176 | return ($this->is_right_version_greater(explode('.', $history_object->version), explode('.', $patch_to_check->version))); |
174 | - }else{ |
|
177 | + } else{ |
|
175 | 178 | return true; |
176 | 179 | } |
177 | 180 | } |
@@ -179,8 +182,9 @@ discard block |
||
179 | 182 | //with a matching unique_key in the database |
180 | 183 | foreach($patch_list as $more_recent_patch) |
181 | 184 | { |
182 | - if($more_recent_patch->id == $patch_to_check->id) |
|
183 | - break; |
|
185 | + if($more_recent_patch->id == $patch_to_check->id) { |
|
186 | + break; |
|
187 | + } |
|
184 | 188 | |
185 | 189 | //we will only resort to checking the files if we cannot find the unique_keys |
186 | 190 | //or the unique_keys do not match |
@@ -204,25 +208,27 @@ discard block |
||
204 | 208 | { |
205 | 209 | if(is_file($check_path)) |
206 | 210 | { |
207 | - if(file_exists($recent_path)) |
|
208 | - return true; |
|
209 | - else |
|
210 | - return false; |
|
211 | - } |
|
212 | - elseif(is_dir($check_path)) |
|
211 | + if(file_exists($recent_path)) { |
|
212 | + return true; |
|
213 | + } else { |
|
214 | + return false; |
|
215 | + } |
|
216 | + } elseif(is_dir($check_path)) |
|
213 | 217 | { |
214 | 218 | $status = false; |
215 | 219 | |
216 | 220 | $d = dir( $check_path ); |
217 | 221 | while( $f = $d->read() ) |
218 | 222 | { |
219 | - if( $f == "." || $f == ".." ) |
|
220 | - continue; |
|
223 | + if( $f == "." || $f == ".." ) { |
|
224 | + continue; |
|
225 | + } |
|
221 | 226 | |
222 | 227 | $status = $this->foundConflict("$check_path/$f", "$recent_path/$f"); |
223 | 228 | |
224 | - if($status) |
|
225 | - break; |
|
229 | + if($status) { |
|
230 | + break; |
|
231 | + } |
|
226 | 232 | } |
227 | 233 | |
228 | 234 | $d->close(); |
@@ -244,20 +250,17 @@ discard block |
||
244 | 250 | function is_right_version_greater($left, $right, $equals_is_greater = true){ |
245 | 251 | if(count($left) == 0 && count($right) == 0){ |
246 | 252 | return $equals_is_greater; |
247 | - } |
|
248 | - else if(count($left) == 0 || count($right) == 0){ |
|
253 | + } else if(count($left) == 0 || count($right) == 0){ |
|
249 | 254 | return true; |
250 | - } |
|
251 | - else if($left[0] == $right[0]){ |
|
255 | + } else if($left[0] == $right[0]){ |
|
252 | 256 | array_shift($left); |
253 | 257 | array_shift($right); |
254 | 258 | return $this->is_right_version_greater($left, $right, $equals_is_greater); |
255 | - } |
|
256 | - else if($left[0] < $right[0]){ |
|
259 | + } else if($left[0] < $right[0]){ |
|
257 | 260 | return true; |
261 | + } else { |
|
262 | + return false; |
|
258 | 263 | } |
259 | - else |
|
260 | - return false; |
|
261 | 264 | } |
262 | 265 | |
263 | 266 | /** |
@@ -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 |
@@ -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. |
@@ -66,8 +68,7 @@ discard block |
||
66 | 68 | $uploaddLabel = $mod_strings['LBL_UW_UPLOAD_MODULE']; |
67 | 69 | $descItemsQueued = $mod_strings['LBL_UW_DESC_MODULES_QUEUED']; |
68 | 70 | $descItemsInstalled = $mod_strings['LBL_UW_DESC_MODULES_INSTALLED']; |
69 | -} |
|
70 | -else { |
|
71 | +} else { |
|
71 | 72 | |
72 | 73 | $uploaddLabel = $mod_strings['LBL_UPLOAD_UPGRADE']; |
73 | 74 | $descItemsQueued = $mod_strings['DESC_FILES_QUEUED']; |
@@ -209,8 +210,7 @@ discard block |
||
209 | 210 | |
210 | 211 | if( $view == "module") { |
211 | 212 | print( getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_MODULE_LOADER_TITLE']), false) ); |
212 | -} |
|
213 | -else { |
|
213 | +} else { |
|
214 | 214 | print( getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_MODULE_NAME'],$mod_strings['LBL_UPGRADE_WIZARD_TITLE']), false) ); |
215 | 215 | } |
216 | 216 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $form .= '</table></form>'; |
232 | 232 | //rrs |
233 | 233 | |
234 | -}else{ |
|
234 | +} else{ |
|
235 | 235 | $form =<<<eoq |
236 | 236 | <form name="the_form" enctype="multipart/form-data" action="{$form_action}" method="post" > |
237 | 237 | <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view"> |
@@ -1,6 +1,7 @@ discard block |
||
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. |
@@ -70,8 +71,7 @@ discard block |
||
70 | 71 | $sql = str_replace(''',"'", $_POST['sql']); |
71 | 72 | //echo html_entity_decode($_POST['sql']); |
72 | 73 | echo $sql; |
73 | - } |
|
74 | - elseif (isset ($_POST['raction']) && strtolower($_POST['raction']) == "execute") { |
|
74 | + } elseif (isset ($_POST['raction']) && strtolower($_POST['raction']) == "execute") { |
|
75 | 75 | $sql = str_replace( |
76 | 76 | array( |
77 | 77 | "\n", |
@@ -96,8 +96,9 @@ discard block |
||
96 | 96 | } else { |
97 | 97 | |
98 | 98 | if (!$export && empty ($_REQUEST['repair_silent'])) { |
99 | - if ( empty($hideModuleMenu) ) |
|
100 | - echo getClassicModuleTitle($mod_strings['LBL_REPAIR_DATABASE'], array($mod_strings['LBL_REPAIR_DATABASE']), true); |
|
99 | + if ( empty($hideModuleMenu) ) { |
|
100 | + echo getClassicModuleTitle($mod_strings['LBL_REPAIR_DATABASE'], array($mod_strings['LBL_REPAIR_DATABASE']), true); |
|
101 | + } |
|
101 | 102 | echo "<h1 id=\"rdloading\">{$mod_strings['LBL_REPAIR_DATABASE_PROCESSING']}</h1>"; |
102 | 103 | ob_flush(); |
103 | 104 | } |
@@ -137,8 +138,9 @@ discard block |
||
137 | 138 | |
138 | 139 | foreach ($dictionary as $meta) { |
139 | 140 | |
140 | - if ( !isset($meta['table']) || isset($repairedTables[$meta['table']])) |
|
141 | - continue; |
|
141 | + if ( !isset($meta['table']) || isset($repairedTables[$meta['table']])) { |
|
142 | + continue; |
|
143 | + } |
|
142 | 144 | |
143 | 145 | $tablename = $meta['table']; |
144 | 146 | $fielddefs = $meta['fields']; |
@@ -1,6 +1,7 @@ discard block |
||
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. |
@@ -120,8 +121,9 @@ discard block |
||
120 | 121 | echo sizeof($fields)." field(s) missing from $mod->table_name"."_cstm<br>"; |
121 | 122 | foreach ($fields as $field) { |
122 | 123 | echo "Adding Column $field to $mod->table_name"."_cstm<br>"; |
123 | - if (!$simulate) |
|
124 | - $mod->custom_fields->add_existing_custom_field($field); |
|
124 | + if (!$simulate) { |
|
125 | + $mod->custom_fields->add_existing_custom_field($field); |
|
126 | + } |
|
125 | 127 | } |
126 | 128 | |
127 | 129 | } |