@@ -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. |
@@ -59,7 +61,9 @@ discard block |
||
59 | 61 | $role->retrieve($_REQUEST['record']); |
60 | 62 | $categories = ACLRole::getRoleActions($_REQUEST['record']); |
61 | 63 | $names = ACLAction::setupCategoriesMatrix($categories); |
62 | -if(!empty($names))$tdwidth = 100 / sizeof($names); |
|
64 | +if(!empty($names)) { |
|
65 | + $tdwidth = 100 / sizeof($names); |
|
66 | +} |
|
63 | 67 | $sugar_smarty->assign('ROLE', $role->toArray()); |
64 | 68 | $sugar_smarty->assign('CATEGORIES', $categories); |
65 | 69 | $sugar_smarty->assign('TDWIDTH', $tdwidth); |
@@ -45,8 +45,9 @@ |
||
45 | 45 | public function preDisplay() |
46 | 46 | { |
47 | 47 | //bug #46690: Developer Access to Users/Teams/Roles |
48 | - if (!$GLOBALS['current_user']->isAdminForModule('Users') && !$GLOBALS['current_user']->isDeveloperForModule('Users')) |
|
49 | - sugar_die('No Access'); |
|
48 | + if (!$GLOBALS['current_user']->isAdminForModule('Users') && !$GLOBALS['current_user']->isDeveloperForModule('Users')) { |
|
49 | + sugar_die('No Access'); |
|
50 | + } |
|
50 | 51 | |
51 | 52 | $this->lv = new ListViewSmarty(); |
52 | 53 | $this->lv->export = false; |
@@ -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. |
@@ -42,7 +44,9 @@ discard block |
||
42 | 44 | |
43 | 45 | |
44 | 46 | $role = new ACLRole(); |
45 | -if(isset($_REQUEST['record']))$role->id = $_POST['record']; |
|
47 | +if(isset($_REQUEST['record'])) { |
|
48 | + $role->id = $_POST['record']; |
|
49 | +} |
|
46 | 50 | if(!empty($_REQUEST['name'])){ |
47 | 51 | $role->name = $_POST['name']; |
48 | 52 | $role->description = $_POST['description']; |
@@ -59,7 +63,7 @@ discard block |
||
59 | 63 | } |
60 | 64 | } |
61 | 65 | } |
62 | -}else{ |
|
66 | +} else{ |
|
63 | 67 | ob_clean(); |
64 | 68 | $flc_module = 'All'; |
65 | 69 | foreach($_POST as $name=>$value){ |
@@ -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. |
@@ -127,7 +129,9 @@ discard block |
||
127 | 129 | $_SESSION['loginAttempts'] = (isset($_SESSION['loginAttempts']))? $_SESSION['loginAttempts'] + 1: 1; |
128 | 130 | unset($GLOBALS['login_error']); |
129 | 131 | |
130 | - if($this->loggedIn)return $this->loginSuccess; |
|
132 | + if($this->loggedIn) { |
|
133 | + return $this->loginSuccess; |
|
134 | + } |
|
131 | 135 | LogicHook::initialize()->call_custom_logic('Users', 'before_login'); |
132 | 136 | |
133 | 137 | $this->loginSuccess = $this->authController->loginAuthenticate($username, $password, false, $PARAMS); |
@@ -146,8 +150,9 @@ discard block |
||
146 | 150 | } |
147 | 151 | |
148 | 152 | //call business logic hook |
149 | - if(isset($GLOBALS['current_user'])) |
|
150 | - $GLOBALS['current_user']->call_custom_logic('after_login'); |
|
153 | + if(isset($GLOBALS['current_user'])) { |
|
154 | + $GLOBALS['current_user']->call_custom_logic('after_login'); |
|
155 | + } |
|
151 | 156 | |
152 | 157 | // Check for running Admin Wizard |
153 | 158 | $config = new Administration(); |
@@ -172,7 +177,7 @@ discard block |
||
172 | 177 | header("Location: index.php?module=Users&action=Wizard"); |
173 | 178 | sugar_cleanup(true); |
174 | 179 | } |
175 | - }else{ |
|
180 | + } else{ |
|
176 | 181 | //kbrill bug #13225 |
177 | 182 | LogicHook::initialize(); |
178 | 183 | $GLOBALS['logic_hook']->call_custom_logic('Users', 'login_failed'); |
@@ -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,7 +96,9 @@ discard block |
||
94 | 96 | global $login_error; |
95 | 97 | |
96 | 98 | $GLOBALS['log']->debug("Starting user load for ". $name); |
97 | - if(empty($name) || empty($password)) return false; |
|
99 | + if(empty($name) || empty($password)) { |
|
100 | + return false; |
|
101 | + } |
|
98 | 102 | $input_hash = $password; |
99 | 103 | $passwordEncrypted = false; |
100 | 104 | if (!empty($PARAMS) && isset($PARAMS['passwordEncrypted']) && $PARAMS['passwordEncrypted']) { |
@@ -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. |
@@ -56,15 +58,17 @@ discard block |
||
56 | 58 | |
57 | 59 | |
58 | 60 | |
59 | -if (isset($_POST['id'])) |
|
61 | +if (isset($_POST['id'])) { |
|
60 | 62 | sugar_die("Unauthorized access to administration."); |
63 | +} |
|
61 | 64 | if (isset($_POST['record']) && !is_admin($current_user) |
62 | 65 | && !$GLOBALS['current_user']->isAdminForModule('Users') |
63 | - && $_POST['record'] != $current_user->id) |
|
64 | -sugar_die("Unauthorized access to administration."); |
|
65 | -elseif (!isset($_POST['record']) && !is_admin($current_user) |
|
66 | - && !$GLOBALS['current_user']->isAdminForModule('Users')) |
|
67 | -sugar_die ("Unauthorized access to user administration."); |
|
66 | + && $_POST['record'] != $current_user->id) { |
|
67 | + sugar_die("Unauthorized access to administration."); |
|
68 | +} elseif (!isset($_POST['record']) && !is_admin($current_user) |
|
69 | + && !$GLOBALS['current_user']->isAdminForModule('Users')) { |
|
70 | + sugar_die ("Unauthorized access to user administration."); |
|
71 | +} |
|
68 | 72 | $focus = new User(); |
69 | 73 | $focus->retrieve($_POST['record']); |
70 | 74 | |
@@ -106,8 +110,7 @@ discard block |
||
106 | 110 | if ($sf != null) |
107 | 111 | { |
108 | 112 | $sf->save($focus, $_POST, $fieldName, $field, ''); |
109 | - } |
|
110 | - else |
|
113 | + } else |
|
111 | 114 | { |
112 | 115 | $GLOBALS['log']->fatal("Field '$fieldName' does not have a SugarField handler"); |
113 | 116 | } |
@@ -157,8 +160,7 @@ discard block |
||
157 | 160 | if ($sf != null) |
158 | 161 | { |
159 | 162 | $sf->save($focus, $_POST, $fieldName, $field, ''); |
160 | - } |
|
161 | - else |
|
163 | + } else |
|
162 | 164 | { |
163 | 165 | $GLOBALS['log']->fatal("Field '$fieldName' does not have a SugarField handler"); |
164 | 166 | } |
@@ -171,8 +173,7 @@ discard block |
||
171 | 173 | if ($sf != null) |
172 | 174 | { |
173 | 175 | $sf->save($focus, $_POST, $fieldName, $field, ''); |
174 | - } |
|
175 | - else |
|
176 | + } else |
|
176 | 177 | { |
177 | 178 | $GLOBALS['log']->fatal("Field '$fieldName' does not have a SugarField handler"); |
178 | 179 | } |
@@ -181,18 +182,26 @@ discard block |
||
181 | 182 | $focus->is_group=0; |
182 | 183 | $focus->portal_only=0; |
183 | 184 | |
184 | - if(isset($_POST['status']) && $_POST['status']== "Inactive") $focus->employee_status = "Terminated"; //bug49972 |
|
185 | + if(isset($_POST['status']) && $_POST['status']== "Inactive") { |
|
186 | + $focus->employee_status = "Terminated"; |
|
187 | + } |
|
188 | + //bug49972 |
|
185 | 189 | |
186 | 190 | if(isset($_POST['user_name'])) |
187 | 191 | { |
188 | 192 | $focus->user_name = $_POST['user_name']; |
189 | 193 | } |
190 | 194 | if((isset($_POST['is_admin']) && ($_POST['is_admin'] == 'on' || $_POST['is_admin'] == '1')) || |
191 | - (isset($_POST['UserType']) && $_POST['UserType'] == "Administrator")) $focus->is_admin = 1; |
|
192 | - elseif(isset($_POST['is_admin']) && empty($_POST['is_admin'])) $focus->is_admin = 0; |
|
195 | + (isset($_POST['UserType']) && $_POST['UserType'] == "Administrator")) { |
|
196 | + $focus->is_admin = 1; |
|
197 | + } elseif(isset($_POST['is_admin']) && empty($_POST['is_admin'])) { |
|
198 | + $focus->is_admin = 0; |
|
199 | + } |
|
193 | 200 | //if(empty($_POST['portal_only']) || !empty($_POST['is_admin'])) $focus->portal_only = 0; |
194 | 201 | //if(empty($_POST['is_group']) || !empty($_POST['is_admin'])) $focus->is_group = 0; |
195 | - if(empty($_POST['receive_notifications'])) $focus->receive_notifications = 0; |
|
202 | + if(empty($_POST['receive_notifications'])) { |
|
203 | + $focus->receive_notifications = 0; |
|
204 | + } |
|
196 | 205 | |
197 | 206 | if(isset($_POST['mailmerge_on']) && !empty($_POST['mailmerge_on'])) { |
198 | 207 | $focus->setPreference('mailmerge_on','on', 0, 'global'); |
@@ -203,8 +212,7 @@ discard block |
||
203 | 212 | if(isset($_POST['user_swap_last_viewed'])) |
204 | 213 | { |
205 | 214 | $focus->setPreference('swap_last_viewed', $_POST['user_swap_last_viewed'], 0, 'global'); |
206 | - } |
|
207 | - else |
|
215 | + } else |
|
208 | 216 | { |
209 | 217 | $focus->setPreference('swap_last_viewed', '', 0, 'global'); |
210 | 218 | } |
@@ -212,8 +220,7 @@ discard block |
||
212 | 220 | if(isset($_POST['user_swap_shortcuts'])) |
213 | 221 | { |
214 | 222 | $focus->setPreference('swap_shortcuts', $_POST['user_swap_shortcuts'], 0, 'global'); |
215 | - } |
|
216 | - else |
|
223 | + } else |
|
217 | 224 | { |
218 | 225 | $focus->setPreference('swap_shortcuts', '', 0, 'global'); |
219 | 226 | } |
@@ -221,8 +228,7 @@ discard block |
||
221 | 228 | if(isset($_POST['use_group_tabs'])) |
222 | 229 | { |
223 | 230 | $focus->setPreference('navigation_paradigm', $_POST['use_group_tabs'], 0, 'global'); |
224 | - } |
|
225 | - else |
|
231 | + } else |
|
226 | 232 | { |
227 | 233 | $focus->setPreference('navigation_paradigm', 'gm', 0, 'global'); |
228 | 234 | } |
@@ -230,8 +236,7 @@ discard block |
||
230 | 236 | if(isset($_POST['user_subpanel_tabs'])) |
231 | 237 | { |
232 | 238 | $focus->setPreference('subpanel_tabs', $_POST['user_subpanel_tabs'], 0, 'global'); |
233 | - } |
|
234 | - else |
|
239 | + } else |
|
235 | 240 | { |
236 | 241 | $focus->setPreference('subpanel_tabs', '', 0, 'global'); |
237 | 242 | } |
@@ -245,33 +250,32 @@ discard block |
||
245 | 250 | if(isset($_POST['user_module_favicon'])) |
246 | 251 | { |
247 | 252 | $focus->setPreference('module_favicon', $_POST['user_module_favicon'], 0, 'global'); |
248 | - } |
|
249 | - else |
|
253 | + } else |
|
250 | 254 | { |
251 | 255 | $focus->setPreference('module_favicon', '', 0, 'global'); |
252 | 256 | } |
253 | 257 | |
254 | 258 | $tabs = new TabController(); |
255 | - if(isset($_POST['display_tabs'])) |
|
256 | - $tabs->set_user_tabs($DISPLAY_ARR['display_tabs'], $focus, 'display'); |
|
259 | + if(isset($_POST['display_tabs'])) { |
|
260 | + $tabs->set_user_tabs($DISPLAY_ARR['display_tabs'], $focus, 'display'); |
|
261 | + } |
|
257 | 262 | if(isset($HIDE_ARR['hide_tabs'])){ |
258 | 263 | $tabs->set_user_tabs($HIDE_ARR['hide_tabs'], $focus, 'hide'); |
259 | 264 | |
260 | - }else{ |
|
265 | + } else{ |
|
261 | 266 | $tabs->set_user_tabs(array(), $focus, 'hide'); |
262 | 267 | } |
263 | 268 | if(is_admin($current_user)){ |
264 | 269 | if(isset($REMOVE_ARR['remove_tabs'])){ |
265 | 270 | $tabs->set_user_tabs($REMOVE_ARR['remove_tabs'], $focus, 'remove'); |
266 | - }else{ |
|
271 | + } else{ |
|
267 | 272 | $tabs->set_user_tabs(array(), $focus, 'remove'); |
268 | 273 | } |
269 | 274 | } |
270 | 275 | |
271 | 276 | if(isset($_POST['no_opps'])) { |
272 | 277 | $focus->setPreference('no_opps',$_POST['no_opps'], 0, 'global'); |
273 | - } |
|
274 | - else { |
|
278 | + } else { |
|
275 | 279 | $focus->setPreference('no_opps','off', 0, 'global'); |
276 | 280 | } |
277 | 281 | |
@@ -294,27 +298,68 @@ discard block |
||
294 | 298 | $focus->setPreference('reminder_checked', $_POST['reminder_checked'], 0, 'global'); |
295 | 299 | $focus->setPreference('email_reminder_checked', $_POST['email_reminder_checked'], 0, 'global'); |
296 | 300 | |
297 | - if(isset($_POST['timezone'])) $focus->setPreference('timezone',$_POST['timezone'], 0, 'global'); |
|
298 | - if(isset($_POST['ut'])) $focus->setPreference('ut', '0', 0, 'global'); |
|
299 | - else $focus->setPreference('ut', '1', 0, 'global'); |
|
300 | - if(isset($_POST['currency'])) $focus->setPreference('currency',$_POST['currency'], 0, 'global'); |
|
301 | - if(isset($_POST['default_currency_significant_digits'])) $focus->setPreference('default_currency_significant_digits',$_POST['default_currency_significant_digits'], 0, 'global'); |
|
302 | - if(isset($_POST['num_grp_sep'])) $focus->setPreference('num_grp_sep', $_POST['num_grp_sep'], 0, 'global'); |
|
303 | - if(isset($_POST['dec_sep'])) $focus->setPreference('dec_sep', $_POST['dec_sep'], 0, 'global'); |
|
304 | - if(isset($_POST['fdow'])) $focus->setPreference('fdow', $_POST['fdow'], 0, 'global'); |
|
305 | - if(isset($_POST['dateformat'])) $focus->setPreference('datef',$_POST['dateformat'], 0, 'global'); |
|
306 | - if(isset($_POST['timeformat'])) $focus->setPreference('timef',$_POST['timeformat'], 0, 'global'); |
|
307 | - if(isset($_POST['timezone'])) $focus->setPreference('timezone',$_POST['timezone'], 0, 'global'); |
|
308 | - if(isset($_POST['mail_fromname'])) $focus->setPreference('mail_fromname',$_POST['mail_fromname'], 0, 'global'); |
|
309 | - if(isset($_POST['mail_fromaddress'])) $focus->setPreference('mail_fromaddress',$_POST['mail_fromaddress'], 0, 'global'); |
|
310 | - if(isset($_POST['mail_sendtype'])) $focus->setPreference('mail_sendtype', $_POST['mail_sendtype'], 0, 'global'); |
|
311 | - if(isset($_POST['mail_smtpserver'])) $focus->setPreference('mail_smtpserver',$_POST['mail_smtpserver'], 0, 'global'); |
|
312 | - if(isset($_POST['mail_smtpport'])) $focus->setPreference('mail_smtpport',$_POST['mail_smtpport'], 0, 'global'); |
|
313 | - if(isset($_POST['mail_smtpuser'])) $focus->setPreference('mail_smtpuser',$_POST['mail_smtpuser'], 0, 'global'); |
|
314 | - if(isset($_POST['mail_smtppass'])) $focus->setPreference('mail_smtppass',$_POST['mail_smtppass'], 0, 'global'); |
|
315 | - if(isset($_POST['default_locale_name_format'])) $focus->setPreference('default_locale_name_format',$_POST['default_locale_name_format'], 0, 'global'); |
|
316 | - if(isset($_POST['export_delimiter'])) $focus->setPreference('export_delimiter', $_POST['export_delimiter'], 0, 'global'); |
|
317 | - if(isset($_POST['default_export_charset'])) $focus->setPreference('default_export_charset', $_POST['default_export_charset'], 0, 'global'); |
|
301 | + if(isset($_POST['timezone'])) { |
|
302 | + $focus->setPreference('timezone',$_POST['timezone'], 0, 'global'); |
|
303 | + } |
|
304 | + if(isset($_POST['ut'])) { |
|
305 | + $focus->setPreference('ut', '0', 0, 'global'); |
|
306 | + } else { |
|
307 | + $focus->setPreference('ut', '1', 0, 'global'); |
|
308 | + } |
|
309 | + if(isset($_POST['currency'])) { |
|
310 | + $focus->setPreference('currency',$_POST['currency'], 0, 'global'); |
|
311 | + } |
|
312 | + if(isset($_POST['default_currency_significant_digits'])) { |
|
313 | + $focus->setPreference('default_currency_significant_digits',$_POST['default_currency_significant_digits'], 0, 'global'); |
|
314 | + } |
|
315 | + if(isset($_POST['num_grp_sep'])) { |
|
316 | + $focus->setPreference('num_grp_sep', $_POST['num_grp_sep'], 0, 'global'); |
|
317 | + } |
|
318 | + if(isset($_POST['dec_sep'])) { |
|
319 | + $focus->setPreference('dec_sep', $_POST['dec_sep'], 0, 'global'); |
|
320 | + } |
|
321 | + if(isset($_POST['fdow'])) { |
|
322 | + $focus->setPreference('fdow', $_POST['fdow'], 0, 'global'); |
|
323 | + } |
|
324 | + if(isset($_POST['dateformat'])) { |
|
325 | + $focus->setPreference('datef',$_POST['dateformat'], 0, 'global'); |
|
326 | + } |
|
327 | + if(isset($_POST['timeformat'])) { |
|
328 | + $focus->setPreference('timef',$_POST['timeformat'], 0, 'global'); |
|
329 | + } |
|
330 | + if(isset($_POST['timezone'])) { |
|
331 | + $focus->setPreference('timezone',$_POST['timezone'], 0, 'global'); |
|
332 | + } |
|
333 | + if(isset($_POST['mail_fromname'])) { |
|
334 | + $focus->setPreference('mail_fromname',$_POST['mail_fromname'], 0, 'global'); |
|
335 | + } |
|
336 | + if(isset($_POST['mail_fromaddress'])) { |
|
337 | + $focus->setPreference('mail_fromaddress',$_POST['mail_fromaddress'], 0, 'global'); |
|
338 | + } |
|
339 | + if(isset($_POST['mail_sendtype'])) { |
|
340 | + $focus->setPreference('mail_sendtype', $_POST['mail_sendtype'], 0, 'global'); |
|
341 | + } |
|
342 | + if(isset($_POST['mail_smtpserver'])) { |
|
343 | + $focus->setPreference('mail_smtpserver',$_POST['mail_smtpserver'], 0, 'global'); |
|
344 | + } |
|
345 | + if(isset($_POST['mail_smtpport'])) { |
|
346 | + $focus->setPreference('mail_smtpport',$_POST['mail_smtpport'], 0, 'global'); |
|
347 | + } |
|
348 | + if(isset($_POST['mail_smtpuser'])) { |
|
349 | + $focus->setPreference('mail_smtpuser',$_POST['mail_smtpuser'], 0, 'global'); |
|
350 | + } |
|
351 | + if(isset($_POST['mail_smtppass'])) { |
|
352 | + $focus->setPreference('mail_smtppass',$_POST['mail_smtppass'], 0, 'global'); |
|
353 | + } |
|
354 | + if(isset($_POST['default_locale_name_format'])) { |
|
355 | + $focus->setPreference('default_locale_name_format',$_POST['default_locale_name_format'], 0, 'global'); |
|
356 | + } |
|
357 | + if(isset($_POST['export_delimiter'])) { |
|
358 | + $focus->setPreference('export_delimiter', $_POST['export_delimiter'], 0, 'global'); |
|
359 | + } |
|
360 | + if(isset($_POST['default_export_charset'])) { |
|
361 | + $focus->setPreference('default_export_charset', $_POST['default_export_charset'], 0, 'global'); |
|
362 | + } |
|
318 | 363 | if(isset($_POST['use_real_names'])) { |
319 | 364 | $focus->setPreference('use_real_names', 'on', 0, 'global'); |
320 | 365 | } elseif(!isset($_POST['use_real_names']) && !isset($_POST['from_dcmenu'])) { |
@@ -346,34 +391,42 @@ discard block |
||
346 | 391 | |
347 | 392 | /////////////////////////////////////////////////////////////////////////// |
348 | 393 | //// SIGNATURES |
349 | - if(isset($_POST['signature_id'])) |
|
350 | - $focus->setPreference('signature_default', $_POST['signature_id'], 0, 'global'); |
|
394 | + if(isset($_POST['signature_id'])) { |
|
395 | + $focus->setPreference('signature_default', $_POST['signature_id'], 0, 'global'); |
|
396 | + } |
|
351 | 397 | |
352 | - if(isset($_POST['signature_prepend'])) $focus->setPreference('signature_prepend',$_POST['signature_prepend'], 0, 'global'); |
|
398 | + if(isset($_POST['signature_prepend'])) { |
|
399 | + $focus->setPreference('signature_prepend',$_POST['signature_prepend'], 0, 'global'); |
|
400 | + } |
|
353 | 401 | //// END SIGNATURES |
354 | 402 | /////////////////////////////////////////////////////////////////////////// |
355 | 403 | |
356 | 404 | |
357 | - if(isset($_POST['email_link_type'])) $focus->setPreference('email_link_type', $_REQUEST['email_link_type']); |
|
405 | + if(isset($_POST['email_link_type'])) { |
|
406 | + $focus->setPreference('email_link_type', $_REQUEST['email_link_type']); |
|
407 | + } |
|
358 | 408 | if(isset($_REQUEST['email_show_counts'])) { |
359 | 409 | $focus->setPreference('email_show_counts', $_REQUEST['email_show_counts'], 0, 'global'); |
360 | 410 | } else { |
361 | 411 | $focus->setPreference('email_show_counts', 0, 0, 'global'); |
362 | 412 | } |
363 | - if(isset($_REQUEST['email_editor_option'])) |
|
364 | - $focus->setPreference('email_editor_option', $_REQUEST['email_editor_option'], 0, 'global'); |
|
365 | - if(isset($_REQUEST['default_email_charset'])) |
|
366 | - $focus->setPreference('default_email_charset', $_REQUEST['default_email_charset'], 0, 'global'); |
|
413 | + if(isset($_REQUEST['email_editor_option'])) { |
|
414 | + $focus->setPreference('email_editor_option', $_REQUEST['email_editor_option'], 0, 'global'); |
|
415 | + } |
|
416 | + if(isset($_REQUEST['default_email_charset'])) { |
|
417 | + $focus->setPreference('default_email_charset', $_REQUEST['default_email_charset'], 0, 'global'); |
|
418 | + } |
|
367 | 419 | |
368 | - if(isset($_POST['calendar_publish_key'])) $focus->setPreference('calendar_publish_key',$_POST['calendar_publish_key'], 0, 'global'); |
|
420 | + if(isset($_POST['calendar_publish_key'])) { |
|
421 | + $focus->setPreference('calendar_publish_key',$_POST['calendar_publish_key'], 0, 'global'); |
|
422 | + } |
|
369 | 423 | } |
370 | 424 | |
371 | 425 | if (!$focus->verify_data()) |
372 | 426 | { |
373 | 427 | header("Location: index.php?action=Error&module=Users&error_string=".urlencode($focus->error_string)); |
374 | 428 | exit; |
375 | - } |
|
376 | - else |
|
429 | + } else |
|
377 | 430 | { $GLOBALS['sugar_config']['disable_team_access_check'] = true; |
378 | 431 | $focus->save(); |
379 | 432 | $GLOBALS['sugar_config']['disable_team_access_check'] = false; |
@@ -394,12 +447,12 @@ discard block |
||
394 | 447 | header("Location: index.php?action=ChangePassword&module=Users&record=".$_POST['record']."&error_password=".urlencode($focus->error_string)); |
395 | 448 | exit; |
396 | 449 | } |
397 | - } |
|
398 | - else{ |
|
399 | - if ($newUser) |
|
400 | - $new_pwd='3'; |
|
401 | - else |
|
402 | - $new_pwd='1'; |
|
450 | + } else{ |
|
451 | + if ($newUser) { |
|
452 | + $new_pwd='3'; |
|
453 | + } else { |
|
454 | + $new_pwd='1'; |
|
455 | + } |
|
403 | 456 | } |
404 | 457 | } |
405 | 458 | |
@@ -420,12 +473,12 @@ discard block |
||
420 | 473 | $userOverrideOE->mail_smtpuser = $_REQUEST['mail_smtpuser']; |
421 | 474 | $userOverrideOE->mail_smtppass = $_REQUEST['mail_smtppass']; |
422 | 475 | $userOverrideOE->save(); |
423 | - } |
|
424 | - else |
|
476 | + } else |
|
425 | 477 | { |
426 | 478 | //If a user name and password for the mail account is set, create the users override account. |
427 | - if( ! (empty($_REQUEST['mail_smtpuser']) || empty($_REQUEST['mail_smtppass'])) ) |
|
428 | - $sysOutboundAccunt->createUserSystemOverrideAccount($focus->id,$_REQUEST['mail_smtpuser'],$_REQUEST['mail_smtppass'] ); |
|
479 | + if( ! (empty($_REQUEST['mail_smtpuser']) || empty($_REQUEST['mail_smtppass'])) ) { |
|
480 | + $sysOutboundAccunt->createUserSystemOverrideAccount($focus->id,$_REQUEST['mail_smtpuser'],$_REQUEST['mail_smtppass'] ); |
|
481 | + } |
|
429 | 482 | } |
430 | 483 | } |
431 | 484 | |
@@ -460,26 +513,34 @@ discard block |
||
460 | 513 | if($_REQUEST['whatnext']== 'import'){ |
461 | 514 | header("Location:index.php?module=Import&action=step1&import_module=Administration"); |
462 | 515 | return; |
463 | - }elseif($_REQUEST['whatnext']== 'users'){ |
|
516 | + } elseif($_REQUEST['whatnext']== 'users'){ |
|
464 | 517 | header("Location:index.php?module=Users&action=index"); |
465 | 518 | return; |
466 | - }elseif($_REQUEST['whatnext']== 'settings'){ |
|
519 | + } elseif($_REQUEST['whatnext']== 'settings'){ |
|
467 | 520 | header("Location:index.php?module=Configurator&action=EditView"); |
468 | 521 | return; |
469 | - }elseif($_REQUEST['whatnext']== 'studio'){ |
|
522 | + } elseif($_REQUEST['whatnext']== 'studio'){ |
|
470 | 523 | header("Location:index.php?module=ModuleBuilder&action=index&type=studio"); |
471 | 524 | return; |
472 | - }else{ |
|
525 | + } else{ |
|
473 | 526 | //do nothing, let the navigation continue as normal using code below |
474 | 527 | } |
475 | 528 | |
476 | 529 | } |
477 | 530 | |
478 | -if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") $return_module = $_REQUEST['return_module']; |
|
479 | -else $return_module = "Users"; |
|
480 | -if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") $return_action = $_REQUEST['return_action']; |
|
481 | -else $return_action = "DetailView"; |
|
482 | -if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") $return_id = $_REQUEST['return_id']; |
|
531 | +if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") { |
|
532 | + $return_module = $_REQUEST['return_module']; |
|
533 | +} else { |
|
534 | + $return_module = "Users"; |
|
535 | +} |
|
536 | +if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") { |
|
537 | + $return_action = $_REQUEST['return_action']; |
|
538 | +} else { |
|
539 | + $return_action = "DetailView"; |
|
540 | +} |
|
541 | +if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") { |
|
542 | + $return_id = $_REQUEST['return_id']; |
|
543 | +} |
|
483 | 544 | |
484 | 545 | $GLOBALS['log']->debug("Saved record with id of ".$return_id); |
485 | 546 |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | if (isset($GLOBALS['sugar_config']['show_download_tab'])) { |
160 | 160 | $enable_download_tab = $GLOBALS['sugar_config']['show_download_tab']; |
161 | - }else{ |
|
161 | + } else{ |
|
162 | 162 | $enable_download_tab = true; |
163 | 163 | } |
164 | 164 | |
@@ -175,8 +175,7 @@ discard block |
||
175 | 175 | if ($this->bean->id == $current_user->id) { |
176 | 176 | $reset_pref_warning = translate('LBL_RESET_PREFERENCES_WARNING','Users'); |
177 | 177 | $reset_home_warning = translate('LBL_RESET_HOMEPAGE_WARNING','Users'); |
178 | - } |
|
179 | - else { |
|
178 | + } else { |
|
180 | 179 | $reset_pref_warning = translate('LBL_RESET_PREFERENCES_WARNING_USER','Users'); |
181 | 180 | $reset_home_warning = translate('LBL_RESET_HOMEPAGE_WARNING_USER','Users'); |
182 | 181 | } |
@@ -193,8 +192,12 @@ discard block |
||
193 | 192 | $buttons_footer[]="<input type='button' class='button' id='reset_homepage_footer' onclick='if(confirm(\"{$reset_home_warning}\"))window.location=\"".$_SERVER['PHP_SELF'] .'?'.$the_query_string."&reset_homepage=true\";' value='".translate('LBL_RESET_HOMEPAGE','Users')."' />"; |
194 | 193 | |
195 | 194 | } |
196 | - if (isset($buttons_header)) $this->ss->assign("BUTTONS_HEADER", $buttons_header); |
|
197 | - if (isset($buttons_footer)) $this->ss->assign("BUTTONS_FOOTER", $buttons_footer); |
|
195 | + if (isset($buttons_header)) { |
|
196 | + $this->ss->assign("BUTTONS_HEADER", $buttons_header); |
|
197 | + } |
|
198 | + if (isset($buttons_footer)) { |
|
199 | + $this->ss->assign("BUTTONS_FOOTER", $buttons_footer); |
|
200 | + } |
|
198 | 201 | |
199 | 202 | |
200 | 203 | |
@@ -388,7 +391,9 @@ discard block |
||
388 | 391 | |
389 | 392 | $this->ss->assign('EXPORT_DELIMITER', $this->bean->getPreference('export_delimiter')); |
390 | 393 | |
391 | - if($this->bean->receive_notifications ||(!isset($this->bean->id) && $admin->settings['notify_send_by_default'])) $this->ss->assign("RECEIVE_NOTIFICATIONS", "checked"); |
|
394 | + if($this->bean->receive_notifications ||(!isset($this->bean->id) && $admin->settings['notify_send_by_default'])) { |
|
395 | + $this->ss->assign("RECEIVE_NOTIFICATIONS", "checked"); |
|
396 | + } |
|
392 | 397 | |
393 | 398 | //jc:12293 - modifying to use the accessor method which will translate the |
394 | 399 | //available character sets using the translation files |
@@ -479,7 +484,7 @@ discard block |
||
479 | 484 | $this->ss->assign('EXTERNAL_AUTH_CLASS_1', $sugar_config['authenticationClass']); |
480 | 485 | $this->ss->assign('EXTERNAL_AUTH_CLASS', $sugar_config['authenticationClass']); |
481 | 486 | $authclass = $sugar_config['authenticationClass']; |
482 | - }else{ |
|
487 | + } else{ |
|
483 | 488 | if(!empty($GLOBALS['system_config']->settings['system_ldap_enabled'])){ |
484 | 489 | $this->ss->assign('EXTERNAL_AUTH_CLASS_1', translate('LBL_LDAP','Users')); |
485 | 490 | $this->ss |
@@ -772,12 +777,10 @@ discard block |
||
772 | 777 | if ($user->is_admin) |
773 | 778 | { |
774 | 779 | $user->user_type = 'Administrator'; |
775 | - } |
|
776 | - else if ($user->is_group) |
|
780 | + } else if ($user->is_group) |
|
777 | 781 | { |
778 | 782 | $user->user_type = 'GROUP'; |
779 | - } |
|
780 | - else |
|
783 | + } else |
|
781 | 784 | { |
782 | 785 | $user->user_type = 'RegularUser'; |
783 | 786 | } |
@@ -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. |