Passed
Push — patch_1-1-9 ( d927f0...e2616d )
by Spuds
01:06 queued 27s
created
sources/controllers/MergeTopics.controller.php 1 patch
Braces   +39 added lines, -14 removed lines patch added patch discarded remove patch
@@ -73,7 +73,9 @@  discard block
 block discarded – undo
73 73
 		// If we don't know where you are from we know where you go
74 74
 		$from = $this->_req->getQuery('from', 'intval', null);
75 75
 		if (!isset($from))
76
-			throw new Elk_Exception('no_access', false);
76
+		{
77
+					throw new Elk_Exception('no_access', false);
78
+		}
77 79
 
78 80
 		$target_board = $this->_req->getPost('targetboard', 'intval', $board);
79 81
 		$context['target_board'] = $target_board;
@@ -84,8 +86,9 @@  discard block
 block discarded – undo
84 86
 			$can_approve_boards = !empty($user_info['mod_cache']['ap']) ? $user_info['mod_cache']['ap'] : boardsAllowedTo('approve_posts');
85 87
 			$onlyApproved = $can_approve_boards !== array(0) && !in_array($target_board, $can_approve_boards);
86 88
 		}
87
-		else
88
-			$onlyApproved = false;
89
+		else {
90
+					$onlyApproved = false;
91
+		}
89 92
 
90 93
 		// How many topics are on this board?  (used for paging.)
91 94
 		require_once(SUBSDIR . '/Topic.subs.php');
@@ -99,7 +102,9 @@  discard block
 block discarded – undo
99 102
 
100 103
 		// @todo review: double check the logic
101 104
 		if (empty($topic_info) || ($topic_info['id_board'] != $board) || ($onlyApproved && empty($topic_info['approved'])))
102
-			throw new Elk_Exception('no_board');
105
+		{
106
+					throw new Elk_Exception('no_board');
107
+		}
103 108
 
104 109
 		// Tell the template a few things..
105 110
 		$context['origin_topic'] = $from;
@@ -111,7 +116,9 @@  discard block
 block discarded – undo
111 116
 		$merge_boards = boardsAllowedTo('merge_any');
112 117
 
113 118
 		if (empty($merge_boards))
114
-			throw new Elk_Exception('cannot_merge_any', 'user');
119
+		{
120
+					throw new Elk_Exception('cannot_merge_any', 'user');
121
+		}
115 122
 
116 123
 		// Get a list of boards they can navigate to to merge.
117 124
 		require_once(SUBSDIR . '/Boards.subs.php');
@@ -120,7 +127,9 @@  discard block
 block discarded – undo
120 127
 		);
121 128
 
122 129
 		if (!in_array(0, $merge_boards))
123
-			$boardListOptions['included_boards'] = $merge_boards;
130
+		{
131
+					$boardListOptions['included_boards'] = $merge_boards;
132
+		}
124 133
 		$boards_list = getBoardList($boardListOptions, true);
125 134
 		$context['boards'] = array();
126 135
 
@@ -137,7 +146,9 @@  discard block
 block discarded – undo
137 146
 		$context['topics'] = mergeableTopics($target_board, $from, $onlyApproved, $this->_req->query->start);
138 147
 
139 148
 		if (empty($context['topics']) && count($context['boards']) <= 1)
140
-			throw new Elk_Exception('merge_need_more_topics');
149
+		{
150
+					throw new Elk_Exception('merge_need_more_topics');
151
+		}
141 152
 
142 153
 		$context['sub_template'] = 'merge';
143 154
 	}
@@ -174,15 +185,21 @@  discard block
 block discarded – undo
174 185
 
175 186
 		// Handle URLs from action_mergeIndex.
176 187
 		if (!empty($this->_req->query->from) && !empty($this->_req->query->to))
177
-			$topics = array((int) $this->_req->query->from, (int) $this->_req->query->to);
188
+		{
189
+					$topics = array((int) $this->_req->query->from, (int) $this->_req->query->to);
190
+		}
178 191
 
179 192
 		// If we came from a form, the topic IDs came by post.
180 193
 		if (!empty($this->_req->post->topics) && is_array($this->_req->post->topics))
181
-			$topics = $this->_req->post->topics;
194
+		{
195
+					$topics = $this->_req->post->topics;
196
+		}
182 197
 
183 198
 		// There's nothing to merge with just one topic...
184 199
 		if (empty($topics) || !is_array($topics) || count($topics) == 1)
185
-			throw new Elk_Exception('merge_need_more_topics');
200
+		{
201
+					throw new Elk_Exception('merge_need_more_topics');
202
+		}
186 203
 
187 204
 		// Send the topics to the TopicsMerge class
188 205
 		$merger = new TopicsMerge($topics);
@@ -206,13 +223,17 @@  discard block
 block discarded – undo
206 223
 
207 224
 		// No permissions to merge, your effort ends here
208 225
 		if (empty($allowedto_merge_boards))
209
-			throw new Elk_Exception('cannot_merge_any', 'user');
226
+		{
227
+					throw new Elk_Exception('cannot_merge_any', 'user');
228
+		}
210 229
 
211 230
 		// Make sure they can see all boards....
212 231
 		$query_boards = array('boards' => $merger->boards);
213 232
 
214 233
 		if (!in_array(0, $allowedto_merge_boards))
215
-			$query_boards['boards'] = array_merge($query_boards['boards'], $allowedto_merge_boards);
234
+		{
235
+					$query_boards['boards'] = array_merge($query_boards['boards'], $allowedto_merge_boards);
236
+		}
216 237
 
217 238
 		// Saved in a variable to (potentially) save a query later
218 239
 		require_once(SUBSDIR . '/Boards.subs.php');
@@ -224,7 +245,9 @@  discard block
 block discarded – undo
224 245
 		);
225 246
 
226 247
 		if (!in_array(0, $allowedto_merge_boards))
227
-			$boardListOptions['included_boards'] = $allowedto_merge_boards;
248
+		{
249
+					$boardListOptions['included_boards'] = $allowedto_merge_boards;
250
+		}
228 251
 
229 252
 		$context += getBoardList($boardListOptions);
230 253
 
@@ -247,7 +270,9 @@  discard block
 block discarded – undo
247 270
 			$context['target_board'] = $this->_req->getQuery('board', 'intval', 0);
248 271
 
249 272
 			foreach ($merger->topic_data as $id => $topic)
250
-				$context['topics'][$id]['selected'] = $topic['id'] == $merger->firstTopic;
273
+			{
274
+							$context['topics'][$id]['selected'] = $topic['id'] == $merger->firstTopic;
275
+			}
251 276
 
252 277
 			$context['page_title'] = $txt['merge'];
253 278
 			$context['sub_template'] = 'merge_extra_options';
Please login to merge, or discard this patch.
sources/controllers/Memberlist.controller.php 1 patch
Braces   +84 added lines, -34 removed lines patch added patch discarded remove patch
@@ -51,7 +51,9 @@  discard block
 block discarded – undo
51 51
 		$context['in_search'] = !empty($this->_req->post->search);
52 52
 
53 53
 		foreach ($context['custom_search_fields'] as $field)
54
-			$this->_search_fields['cust_' . $field['colname']] = sprintf($txt['mlist_search_by'], $field['name']);
54
+		{
55
+					$this->_search_fields['cust_' . $field['colname']] = sprintf($txt['mlist_search_by'], $field['name']);
56
+		}
55 57
 	}
56 58
 
57 59
 	/**
@@ -165,7 +167,9 @@  discard block
 block discarded – undo
165 167
 
166 168
 		// Add in any custom profile columns
167 169
 		if (ml_CustomProfile())
168
-			$context['columns'] += $context['custom_profile_fields']['columns'];
170
+		{
171
+					$context['columns'] += $context['custom_profile_fields']['columns'];
172
+		}
169 173
 
170 174
 		// The template may appreciate how many columns it needs to display
171 175
 		$context['colspan'] = 0;
@@ -196,8 +200,9 @@  discard block
 block discarded – undo
196 200
 				'view_all_members' => array('text' => 'view_all_members', 'image' => 'mlist.png', 'lang' => true, 'url' => $scripturl . '?action=memberlist;sa=all', 'active' => true),
197 201
 			);
198 202
 		}
199
-		else
200
-			$context['memberlist_buttons'] = array();
203
+		else {
204
+					$context['memberlist_buttons'] = array();
205
+		}
201 206
 
202 207
 		// Make fields available to the template
203 208
 		$context['search_fields'] = $this->_search_fields;
@@ -209,17 +214,26 @@  discard block
 block discarded – undo
209 214
 		call_integration_hook('integrate_memberlist_buttons');
210 215
 
211 216
 		if (!allowedTo('send_email_to_members'))
212
-			unset($context['columns']['email_address']);
217
+		{
218
+					unset($context['columns']['email_address']);
219
+		}
213 220
 		if (isset($context['disabled_fields']['website']))
214
-			unset($context['columns']['website']);
221
+		{
222
+					unset($context['columns']['website']);
223
+		}
215 224
 		if (isset($context['disabled_fields']['posts']))
216
-			unset($context['columns']['posts']);
225
+		{
226
+					unset($context['columns']['posts']);
227
+		}
217 228
 
218 229
 		// Jump to the sub action.
219 230
 		if (isset($subActions[$context['listing_by']]))
220
-			$this->{$subActions[$context['listing_by']][1]}();
221
-		else
222
-			$this->{$subActions['all'][1]}();
231
+		{
232
+					$this->{$subActions[$context['listing_by']][1]}();
233
+		}
234
+		else {
235
+					$this->{$subActions['all'][1]}();
236
+		}
223 237
 	}
224 238
 
225 239
 	/**
@@ -257,30 +271,39 @@  discard block
 block discarded – undo
257 271
 		{
258 272
 			// Maybe there's something cached already.
259 273
 			if (!empty($modSettings['memberlist_cache']))
260
-				$memberlist_cache = Util::unserialize($modSettings['memberlist_cache']);
274
+			{
275
+							$memberlist_cache = Util::unserialize($modSettings['memberlist_cache']);
276
+			}
261 277
 
262 278
 			// The chunk size for the cached index.
263 279
 			$cache_step_size = 500;
264 280
 
265 281
 			// Only update the cache if something changed or no cache existed yet.
266 282
 			if (empty($memberlist_cache) || empty($modSettings['memberlist_updated']) || $memberlist_cache['last_update'] < $modSettings['memberlist_updated'])
267
-				$memberlist_cache = ml_memberCache($cache_step_size);
283
+			{
284
+							$memberlist_cache = ml_memberCache($cache_step_size);
285
+			}
268 286
 
269 287
 			$context['num_members'] = $memberlist_cache['num_members'];
270 288
 		}
271 289
 		// Without cache we need an extra query to get the amount of members.
272
-		else
273
-			$context['num_members'] = ml_memberCount();
290
+		else {
291
+					$context['num_members'] = ml_memberCount();
292
+		}
274 293
 
275 294
 		// Set defaults for sort (real_name)
276 295
 		if (!isset($sort) || !isset($context['columns'][$sort]['sort']))
277
-			$sort = 'real_name';
296
+		{
297
+					$sort = 'real_name';
298
+		}
278 299
 
279 300
 		// Looking at a specific rolodex letter?
280 301
 		if (!is_numeric($start))
281 302
 		{
282 303
 			if (preg_match('~^[^\'\\\\/]~u', Util::strtolower($start), $match) === 0)
283
-				throw new Elk_Exception('Hacker?', false);
304
+			{
305
+							throw new Elk_Exception('Hacker?', false);
306
+			}
284 307
 
285 308
 			$start = ml_alphaStart($match[0]);
286 309
 		}
@@ -288,7 +311,9 @@  discard block
 block discarded – undo
288 311
 		// Build out the letter selection link bar
289 312
 		$context['letter_links'] = '';
290 313
 		for ($i = 97; $i < 123; $i++)
291
-			$context['letter_links'] .= '<a href="' . $scripturl . '?action=memberlist;sa=all;start=' . chr($i) . '#letter' . chr($i) . '">' . chr($i - 32) . '</a> ';
314
+		{
315
+					$context['letter_links'] .= '<a href="' . $scripturl . '?action=memberlist;sa=all;start=' . chr($i) . '#letter' . chr($i) . '">' . chr($i - 32) . '</a> ';
316
+		}
292 317
 
293 318
 		// Sort out the column information.
294 319
 		foreach ($context['columns'] as $col => $column_details)
@@ -304,7 +329,9 @@  discard block
 block discarded – undo
304 329
 			$context['columns'][$col]['link'] = '<a href="' . $context['columns'][$col]['href'] . '" rel="nofollow">' . $context['columns'][$col]['label'] . '</a>';
305 330
 			$context['columns'][$col]['selected'] = $sort == $col;
306 331
 			if ($context['columns'][$col]['selected'])
307
-				$context['columns'][$col]['class'] .= ' selected';
332
+			{
333
+							$context['columns'][$col]['class'] .= ' selected';
334
+			}
308 335
 		}
309 336
 
310 337
 		// Are we sorting the results
@@ -350,7 +377,9 @@  discard block
 block discarded – undo
350 377
 		{
351 378
 			$first_offset = floor(($memberlist_cache['num_members'] - $modSettings['defaultMaxMembers'] - $start) / $cache_step_size) * $cache_step_size;
352 379
 			if ($first_offset < 0)
353
-				$first_offset = 0;
380
+			{
381
+							$first_offset = 0;
382
+			}
354 383
 			$second_offset = ceil(($memberlist_cache['num_members'] - $start) / $cache_step_size) * $cache_step_size;
355 384
 
356 385
 			$where = 'mem.real_name BETWEEN {string:real_name_low} AND {string:real_name_high}';
@@ -361,7 +390,9 @@  discard block
 block discarded – undo
361 390
 
362 391
 		// Add custom fields parameters too.
363 392
 		if (!empty($context['custom_profile_fields']['parameters']))
364
-			$query_parameters += $context['custom_profile_fields']['parameters'];
393
+		{
394
+					$query_parameters += $context['custom_profile_fields']['parameters'];
395
+		}
365 396
 
366 397
 		// Select the members from the database.
367 398
 		ml_selectMembers($query_parameters, $where, $limit, $sort);
@@ -413,17 +444,23 @@  discard block
 block discarded – undo
413 444
 			foreach ($input_fields as $val)
414 445
 			{
415 446
 				if (in_array($val, $fields_key))
416
-					$context['search_defaults'] = $input_fields;
447
+				{
448
+									$context['search_defaults'] = $input_fields;
449
+				}
417 450
 			}
418 451
 			$context['old_search_value'] = $search;
419 452
 
420 453
 			// No fields?  Use default...
421 454
 			if (empty($input_fields))
422
-				$input_fields = array('name');
455
+			{
456
+							$input_fields = array('name');
457
+			}
423 458
 
424 459
 			// Set defaults for how the results are sorted
425 460
 			if (!isset($sort) || !isset($context['columns'][$sort]))
426
-				$sort = 'real_name';
461
+			{
462
+							$sort = 'real_name';
463
+			}
427 464
 
428 465
 			// Build the column link / sort information.
429 466
 			foreach ($context['columns'] as $col => $column_details)
@@ -431,7 +468,9 @@  discard block
 block discarded – undo
431 468
 				$context['columns'][$col]['href'] = $scripturl . '?action=memberlist;sa=search;start=0;sort=' . $col;
432 469
 
433 470
 				if ((!isset($desc) && $col == $sort) || ($col != $sort && !empty($column_details['default_sort_rev'])))
434
-					$context['columns'][$col]['href'] .= ';desc';
471
+				{
472
+									$context['columns'][$col]['href'] .= ';desc';
473
+				}
435 474
 
436 475
 				$context['columns'][$col]['href'] .= ';search=' . $search . ';fields=' . implode(',', $input_fields);
437 476
 				$context['columns'][$col]['link'] = '<a href="' . $context['columns'][$col]['href'] . '" rel="nofollow">' . $context['columns'][$col]['label'] . '</a>';
@@ -455,17 +494,24 @@  discard block
 block discarded – undo
455 494
 
456 495
 			// Search for a name
457 496
 			if (in_array('name', $input_fields))
458
-				$fields = allowedTo('moderate_forum') ? array('member_name', 'real_name') : array('real_name');
459
-			else
460
-				$fields = array();
497
+			{
498
+							$fields = allowedTo('moderate_forum') ? array('member_name', 'real_name') : array('real_name');
499
+			}
500
+			else {
501
+							$fields = array();
502
+			}
461 503
 
462 504
 			// Search for websites.
463 505
 			if (in_array('website', $input_fields))
464
-				$fields += array(7 => 'website_title', 'website_url');
506
+			{
507
+							$fields += array(7 => 'website_title', 'website_url');
508
+			}
465 509
 
466 510
 			// Search for groups.
467 511
 			if (in_array('group', $input_fields))
468
-				$fields += array(9 => 'COALESCE(group_name, {string:blank_string})');
512
+			{
513
+							$fields += array(9 => 'COALESCE(group_name, {string:blank_string})');
514
+			}
469 515
 
470 516
 			// Search for an email address?
471 517
 			if (in_array('email', $input_fields))
@@ -473,8 +519,9 @@  discard block
 block discarded – undo
473 519
 				$fields += array(2 => allowedTo('moderate_forum') ? 'email_address' : '(hide_email = 0 AND email_address');
474 520
 				$condition = allowedTo('moderate_forum') ? '' : ')';
475 521
 			}
476
-			else
477
-				$condition = '';
522
+			else {
523
+							$condition = '';
524
+			}
478 525
 
479 526
 			if (defined('DB_CASE_SENSITIVE'))
480 527
 			{
@@ -517,7 +564,9 @@  discard block
 block discarded – undo
517 564
 			}
518 565
 
519 566
 			if (empty($fields))
520
-				redirectexit('action=memberlist');
567
+			{
568
+							redirectexit('action=memberlist');
569
+			}
521 570
 
522 571
 			$validFields = array_unique($validFields);
523 572
 			$query = $search == '' ? '= {string:blank_string}' : (defined('DB_CASE_SENSITIVE') ? 'LIKE LOWER({string:search})' : 'LIKE {string:search}');
@@ -528,8 +577,9 @@  discard block
 block discarded – undo
528 577
 			$context['letter_links'] = '';
529 578
 			$context['page_index'] = constructPageIndex($scripturl . '?action=memberlist;sa=search;search=' . $search . ';fields=' . implode(',', $validFields), $start, $numResults, $modSettings['defaultMaxMembers']);
530 579
 		}
531
-		else
532
-			redirectexit('action=memberlist');
580
+		else {
581
+					redirectexit('action=memberlist');
582
+		}
533 583
 
534 584
 		$context['linktree'][] = array(
535 585
 			'url' => $scripturl . '?action=memberlist;sa=search',
Please login to merge, or discard this patch.
sources/controllers/OpenID.controller.php 1 patch
Braces   +42 added lines, -15 removed lines patch added patch discarded remove patch
@@ -47,15 +47,21 @@  discard block
 block discarded – undo
47 47
 
48 48
 		// Is OpenID even enabled?
49 49
 		if (empty($modSettings['enableOpenID']))
50
-			throw new Elk_Exception('no_access', false);
50
+		{
51
+					throw new Elk_Exception('no_access', false);
52
+		}
51 53
 
52 54
 		// The OpenID provider did not respond with the OpenID mode? Throw an error..
53 55
 		if (!isset($this->_req->query->openid_mode))
54
-			throw new Elk_Exception('openid_return_no_mode', false);
56
+		{
57
+					throw new Elk_Exception('openid_return_no_mode', false);
58
+		}
55 59
 
56 60
 		// @todo Check for error status!
57 61
 		if ($this->_req->query->openid_mode !== 'id_res')
58
-			throw new Elk_Exception('openid_not_resolved');
62
+		{
63
+					throw new Elk_Exception('openid_not_resolved');
64
+		}
59 65
 
60 66
 		// We'll need our subs.
61 67
 		require_once(SUBSDIR . '/OpenID.subs.php');
@@ -73,7 +79,9 @@  discard block
 block discarded – undo
73 79
 
74 80
 		// Did they tell us to remove any associations?
75 81
 		if (!empty($this->_req->query->openid_invalidate_handle))
76
-			$openID->removeAssociation($this->_req->query->openid_invalidate_handle);
82
+		{
83
+					$openID->removeAssociation($this->_req->query->openid_invalidate_handle);
84
+		}
77 85
 
78 86
 		// Get the OpenID server info.
79 87
 		$server_info = $openID->getServerInfo($this->_req->query->openid_identity);
@@ -81,20 +89,28 @@  discard block
 block discarded – undo
81 89
 		// Get the association data.
82 90
 		$assoc = $openID->getAssociation($server_info['server'], $this->_req->query->openid_assoc_handle, true);
83 91
 		if ($assoc === null)
84
-			throw new Elk_Exception('openid_no_assoc');
92
+		{
93
+					throw new Elk_Exception('openid_no_assoc');
94
+		}
85 95
 
86 96
 		// Verify the OpenID signature.
87 97
 		if (!$this->_verify_string($assoc['secret']))
88
-			throw new Elk_Exception('openid_sig_invalid', 'critical');
98
+		{
99
+					throw new Elk_Exception('openid_sig_invalid', 'critical');
100
+		}
89 101
 
90 102
 		if (!isset($_SESSION['openid']['saved_data'][$this->_req->query->t]))
91
-			throw new Elk_Exception('openid_load_data');
103
+		{
104
+					throw new Elk_Exception('openid_load_data');
105
+		}
92 106
 
93 107
 		$openid_uri = $_SESSION['openid']['saved_data'][$this->_req->query->t]['openid_uri'];
94 108
 		$modSettings['cookieTime'] = $_SESSION['openid']['saved_data'][$this->_req->query->t]['cookieTime'];
95 109
 
96 110
 		if (empty($openid_uri))
97
-			throw new Elk_Exception('openid_load_data');
111
+		{
112
+					throw new Elk_Exception('openid_load_data');
113
+		}
98 114
 
99 115
 		// Any save fields to restore?
100 116
 		$openid_save_fields = isset($this->_req->query->sf) ? json_decode(base64_decode($this->_req->query->sf), true) : array();
@@ -127,11 +143,17 @@  discard block
 block discarded – undo
127 143
 			);
128 144
 
129 145
 			if (isset($this->_req->query->openid_sreg_nickname))
130
-				$_SESSION['openid']['nickname'] = $this->_req->query->openid_sreg_nickname;
146
+			{
147
+							$_SESSION['openid']['nickname'] = $this->_req->query->openid_sreg_nickname;
148
+			}
131 149
 			if (isset($this->_req->query->openid_sreg_email))
132
-				$_SESSION['openid']['email'] = $this->_req->query->openid_sreg_email;
150
+			{
151
+							$_SESSION['openid']['email'] = $this->_req->query->openid_sreg_email;
152
+			}
133 153
 			if (isset($this->_req->query->openid_sreg_dob))
134
-				$_SESSION['openid']['dob'] = $this->_req->query->openid_sreg_dob;
154
+			{
155
+							$_SESSION['openid']['dob'] = $this->_req->query->openid_sreg_dob;
156
+			}
135 157
 
136 158
 			// Were we just verifying the registration state?
137 159
 			if (isset($this->_req->query->sa) && $this->_req->query->sa === 'register2')
@@ -140,7 +162,9 @@  discard block
 block discarded – undo
140 162
 				if (!empty($openid_save_fields))
141 163
 				{
142 164
 					foreach ($openid_save_fields as $id => $value)
143
-						$this->_req->post->{$id} = $value;
165
+					{
166
+											$this->_req->post->{$id} = $value;
167
+					}
144 168
 				}
145 169
 
146 170
 				$controller = new Register_Controller(new Event_Manager());
@@ -148,8 +172,9 @@  discard block
 block discarded – undo
148 172
 				$controller->do_register(true);
149 173
 				return null;
150 174
 			}
151
-			else
152
-				redirectexit('action=register');
175
+			else {
176
+							redirectexit('action=register');
177
+			}
153 178
 		}
154 179
 		elseif (isset($this->_req->query->sa) && $this->_req->query->sa === 'revalidate' && $user_settings['openid_uri'] == $openid_uri)
155 180
 		{
@@ -181,7 +206,9 @@  discard block
 block discarded – undo
181 206
 
182 207
 			// Activation required?
183 208
 			if (!checkActivation())
184
-				return false;
209
+			{
210
+							return false;
211
+			}
185 212
 
186 213
 			// Finally do the login.
187 214
 			doLogin();
Please login to merge, or discard this patch.
sources/controllers/MarkRead.controller.php 1 patch
Braces   +54 added lines, -24 removed lines patch added patch discarded remove patch
@@ -123,8 +123,9 @@  discard block
 block discarded – undo
123 123
 
124 124
 				return;
125 125
 			}
126
-			else
127
-				obExit(false);
126
+			else {
127
+							obExit(false);
128
+			}
128 129
 		}
129 130
 
130 131
 		$this->_dispatch();
@@ -138,8 +139,9 @@  discard block
 block discarded – undo
138 139
 			);
139 140
 		}
140 141
 		// No need to do anything, just die :'(
141
-		else
142
-			obExit(false);
142
+		else {
143
+					obExit(false);
144
+		}
143 145
 	}
144 146
 
145 147
 	/**
@@ -200,12 +202,16 @@  discard block
 block discarded – undo
200 202
 
201 203
 		$markRead = array();
202 204
 		foreach ($topics as $id_topic)
203
-			$markRead[] = array($user_info['id'], (int) $id_topic, $modSettings['maxMsgID'], (int) !empty($logged_topics[$id_topic]));
205
+		{
206
+					$markRead[] = array($user_info['id'], (int) $id_topic, $modSettings['maxMsgID'], (int) !empty($logged_topics[$id_topic]));
207
+		}
204 208
 
205 209
 		markTopicsRead($markRead, true);
206 210
 
207 211
 		if (isset($_SESSION['topicseen_cache']))
208
-			$_SESSION['topicseen_cache'] = array();
212
+		{
213
+					$_SESSION['topicseen_cache'] = array();
214
+		}
209 215
 
210 216
 		return 'action=unreadreplies';
211 217
 	}
@@ -231,17 +237,24 @@  discard block
 block discarded – undo
231 237
 		{
232 238
 			// If they read the whole topic, go back to the beginning.
233 239
 			if ($topic_msg_id >= $topicinfo['id_last_msg'])
234
-				$earlyMsg = 0;
240
+			{
241
+							$earlyMsg = 0;
242
+			}
235 243
 			// If they want to mark the whole thing read, same.
236 244
 			elseif ($topic_msg_id <= $topicinfo['id_first_msg'])
237
-				$earlyMsg = 0;
245
+			{
246
+							$earlyMsg = 0;
247
+			}
238 248
 			// Otherwise, get the latest message before the named one.
239
-			else
240
-				$earlyMsg = previousMessage($topic_msg_id, $topic);
249
+			else {
250
+							$earlyMsg = previousMessage($topic_msg_id, $topic);
251
+			}
241 252
 		}
242 253
 		// Marking read from first page?  That's the whole topic.
243 254
 		elseif ($this->_req->query->start == 0)
244
-			$earlyMsg = 0;
255
+		{
256
+					$earlyMsg = 0;
257
+		}
245 258
 		else
246 259
 		{
247 260
 			list ($earlyMsg) = messageAt((int) $this->_req->query->start, $topic);
@@ -280,7 +293,9 @@  discard block
 block discarded – undo
280 293
 		}
281 294
 
282 295
 		if (!empty($board))
283
-			$boards[] = (int) $board;
296
+		{
297
+					$boards[] = (int) $board;
298
+		}
284 299
 
285 300
 		if (isset($this->_req->query->children) && !empty($boards))
286 301
 		{
@@ -291,7 +306,9 @@  discard block
 block discarded – undo
291 306
 		$boards = array_keys(boardsPosts($boards, $categories));
292 307
 
293 308
 		if (empty($boards))
294
-			return '';
309
+		{
310
+					return '';
311
+		}
295 312
 
296 313
 		// Mark boards as read.
297 314
 		markBoardsRead($boards, isset($this->_req->query->unread), true);
@@ -299,7 +316,9 @@  discard block
 block discarded – undo
299 316
 		foreach ($boards as $b)
300 317
 		{
301 318
 			if (isset($_SESSION['topicseen_cache'][$b]))
302
-				$_SESSION['topicseen_cache'][$b] = array();
319
+			{
320
+							$_SESSION['topicseen_cache'][$b] = array();
321
+			}
303 322
 		}
304 323
 
305 324
 		$this->_querystring_board_limits = $this->_req->getQuery('sa') === 'board' ? ';boards=' . implode(',', $boards) . ';start=%d' : '';
@@ -315,29 +334,40 @@  discard block
 block discarded – undo
315 334
 
316 335
 		// The default is the most logical: newest first.
317 336
 		if (!isset($this->_req->query->sort) || !in_array($this->_req->query->sort, $sort_methods))
318
-			$this->_querystring_sort_limits = isset($this->_req->query->asc) ? ';asc' : '';
337
+		{
338
+					$this->_querystring_sort_limits = isset($this->_req->query->asc) ? ';asc' : '';
339
+		}
319 340
 		// But, for other methods the default sort is ascending.
320
-		else
321
-			$this->_querystring_sort_limits = ';sort=' . $this->_req->query->sort . (isset($this->_req->query->desc) ? ';desc' : '');
341
+		else {
342
+					$this->_querystring_sort_limits = ';sort=' . $this->_req->query->sort . (isset($this->_req->query->desc) ? ';desc' : '');
343
+		}
322 344
 
323 345
 		if (!isset($this->_req->query->unread))
324 346
 		{
325 347
 			// Find all boards with the parents in the board list
326 348
 			$boards_to_add = accessibleBoards(null, $boards);
327 349
 			if (!empty($boards_to_add))
328
-				markBoardsRead($boards_to_add);
350
+			{
351
+							markBoardsRead($boards_to_add);
352
+			}
329 353
 
330 354
 			if (empty($board))
331
-				return '';
332
-			else
333
-				return 'board=' . $board . '.0';
355
+			{
356
+							return '';
357
+			}
358
+			else {
359
+							return 'board=' . $board . '.0';
360
+			}
334 361
 		}
335 362
 		else
336 363
 		{
337 364
 			if (empty($board_info['parent']))
338
-				return '';
339
-			else
340
-				return 'board=' . $board_info['parent'] . '.0';
365
+			{
366
+							return '';
367
+			}
368
+			else {
369
+							return 'board=' . $board_info['parent'] . '.0';
370
+			}
341 371
 		}
342 372
 	}
343 373
 }
344 374
\ No newline at end of file
Please login to merge, or discard this patch.
sources/controllers/ProfileInfo.controller.php 2 patches
Braces   +90 added lines, -36 removed lines patch added patch discarded remove patch
@@ -51,13 +51,17 @@  discard block
 block discarded – undo
51 51
 		$this->_memID = currentMemberID();
52 52
 
53 53
 		if (!isset($context['user']['is_owner']))
54
-			$context['user']['is_owner'] = (int) $this->_memID === (int) $user_info['id'];
54
+		{
55
+					$context['user']['is_owner'] = (int) $this->_memID === (int) $user_info['id'];
56
+		}
55 57
 
56 58
 		loadLanguage('Profile');
57 59
 
58 60
 		// Attempt to load the member's profile data.
59 61
 		if (!loadMemberContext($this->_memID) || !isset($memberContext[$this->_memID]))
60
-			throw new Elk_Exception('not_a_user', false);
62
+		{
63
+					throw new Elk_Exception('not_a_user', false);
64
+		}
61 65
 	}
62 66
 
63 67
 	/**
@@ -469,14 +473,20 @@  discard block
 block discarded – undo
469 473
 
470 474
 		// Is the load average too high to allow searching just now?
471 475
 		if (!empty($modSettings['loadavg_show_posts']) && $modSettings['current_load'] >= $modSettings['loadavg_show_posts'])
472
-			throw new Elk_Exception('loadavg_show_posts_disabled', false);
476
+		{
477
+					throw new Elk_Exception('loadavg_show_posts_disabled', false);
478
+		}
473 479
 
474 480
 		// If we're specifically dealing with attachments use that function!
475 481
 		if ($action === 'attach')
476
-			return $this->action_showAttachments();
482
+		{
483
+					return $this->action_showAttachments();
484
+		}
477 485
 		// Instead, if we're dealing with unwatched topics (and the feature is enabled) use that other function.
478 486
 		elseif ($action === 'unwatchedtopics' && $modSettings['enable_unwatch'])
479
-			return $this->action_showUnwatched();
487
+		{
488
+					return $this->action_showUnwatched();
489
+		}
480 490
 
481 491
 		// Are we just viewing topics?
482 492
 		$context['is_topics'] = $action === 'topics' ? true : false;
@@ -495,9 +505,12 @@  discard block
 block discarded – undo
495 505
 		}
496 506
 
497 507
 		if ($context['is_topics'])
498
-			$msgCount = count_user_topics($this->_memID, $board);
499
-		else
500
-			$msgCount = count_user_posts($this->_memID, $board);
508
+		{
509
+					$msgCount = count_user_topics($this->_memID, $board);
510
+		}
511
+		else {
512
+					$msgCount = count_user_posts($this->_memID, $board);
513
+		}
501 514
 
502 515
 		list ($min_msg_member, $max_msg_member) = findMinMaxUserMessage($this->_memID, $board);
503 516
 		$range_limit = '';
@@ -527,15 +540,19 @@  discard block
 block discarded – undo
527 540
 				$margin *= 5;
528 541
 				$range_limit = $reverse ? 't.id_first_msg < ' . ($min_msg_member + $margin) : 't.id_first_msg > ' . ($max_msg_member - $margin);
529 542
 			}
530
-			else
531
-				$range_limit = $reverse ? 'm.id_msg < ' . ($min_msg_member + $margin) : 'm.id_msg > ' . ($max_msg_member - $margin);
543
+			else {
544
+							$range_limit = $reverse ? 'm.id_msg < ' . ($min_msg_member + $margin) : 'm.id_msg > ' . ($max_msg_member - $margin);
545
+			}
532 546
 		}
533 547
 
534 548
 		// Find this user's posts or topics started
535 549
 		if ($context['is_topics'])
536
-			$rows = load_user_topics($this->_memID, $start, $maxIndex, $range_limit, $reverse, $board);
537
-		else
538
-			$rows = load_user_posts($this->_memID, $start, $maxIndex, $range_limit, $reverse, $board);
550
+		{
551
+					$rows = load_user_topics($this->_memID, $start, $maxIndex, $range_limit, $reverse, $board);
552
+		}
553
+		else {
554
+					$rows = load_user_posts($this->_memID, $start, $maxIndex, $range_limit, $reverse, $board);
555
+		}
539 556
 
540 557
 		// Start counting at the number of the first message displayed.
541 558
 		$counter = $reverse ? $context['start'] + $maxIndex + 1 : $context['start'];
@@ -613,17 +630,22 @@  discard block
 block discarded – undo
613 630
 			);
614 631
 
615 632
 			if ($user_info['id'] == $row['id_member_started'])
616
-				$board_ids['own'][$row['id_board']][] = $counter;
633
+			{
634
+							$board_ids['own'][$row['id_board']][] = $counter;
635
+			}
617 636
 			$board_ids['any'][$row['id_board']][] = $counter;
618 637
 		}
619 638
 
620 639
 		// All posts were retrieved in reverse order, get them right again.
621 640
 		if ($reverse)
622
-			$context['posts'] = array_reverse($context['posts'], true);
641
+		{
642
+					$context['posts'] = array_reverse($context['posts'], true);
643
+		}
623 644
 
624 645
 		// These are all the permissions that are different from board to board..
625 646
 		if ($context['is_topics'])
626
-			$permissions = array(
647
+		{
648
+					$permissions = array(
627 649
 				'own' => array(
628 650
 					'post_reply_own' => 'can_reply',
629 651
 				),
@@ -632,8 +654,9 @@  discard block
 block discarded – undo
632 654
 					'mark_any_notify' => 'can_mark_notify',
633 655
 				)
634 656
 			);
635
-		else
636
-			$permissions = array(
657
+		}
658
+		else {
659
+					$permissions = array(
637 660
 				'own' => array(
638 661
 					'post_reply_own' => 'can_reply',
639 662
 					'delete_own' => 'can_delete',
@@ -644,6 +667,7 @@  discard block
 block discarded – undo
644 667
 					'delete_any' => 'can_delete',
645 668
 				)
646 669
 			);
670
+		}
647 671
 
648 672
 		// For every permission in the own/any lists...
649 673
 		foreach ($permissions as $type => $list)
@@ -655,18 +679,24 @@  discard block
 block discarded – undo
655 679
 
656 680
 				// Hmm, they can do it on all boards, can they?
657 681
 				if (!empty($boards) && $boards[0] == 0)
658
-					$boards = array_keys($board_ids[$type]);
682
+				{
683
+									$boards = array_keys($board_ids[$type]);
684
+				}
659 685
 
660 686
 				// Now go through each board they can do the permission on.
661 687
 				foreach ($boards as $board_id)
662 688
 				{
663 689
 					// There aren't any posts displayed from this board.
664 690
 					if (!isset($board_ids[$type][$board_id]))
665
-						continue;
691
+					{
692
+											continue;
693
+					}
666 694
 
667 695
 					// Set the permission to true ;).
668 696
 					foreach ($board_ids[$type][$board_id] as $counter)
669
-						$context['posts'][$counter]['tests'][$allowed] = true;
697
+					{
698
+											$context['posts'][$counter]['tests'][$allowed] = true;
699
+					}
670 700
 				}
671 701
 			}
672 702
 		}
@@ -692,7 +722,9 @@  discard block
 block discarded – undo
692 722
 
693 723
 		// Make sure we can't actually see anything...
694 724
 		if (empty($boardsAllowed))
695
-			$boardsAllowed = array(-1);
725
+		{
726
+					$boardsAllowed = array(-1);
727
+		}
696 728
 
697 729
 		// This is all the information required to list attachments.
698 730
 		$listOptions = array(
@@ -742,9 +774,12 @@  discard block
 block discarded – undo
742 774
 							global $scripturl;
743 775
 
744 776
 							if ($rowData['is_image'] && !empty($rowData['id_thumb']))
745
-								return '<img src="' . $scripturl . '?action=dlattach;attach=' . $rowData['id_thumb'] . ';image" />';
746
-							else
747
-								return '<img src="' . $scripturl . '?action=dlattach;attach=' . $rowData['id'] . ';thumb" />';
777
+							{
778
+															return '<img src="' . $scripturl . '?action=dlattach;attach=' . $rowData['id_thumb'] . ';image" />';
779
+							}
780
+							else {
781
+															return '<img src="' . $scripturl . '?action=dlattach;attach=' . $rowData['id'] . ';thumb" />';
782
+							}
748 783
 						},
749 784
 						'class' => 'centertext recent_attachments',
750 785
 					),
@@ -812,7 +847,9 @@  discard block
 block discarded – undo
812 847
 
813 848
 		// Only the owner can see the list (if the function is enabled of course)
814 849
 		if ($user_info['id'] != $this->_memID || !$modSettings['enable_unwatch'])
815
-			return;
850
+		{
851
+					return;
852
+		}
816 853
 
817 854
 		// And here they are: the topics you don't like
818 855
 		$listOptions = array(
@@ -928,7 +965,9 @@  discard block
 block discarded – undo
928 965
 
929 966
 		// Is the load average too high to allow searching just now?
930 967
 		if (!empty($modSettings['loadavg_userstats']) && $modSettings['current_load'] >= $modSettings['loadavg_userstats'])
931
-			throw new Elk_Exception('loadavg_userstats_disabled', false);
968
+		{
969
+					throw new Elk_Exception('loadavg_userstats_disabled', false);
970
+		}
932 971
 
933 972
 		loadTemplate('ProfileInfo');
934 973
 
@@ -999,9 +1038,12 @@  discard block
 block discarded – undo
999 1038
 
1000 1039
 		// Determine which groups this user is in.
1001 1040
 		if (empty($user_profile[$this->_memID]['additional_groups']))
1002
-			$curGroups = array();
1003
-		else
1004
-			$curGroups = explode(',', $user_profile[$this->_memID]['additional_groups']);
1041
+		{
1042
+					$curGroups = array();
1043
+		}
1044
+		else {
1045
+					$curGroups = explode(',', $user_profile[$this->_memID]['additional_groups']);
1046
+		}
1005 1047
 
1006 1048
 		$curGroups[] = $user_profile[$this->_memID]['id_group'];
1007 1049
 		$curGroups[] = $user_profile[$this->_memID]['id_post_group'];
@@ -1015,13 +1057,16 @@  discard block
 block discarded – undo
1015 1057
 		foreach ($board_list as $row)
1016 1058
 		{
1017 1059
 			if (count(array_intersect($curGroups, explode(',', $row['member_groups']))) === 0 && !$row['is_mod'])
1018
-				$context['no_access_boards'][] = array(
1060
+			{
1061
+							$context['no_access_boards'][] = array(
1019 1062
 					'id' => $row['id_board'],
1020 1063
 					'name' => $row['board_name'],
1021 1064
 					'is_last' => false,
1022 1065
 				);
1066
+			}
1023 1067
 			elseif ($row['id_profile'] != 1 || $row['is_mod'])
1024
-				$context['boards'][$row['id_board']] = array(
1068
+			{
1069
+							$context['boards'][$row['id_board']] = array(
1025 1070
 					'id' => $row['id_board'],
1026 1071
 					'name' => $row['board_name'],
1027 1072
 					'url' => $scripturl, '?board=', $row['id_board'], '.0',
@@ -1029,10 +1074,13 @@  discard block
 block discarded – undo
1029 1074
 					'profile' => $row['id_profile'],
1030 1075
 					'profile_name' => $context['profiles'][$row['id_profile']]['name'],
1031 1076
 				);
1077
+			}
1032 1078
 		}
1033 1079
 
1034 1080
 		if (!empty($context['no_access_boards']))
1035
-			$context['no_access_boards'][count($context['no_access_boards']) - 1]['is_last'] = true;
1081
+		{
1082
+					$context['no_access_boards'][count($context['no_access_boards']) - 1]['is_last'] = true;
1083
+		}
1036 1084
 
1037 1085
 		$context['member']['permissions'] = array(
1038 1086
 			'general' => array(),
@@ -1042,7 +1090,9 @@  discard block
 block discarded – undo
1042 1090
 		// If you're an admin we know you can do everything, we might as well leave.
1043 1091
 		$context['member']['has_all_permissions'] = in_array(1, $curGroups);
1044 1092
 		if ($context['member']['has_all_permissions'])
1045
-			return;
1093
+		{
1094
+					return;
1095
+		}
1046 1096
 
1047 1097
 		// Get all general permissions for the groups this member is in
1048 1098
 		$context['member']['permissions']['general'] = getMemberGeneralPermissions($curGroups);
@@ -1060,7 +1110,9 @@  discard block
 block discarded – undo
1060 1110
 
1061 1111
 		// Firstly, can we actually even be here?
1062 1112
 		if (!allowedTo('issue_warning') && (empty($modSettings['warning_show']) || ($modSettings['warning_show'] == 1 && !$context['user']['is_owner'])))
1063
-			throw new Elk_Exception('no_access', false);
1113
+		{
1114
+					throw new Elk_Exception('no_access', false);
1115
+		}
1064 1116
 
1065 1117
 		loadTemplate('ProfileInfo');
1066 1118
 
@@ -1154,7 +1206,9 @@  discard block
 block discarded – undo
1154 1206
 		foreach ($context['level_effects'] as $limit => $dummy)
1155 1207
 		{
1156 1208
 			if ($context['member']['warning'] >= $limit)
1157
-				$context['current_level'] = $limit;
1209
+			{
1210
+							$context['current_level'] = $limit;
1211
+			}
1158 1212
 		}
1159 1213
 	}
1160 1214
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 				),
716 716
 			),
717 717
 			'data_check' => array(
718
-				'class' => function ($data) {
718
+				'class' => function($data) {
719 719
 					return $data['approved'] ? '' : 'approvebg';
720 720
 				},
721 721
 			),
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 						'value' => '',
739 739
 					),
740 740
 					'data' => array(
741
-						'function' => function ($rowData) {
741
+						'function' => function($rowData) {
742 742
 							global $scripturl;
743 743
 
744 744
 							if ($rowData['is_image'] && !empty($rowData['id_thumb']))
Please login to merge, or discard this patch.
sources/controllers/Reminder.controller.php 1 patch
Braces   +66 added lines, -24 removed lines patch added patch discarded remove patch
@@ -85,12 +85,16 @@  discard block
 block discarded – undo
85 85
 
86 86
 		// You must enter a username/email address.
87 87
 		if (empty($where))
88
-			throw new Elk_Exception('username_no_exist', false);
88
+		{
89
+					throw new Elk_Exception('username_no_exist', false);
90
+		}
89 91
 
90 92
 		// Make sure we are not being slammed
91 93
 		// Don't call this if you're coming from the "Choose a reminder type" page - otherwise you'll likely get an error
92 94
 		if (!isset($this->_req->post->reminder_type) || !in_array($this->_req->post->reminder_type, array('email', 'secret')))
93
-			spamProtection('remind');
95
+		{
96
+					spamProtection('remind');
97
+		}
94 98
 
95 99
 		// Find this member
96 100
 		$member = findUser($where, $where_params);
@@ -102,15 +106,20 @@  discard block
 block discarded – undo
102 106
 		{
103 107
 			// Awaiting approval...
104 108
 			if (trim($member['validation_code']) === '')
105
-				throw new Elk_Exception($txt['registration_not_approved'] . ' <a class="linkbutton" href="' . $scripturl . '?action=register;sa=activate;user=' . $this->_req->post->user . '">' . $txt['here'] . '</a>.', false);
106
-			else
107
-				throw new Elk_Exception($txt['registration_not_activated'] . ' <a class="linkbutton" href="' . $scripturl . '?action=register;sa=activate;user=' . $this->_req->post->user . '">' . $txt['here'] . '</a>.', false);
109
+			{
110
+							throw new Elk_Exception($txt['registration_not_approved'] . ' <a class="linkbutton" href="' . $scripturl . '?action=register;sa=activate;user=' . $this->_req->post->user . '">' . $txt['here'] . '</a>.', false);
111
+			}
112
+			else {
113
+							throw new Elk_Exception($txt['registration_not_activated'] . ' <a class="linkbutton" href="' . $scripturl . '?action=register;sa=activate;user=' . $this->_req->post->user . '">' . $txt['here'] . '</a>.', false);
114
+			}
108 115
 		}
109 116
 
110 117
 		// You can't get emailed if you have no email address.
111 118
 		$member['email_address'] = trim($member['email_address']);
112 119
 		if ($member['email_address'] === '')
113
-			throw new Elk_Exception($txt['no_reminder_email'] . '<br />' . $txt['send_email'] . ' <a href="mailto:' . $webmaster_email . '">webmaster</a> ' . $txt['to_ask_password'] . '.');
120
+		{
121
+					throw new Elk_Exception($txt['no_reminder_email'] . '<br />' . $txt['send_email'] . ' <a href="mailto:' . $webmaster_email . '">webmaster</a> ' . $txt['to_ask_password'] . '.');
122
+		}
114 123
 
115 124
 		// If they have no secret question then they can only get emailed the item, or they are requesting the email, send them an email.
116 125
 		if (empty($member['secret_question'])
@@ -149,7 +158,9 @@  discard block
 block discarded – undo
149 158
 		}
150 159
 		// Otherwise are ready to answer the question?
151 160
 		elseif (isset($this->_req->post->reminder_type) && $this->_req->post->reminder_type === 'secret')
152
-			return secretAnswerInput();
161
+		{
162
+					return secretAnswerInput();
163
+		}
153 164
 
154 165
 		// No we're here setup the context for template number 2!
155 166
 		createToken('remind');
@@ -173,7 +184,9 @@  discard block
 block discarded – undo
173 184
 
174 185
 		// You need a code!
175 186
 		if (!isset($this->_req->query->code))
176
-			throw new Elk_Exception('no_access', false);
187
+		{
188
+					throw new Elk_Exception('no_access', false);
189
+		}
177 190
 
178 191
 		// Fill the context array.
179 192
 		$context += array(
@@ -203,13 +216,19 @@  discard block
 block discarded – undo
203 216
 		validateToken('remind-sp');
204 217
 
205 218
 		if (empty($this->_req->post->u) || !isset($this->_req->post->passwrd1, $this->_req->post->passwrd2))
206
-			throw new Elk_Exception('no_access', false);
219
+		{
220
+					throw new Elk_Exception('no_access', false);
221
+		}
207 222
 
208 223
 		if ($this->_req->post->passwrd1 != $this->_req->post->passwrd2)
209
-			throw new Elk_Exception('passwords_dont_match', false);
224
+		{
225
+					throw new Elk_Exception('passwords_dont_match', false);
226
+		}
210 227
 
211 228
 		if ($this->_req->post->passwrd1 === '')
212
-			throw new Elk_Exception('no_password', false);
229
+		{
230
+					throw new Elk_Exception('no_password', false);
231
+		}
213 232
 
214 233
 		$member_id = $this->_req->getPost('u', 'intval', -1);
215 234
 		$code = $this->_req->getPost('code', 'trim', '');
@@ -222,7 +241,9 @@  discard block
 block discarded – undo
222 241
 
223 242
 		// Does this user exist at all? Is he activated? Does he have a validation code?
224 243
 		if (empty($member) || $member['is_activated'] != 1 || $member['validation_code'] === '')
225
-			throw new Elk_Exception('invalid_userid', false);
244
+		{
245
+					throw new Elk_Exception('invalid_userid', false);
246
+		}
226 247
 
227 248
 		// Is the password actually valid to the forums rules?
228 249
 		require_once(SUBSDIR . '/Auth.subs.php');
@@ -230,7 +251,9 @@  discard block
 block discarded – undo
230 251
 
231 252
 		// What - it's not?
232 253
 		if ($passwordError !== null)
233
-			throw new Elk_Exception('profile_error_password_' . $passwordError, false);
254
+		{
255
+					throw new Elk_Exception('profile_error_password_' . $passwordError, false);
256
+		}
234 257
 
235 258
 		// Quit if this code is not right.
236 259
 		if (empty($code) || $member['validation_code'] !== substr(hash('sha256', $code), 0, 10))
@@ -249,9 +272,12 @@  discard block
 block discarded – undo
249 272
 		$sha_passwd = $this->_req->post->passwrd1;
250 273
 		require_once(SUBSDIR . '/Members.subs.php');
251 274
 		if (isset($this->_req->post->otp))
252
-			updateMemberData($member_id, array('validation_code' => '', 'passwd' => validateLoginPassword($sha_passwd, '', $member['member_name'], true), 'enable_otp' => 0));
253
-		else
254
-			updateMemberData($member_id, array('validation_code' => '', 'passwd' => validateLoginPassword($sha_passwd, '', $member['member_name'], true)));
275
+		{
276
+					updateMemberData($member_id, array('validation_code' => '', 'passwd' => validateLoginPassword($sha_passwd, '', $member['member_name'], true), 'enable_otp' => 0));
277
+		}
278
+		else {
279
+					updateMemberData($member_id, array('validation_code' => '', 'passwd' => validateLoginPassword($sha_passwd, '', $member['member_name'], true)));
280
+		}
255 281
 
256 282
 		call_integration_hook('integrate_reset_pass', array($member['member_name'], $member['member_name'], $this->_req->post->passwrd1));
257 283
 
@@ -281,7 +307,9 @@  discard block
 block discarded – undo
281 307
 
282 308
 		// Hacker?  How did you get this far without an email or username?
283 309
 		if (empty($this->_req->post->uid))
284
-			throw new Elk_Exception('username_no_exist', false);
310
+		{
311
+					throw new Elk_Exception('username_no_exist', false);
312
+		}
285 313
 
286 314
 		loadLanguage('Login');
287 315
 
@@ -289,7 +317,9 @@  discard block
 block discarded – undo
289 317
 		require_once(SUBSDIR . '/Members.subs.php');
290 318
 		$member = getBasicMemberData((int) $this->_req->post->uid, array('authentication' => true));
291 319
 		if (empty($member))
292
-			throw new Elk_Exception('username_no_exist', false);
320
+		{
321
+					throw new Elk_Exception('username_no_exist', false);
322
+		}
293 323
 
294 324
 		// Check if the secret answer is correct.
295 325
 		if ($member['secret_question'] === '' || $member['secret_answer'] === '' || md5($this->_req->post->secret_answer) !== $member['secret_answer'])
@@ -308,11 +338,15 @@  discard block
 block discarded – undo
308 338
 
309 339
 		// You can't use a blank one!
310 340
 		if (strlen(trim($this->_req->post->passwrd1)) === 0)
311
-			throw new Elk_Exception('no_password', false);
341
+		{
342
+					throw new Elk_Exception('no_password', false);
343
+		}
312 344
 
313 345
 		// They have to be the same too.
314 346
 		if ($this->_req->post->passwrd1 != $this->_req->post->passwrd2)
315
-			throw new Elk_Exception('passwords_dont_match', false);
347
+		{
348
+					throw new Elk_Exception('passwords_dont_match', false);
349
+		}
316 350
 
317 351
 		// Make sure they have a strong enough password.
318 352
 		require_once(SUBSDIR . '/Auth.subs.php');
@@ -320,7 +354,9 @@  discard block
 block discarded – undo
320 354
 
321 355
 		// Invalid?
322 356
 		if ($passwordError !== null)
323
-			throw new Elk_Exception('profile_error_password_' . $passwordError, false);
357
+		{
358
+					throw new Elk_Exception('profile_error_password_' . $passwordError, false);
359
+		}
324 360
 
325 361
 		// Alright, so long as 'yer sure.
326 362
 		require_once(SUBSDIR . '/Auth.subs.php');
@@ -360,19 +396,25 @@  discard block
 block discarded – undo
360 396
 
361 397
 	// Check they entered something...
362 398
 	if (empty($_POST['uid']))
363
-		throw new Elk_Exception('username_no_exist', false);
399
+	{
400
+			throw new Elk_Exception('username_no_exist', false);
401
+	}
364 402
 
365 403
 	// Get the stuff....
366 404
 	require_once(SUBSDIR . '/Members.subs.php');
367 405
 	$member = getBasicMemberData((int) $_POST['uid'], array('authentication' => true));
368 406
 	if (empty($member))
369
-		throw new Elk_Exception('username_no_exist', false);
407
+	{
408
+			throw new Elk_Exception('username_no_exist', false);
409
+	}
370 410
 
371 411
 	$context['account_type'] = !empty($member['openid_uri']) ? 'openid' : 'password';
372 412
 
373 413
 	// If there is NO secret question - then throw an error.
374 414
 	if (trim($member['secret_question']) === '')
375
-		throw new Elk_Exception('registration_no_secret_question', false);
415
+	{
416
+			throw new Elk_Exception('registration_no_secret_question', false);
417
+	}
376 418
 
377 419
 	// Ask for the answer...
378 420
 	$context['remind_user'] = $member['id_member'];
Please login to merge, or discard this patch.
sources/controllers/ProfileSubscriptions.controller.php 1 patch
Braces   +33 added lines, -12 removed lines patch added patch discarded remove patch
@@ -80,12 +80,16 @@  discard block
 block discarded – undo
80 80
 			$this->_gateways[$id] = new $gateway['display_class']();
81 81
 
82 82
 			if (!$this->_gateways[$id]->gatewayEnabled())
83
-				unset($this->_gateways[$id]);
83
+			{
84
+							unset($this->_gateways[$id]);
85
+			}
84 86
 		}
85 87
 
86 88
 		// No gateways yet, no way to pay then, blame the admin !
87 89
 		if (empty($this->_gateways))
88
-			throw new Elk_Exception($txt['paid_admin_not_setup_gateway']);
90
+		{
91
+					throw new Elk_Exception($txt['paid_admin_not_setup_gateway']);
92
+		}
89 93
 
90 94
 		// Get the members current subscriptions.
91 95
 		$context['current'] = loadMemberSubscriptions($memID, $context['subscriptions']);
@@ -94,18 +98,25 @@  discard block
 block discarded – undo
94 98
 		foreach ($context['current'] as $id => $current)
95 99
 		{
96 100
 			if ($current['status'] == 1)
97
-				$context['subscriptions'][$id]['subscribed'] = true;
101
+			{
102
+							$context['subscriptions'][$id]['subscribed'] = true;
103
+			}
98 104
 		}
99 105
 
100 106
 		// Simple "done"?
101 107
 		if (isset($this->_req->query->done))
102
-			$this->_orderDone($memID);
108
+		{
109
+					$this->_orderDone($memID);
110
+		}
103 111
 		// They have selected a subscription to order.
104 112
 		elseif (isset($this->_req->query->confirm) && isset($this->_req->post->sub_id) && is_array($this->_req->post->sub_id))
105
-			$this->_confirmOrder($memID);
113
+		{
114
+					$this->_confirmOrder($memID);
115
+		}
106 116
 		// Show the users whats available and what they have
107
-		else
108
-			$context['sub_template'] = 'user_subscription';
117
+		else {
118
+					$context['sub_template'] = 'user_subscription';
119
+		}
109 120
 	}
110 121
 
111 122
 	/**
@@ -214,7 +225,9 @@  discard block
 block discarded – undo
214 225
 
215 226
 		// Hopefully just one, if not we use the last one.
216 227
 		foreach ($this->_req->post->sub_id as $k => $v)
217
-			$this->_id_sub = (int) $k;
228
+		{
229
+					$this->_id_sub = (int) $k;
230
+		}
218 231
 
219 232
 		// Selecting a subscription that does not exist or is not active?
220 233
 		if (!isset($this->_id_sub, $context['subscriptions'][$this->_id_sub]) || $context['subscriptions'][$this->_id_sub]['active'] == 0)
@@ -250,7 +263,9 @@  discard block
 block discarded – undo
250 263
 
251 264
 		// No active payment gateways, then no way to pay, time to bail out, blame the admin
252 265
 		if (empty($context['gateways']))
253
-			throw new Elk_Exception($txt['paid_admin_not_setup_gateway']);
266
+		{
267
+					throw new Elk_Exception($txt['paid_admin_not_setup_gateway']);
268
+		}
254 269
 
255 270
 		// Now we are going to assume they want to take this out ;)
256 271
 		$new_data = array($this->_order['id'], $context['value'], $period, 'prepay');
@@ -261,18 +276,24 @@  discard block
 block discarded – undo
261 276
 			// What are the details like?
262 277
 			$current_pending = array();
263 278
 			if ($context['current'][$this->_order['id']]['pending_details'] != '')
264
-				$current_pending = Util::unserialize($context['current'][$this->_order['id']]['pending_details']);
279
+			{
280
+							$current_pending = Util::unserialize($context['current'][$this->_order['id']]['pending_details']);
281
+			}
265 282
 
266 283
 			// Don't get silly.
267 284
 			if (count($current_pending) > 9)
268
-				$current_pending = array();
285
+			{
286
+							$current_pending = array();
287
+			}
269 288
 
270 289
 			// Only record real pending payments as will otherwise confuse the admin!
271 290
 			$pending_count = 0;
272 291
 			foreach ($current_pending as $pending)
273 292
 			{
274 293
 				if (trim($pending[3]) === 'payback')
275
-					$pending_count++;
294
+				{
295
+									$pending_count++;
296
+				}
276 297
 			}
277 298
 
278 299
 			// If its already pending, don't increase the pending count
Please login to merge, or discard this patch.
sources/controllers/MessageIndex.controller.php 1 patch
Braces   +102 added lines, -39 removed lines patch added patch discarded remove patch
@@ -171,7 +171,9 @@  discard block
 block discarded – undo
171 171
 		{
172 172
 			// Don't index a sort result etc.
173 173
 			if (!in_array($k, array('board', 'start', $session_name)))
174
-				$context['robot_no_index'] = true;
174
+			{
175
+							$context['robot_no_index'] = true;
176
+			}
175 177
 		}
176 178
 
177 179
 		if (!empty($this->_req->query->start) && (!is_numeric($this->_req->query->start) || $this->_req->query->start % $context['messages_per_page'] != 0))
@@ -202,9 +204,12 @@  discard block
 block discarded – undo
202 204
 
203 205
 		// Make sure the starting place makes sense and construct the page index.
204 206
 		if (isset($this->_req->query->sort))
205
-			$sort_string = ';sort=' . $this->_req->query->sort . (isset($this->_req->query->desc) ? ';desc' : '');
206
-		else
207
-			$sort_string = '';
207
+		{
208
+					$sort_string = ';sort=' . $this->_req->query->sort . (isset($this->_req->query->desc) ? ';desc' : '');
209
+		}
210
+		else {
211
+					$sort_string = '';
212
+		}
208 213
 
209 214
 		$context['page_index'] = constructPageIndex($scripturl . '?board=' . $board . '.%1$d' . $sort_string, $this->_req->query->start, $board_info['total_topics'], $maxindex, true);
210 215
 		$context['start'] = &$this->_req->query->start;
@@ -234,7 +239,9 @@  discard block
 block discarded – undo
234 239
 		if (!empty($board_info['moderators']))
235 240
 		{
236 241
 			foreach ($board_info['moderators'] as $mod)
237
-				$context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt['board_moderator'] . '">' . $mod['name'] . '</a>';
242
+			{
243
+							$context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt['board_moderator'] . '">' . $mod['name'] . '</a>';
244
+			}
238 245
 		}
239 246
 
240 247
 		// Mark current and parent boards as seen.
@@ -249,8 +256,9 @@  discard block
 block discarded – undo
249 256
 				$board_list = array_keys($board_info['parent_boards']);
250 257
 				$board_list[] = $board;
251 258
 			}
252
-			else
253
-				$board_list = array($board);
259
+			else {
260
+							$board_list = array($board);
261
+			}
254 262
 
255 263
 			// Mark boards as read. Boards alone, no need for topics.
256 264
 			markBoardsRead($board_list, false, false);
@@ -276,8 +284,9 @@  discard block
 block discarded – undo
276 284
 			// From now on, they've seen it. So we reset notifications.
277 285
 			$context['is_marked_notify'] = resetSentBoardNotification($user_info['id'], $board);
278 286
 		}
279
-		else
280
-			$context['is_marked_notify'] = false;
287
+		else {
288
+					$context['is_marked_notify'] = false;
289
+		}
281 290
 
282 291
 		// 'Print' the header and board info.
283 292
 		$context['page_title'] = strip_tags($board_info['name']);
@@ -357,8 +366,9 @@  discard block
 block discarded – undo
357 366
 			$maxindex = $board_info['total_topics'] < $start + $maxindex + 1 ? $board_info['total_topics'] - $start : $maxindex;
358 367
 			$start = $board_info['total_topics'] < $start + $maxindex + 1 ? 0 : $board_info['total_topics'] - $start - $maxindex;
359 368
 		}
360
-		else
361
-			$fake_ascending = false;
369
+		else {
370
+					$fake_ascending = false;
371
+		}
362 372
 
363 373
 		$context['topics'] = array();
364 374
 
@@ -383,7 +393,9 @@  discard block
 block discarded – undo
383 393
 
384 394
 		// Fix the sequence of topics if they were retrieved in the wrong order. (for speed reasons...)
385 395
 		if ($fake_ascending)
386
-			$context['topics'] = array_reverse($context['topics'], true);
396
+		{
397
+					$context['topics'] = array_reverse($context['topics'], true);
398
+		}
387 399
 
388 400
 		$topic_ids = array_keys($context['topics']);
389 401
 
@@ -438,10 +450,13 @@  discard block
 block discarded – undo
438 450
 
439 451
 			// Can we use quick moderation checkboxes?
440 452
 			if ($options['display_quick_mod'] == 1)
441
-				$context['can_quick_mod'] = $context['user']['is_logged'] || $context['can_approve'] || $context['can_remove'] || $context['can_lock'] || $context['can_sticky'] || $context['can_move'] || $context['can_merge'] || $context['can_restore'];
453
+			{
454
+							$context['can_quick_mod'] = $context['user']['is_logged'] || $context['can_approve'] || $context['can_remove'] || $context['can_lock'] || $context['can_sticky'] || $context['can_move'] || $context['can_merge'] || $context['can_restore'];
455
+			}
442 456
 			// Or the icons?
443
-			else
444
-				$context['can_quick_mod'] = $context['can_remove'] || $context['can_lock'] || $context['can_sticky'] || $context['can_move'];
457
+			else {
458
+							$context['can_quick_mod'] = $context['can_remove'] || $context['can_lock'] || $context['can_sticky'] || $context['can_move'];
459
+			}
445 460
 		}
446 461
 
447 462
 		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
@@ -451,7 +466,9 @@  discard block
 block discarded – undo
451 466
 		}
452 467
 
453 468
 		if (!empty($context['boards']) && $context['start'] == 0)
454
-			$template_layers->add('display_child_boards');
469
+		{
470
+					$template_layers->add('display_child_boards');
471
+		}
455 472
 
456 473
 		// If there are children, but no topics and no ability to post topics...
457 474
 		$context['no_topic_listing'] = !empty($context['boards']) && empty($context['topics']) && !$context['can_post_new'];
@@ -471,13 +488,15 @@  discard block
 block discarded – undo
471 488
 
472 489
 		// They can only mark read if they are logged in and it's enabled!
473 490
 		if (!$user_info['is_guest'] && $settings['show_mark_read'])
474
-			$context['normal_buttons']['markread'] = array(
491
+		{
492
+					$context['normal_buttons']['markread'] = array(
475 493
 				'text' => 'mark_read_short',
476 494
 				'image' => 'markread.png',
477 495
 				'lang' => true,
478 496
 				'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id'],
479 497
 				'custom' => 'onclick="return markboardreadButton(this);"'
480 498
 			);
499
+		}
481 500
 
482 501
 		// Allow adding new buttons easily.
483 502
 		call_integration_hook('integrate_messageindex_buttons');
@@ -497,10 +516,14 @@  discard block
 block discarded – undo
497 516
 
498 517
 		// Lets go straight to the restore area.
499 518
 		if ($this->_req->getPost('qaction') === 'restore' && !empty($this->_req->post->topics))
500
-			redirectexit('action=restoretopic;topics=' . implode(',', $this->_req->post->topics) . ';' . $context['session_var'] . '=' . $context['session_id']);
519
+		{
520
+					redirectexit('action=restoretopic;topics=' . implode(',', $this->_req->post->topics) . ';' . $context['session_var'] . '=' . $context['session_id']);
521
+		}
501 522
 
502 523
 		if (isset($_SESSION['topicseen_cache']))
503
-			$_SESSION['topicseen_cache'] = array();
524
+		{
525
+					$_SESSION['topicseen_cache'] = array();
526
+		}
504 527
 
505 528
 		// This is going to be needed to send off the notifications and for updateLastMessages().
506 529
 		require_once(SUBSDIR . '/Post.subs.php');
@@ -547,19 +570,33 @@  discard block
 block discarded – undo
547 570
 		}
548 571
 
549 572
 		if (!$user_info['is_guest'])
550
-			$possibleActions[] = 'markread';
573
+		{
574
+					$possibleActions[] = 'markread';
575
+		}
551 576
 		if (!empty($boards_can['make_sticky']))
552
-			$possibleActions[] = 'sticky';
577
+		{
578
+					$possibleActions[] = 'sticky';
579
+		}
553 580
 		if (!empty($boards_can['move_any']) || !empty($boards_can['move_own']))
554
-			$possibleActions[] = 'move';
581
+		{
582
+					$possibleActions[] = 'move';
583
+		}
555 584
 		if (!empty($boards_can['remove_any']) || !empty($boards_can['remove_own']))
556
-			$possibleActions[] = 'remove';
585
+		{
586
+					$possibleActions[] = 'remove';
587
+		}
557 588
 		if (!empty($boards_can['lock_any']) || !empty($boards_can['lock_own']))
558
-			$possibleActions[] = 'lock';
589
+		{
590
+					$possibleActions[] = 'lock';
591
+		}
559 592
 		if (!empty($boards_can['merge_any']))
560
-			$possibleActions[] = 'merge';
593
+		{
594
+					$possibleActions[] = 'merge';
595
+		}
561 596
 		if (!empty($boards_can['approve_posts']))
562
-			$possibleActions[] = 'approve';
597
+		{
598
+					$possibleActions[] = 'approve';
599
+		}
563 600
 
564 601
 		// Two methods: $_REQUEST['actions'] (id_topic => action), and $_REQUEST['topics'] and $this->_req->post->qaction.
565 602
 		// (if action is 'move', $_REQUEST['move_to'] or $_REQUEST['move_tos'][$topic] is used.)
@@ -567,14 +604,18 @@  discard block
 block discarded – undo
567 604
 		{
568 605
 			// If the action isn't valid, just quit now.
569 606
 			if (empty($this->_req->post->qaction) || !in_array($this->_req->post->qaction, $possibleActions))
570
-				redirectexit($redirect_url);
607
+			{
608
+							redirectexit($redirect_url);
609
+			}
571 610
 
572 611
 			// Merge requires all topics as one parameter and can be done at once.
573 612
 			if ($this->_req->post->qaction === 'merge')
574 613
 			{
575 614
 				// Merge requires at least two topics.
576 615
 				if (empty($this->_req->post->topics) || count($this->_req->post->topics) < 2)
577
-					redirectexit($redirect_url);
616
+				{
617
+									redirectexit($redirect_url);
618
+				}
578 619
 
579 620
 				$controller = new MergeTopics_Controller(new Event_Manager());
580 621
 				$controller->pre_dispatch();
@@ -583,7 +624,9 @@  discard block
 block discarded – undo
583 624
 
584 625
 			// Just convert to the other method, to make it easier.
585 626
 			foreach ($this->_req->post->topics as $topic)
586
-				$actions[(int) $topic] = $this->_req->post->qaction;
627
+			{
628
+							$actions[(int) $topic] = $this->_req->post->qaction;
629
+			}
587 630
 		}
588 631
 		else
589 632
 		{
@@ -592,7 +635,9 @@  discard block
 block discarded – undo
592 635
 
593 636
 		// Weird... how'd you get here?
594 637
 		if (empty($actions))
595
-			redirectexit($redirect_url);
638
+		{
639
+					redirectexit($redirect_url);
640
+		}
596 641
 
597 642
 		// Validate each action.
598 643
 		$all_actions = array();
@@ -600,7 +645,9 @@  discard block
 block discarded – undo
600 645
 		foreach ($actions as $topic => $action)
601 646
 		{
602 647
 			if (in_array($action, $possibleActions))
603
-				$all_actions[(int) $topic] = $action;
648
+			{
649
+							$all_actions[(int) $topic] = $action;
650
+			}
604 651
 		}
605 652
 
606 653
 		$stickyCache = array();
@@ -620,7 +667,9 @@  discard block
 block discarded – undo
620 667
 				if (!empty($board))
621 668
 				{
622 669
 					if ($row['id_board'] != $board || ($modSettings['postmod_active'] && !$row['approved'] && !allowedTo('approve_posts')))
623
-						continue;
670
+					{
671
+											continue;
672
+					}
624 673
 				}
625 674
 				else
626 675
 				{
@@ -703,23 +752,33 @@  discard block
 block discarded – undo
703 752
 
704 753
 		// Do all the stickies...
705 754
 		if (!empty($stickyCache))
706
-			toggleTopicSticky($stickyCache, true);
755
+		{
756
+					toggleTopicSticky($stickyCache, true);
757
+		}
707 758
 
708 759
 		// Move sucka! (this is, by the by, probably the most complicated part....)
709 760
 		if (!empty($moveCache[0]))
710
-			moveTopicsPermissions($moveCache);
761
+		{
762
+					moveTopicsPermissions($moveCache);
763
+		}
711 764
 
712 765
 		// Now delete the topics...
713 766
 		if (!empty($removeCache))
714
-			removeTopicsPermissions($removeCache);
767
+		{
768
+					removeTopicsPermissions($removeCache);
769
+		}
715 770
 
716 771
 		// Approve the topics...
717 772
 		if (!empty($approveCache))
718
-			approveTopics($approveCache, true, true);
773
+		{
774
+					approveTopics($approveCache, true, true);
775
+		}
719 776
 
720 777
 		// And (almost) lastly, lock the topics...
721 778
 		if (!empty($lockCache))
722
-			toggleTopicsLock($lockCache, true);
779
+		{
780
+					toggleTopicsLock($lockCache, true);
781
+		}
723 782
 
724 783
 		if (!empty($markCache))
725 784
 		{
@@ -727,7 +786,9 @@  discard block
 block discarded – undo
727 786
 
728 787
 			$markArray = array();
729 788
 			foreach ($markCache as $topic)
730
-				$markArray[] = array($user_info['id'], $topic, $modSettings['maxMsgID'], (int) !empty($logged_topics[$topic]));
789
+			{
790
+							$markArray[] = array($user_info['id'], $topic, $modSettings['maxMsgID'], (int) !empty($logged_topics[$topic]));
791
+			}
731 792
 
732 793
 			markTopicsRead($markArray, true);
733 794
 		}
@@ -740,7 +801,9 @@  discard block
 block discarded – undo
740 801
 		));
741 802
 
742 803
 		if (!empty($affectedBoards))
743
-			updateLastMessages(array_keys($affectedBoards));
804
+		{
805
+					updateLastMessages(array_keys($affectedBoards));
806
+		}
744 807
 
745 808
 		redirectexit($redirect_url);
746 809
 	}
Please login to merge, or discard this patch.
sources/controllers/ModerationCenter.controller.php 2 patches
Braces   +141 added lines, -55 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 		// Now call the menu action.
41 41
 		if (isset($this->_mod_include_data['file']))
42
-			require_once($this->_mod_include_data['file']);
42
+		{
43
+					require_once($this->_mod_include_data['file']);
44
+		}
43 45
 
44 46
 		callMenu($this->_mod_include_data);
45 47
 	}
@@ -56,7 +58,9 @@  discard block
 block discarded – undo
56 58
 
57 59
 		// Don't run this twice... and don't conflict with the admin bar.
58 60
 		if (isset($context['admin_area']))
59
-			return;
61
+		{
62
+					return;
63
+		}
60 64
 
61 65
 		$context['can_moderate_boards'] = $user_info['mod_cache']['bq'] != '0=1';
62 66
 		$context['can_moderate_groups'] = $user_info['mod_cache']['gq'] != '0=1';
@@ -64,7 +68,9 @@  discard block
 block discarded – undo
64 68
 
65 69
 		// Everyone using this area must be allowed here!
66 70
 		if (!$context['can_moderate_boards'] && !$context['can_moderate_groups'] && !$context['can_moderate_approvals'])
67
-			isAllowedTo('access_mod_center');
71
+		{
72
+					isAllowedTo('access_mod_center');
73
+		}
68 74
 
69 75
 		// We're gonna want a menu of some kind.
70 76
 		require_once(SUBSDIR . '/Menu.subs.php');
@@ -273,7 +279,9 @@  discard block
 block discarded – undo
273 279
 
274 280
 		// We got something - didn't we? DIDN'T WE!
275 281
 		if ($mod_include_data === false)
276
-			throw new Elk_Exception('no_access', false);
282
+		{
283
+					throw new Elk_Exception('no_access', false);
284
+		}
277 285
 
278 286
 		// Retain the ID information in case required by a subaction.
279 287
 		$context['moderation_menu_id'] = $context['max_menu_id'];
@@ -293,16 +301,20 @@  discard block
 block discarded – undo
293 301
 		);
294 302
 
295 303
 		if (isset($mod_include_data['current_area']) && $mod_include_data['current_area'] != 'index')
296
-			$context['linktree'][] = array(
304
+		{
305
+					$context['linktree'][] = array(
297 306
 				'url' => $scripturl . '?action=moderate;area=' . $mod_include_data['current_area'],
298 307
 				'name' => $mod_include_data['label'],
299 308
 			);
309
+		}
300 310
 
301 311
 		if (!empty($mod_include_data['current_subsection']) && $mod_include_data['subsections'][$mod_include_data['current_subsection']][0] != $mod_include_data['label'])
302
-			$context['linktree'][] = array(
312
+		{
313
+					$context['linktree'][] = array(
303 314
 				'url' => $scripturl . '?action=moderate;area=' . $mod_include_data['current_area'] . ';sa=' . $mod_include_data['current_subsection'],
304 315
 				'name' => $mod_include_data['subsections'][$mod_include_data['current_subsection']][0],
305 316
 			);
317
+		}
306 318
 
307 319
 		// Finally, store this, so that if we're called from the class, it can use it.
308 320
 		$this->_mod_include_data = $mod_include_data;
@@ -334,17 +346,24 @@  discard block
 block discarded – undo
334 346
 		}
335 347
 
336 348
 		if ($context['can_moderate_groups'])
337
-			$valid_blocks['g'] = 'groupRequests';
349
+		{
350
+					$valid_blocks['g'] = 'groupRequests';
351
+		}
338 352
 
339 353
 		if ($context['can_moderate_boards'])
340
-			$valid_blocks['w'] = 'watchedUsers';
354
+		{
355
+					$valid_blocks['w'] = 'watchedUsers';
356
+		}
341 357
 
342 358
 		$valid_blocks['n'] = 'latestNews';
343 359
 
344 360
 		if (empty($user_settings['mod_prefs']))
345
-			$user_blocks = 'n' . ($context['can_moderate_boards'] ? 'wra' : '') . ($context['can_moderate_groups'] ? 'g' : '');
346
-		else
347
-			list (, $user_blocks) = explode('|', $user_settings['mod_prefs']);
361
+		{
362
+					$user_blocks = 'n' . ($context['can_moderate_boards'] ? 'wra' : '') . ($context['can_moderate_groups'] ? 'g' : '');
363
+		}
364
+		else {
365
+					list (, $user_blocks) = explode('|', $user_settings['mod_prefs']);
366
+		}
348 367
 
349 368
 		$user_blocks = str_split($user_blocks);
350 369
 
@@ -356,7 +375,9 @@  discard block
 block discarded – undo
356 375
 				$block = 'block_' . $block;
357 376
 
358 377
 				if (method_exists($this, $block))
359
-					$context['mod_blocks'][] = $this->{$block}();
378
+				{
379
+									$context['mod_blocks'][] = $this->{$block}();
380
+				}
360 381
 			}
361 382
 		}
362 383
 	}
@@ -388,7 +409,9 @@  discard block
 block discarded – undo
388 409
 
389 410
 		// legit?
390 411
 		if (empty($notice) || !$context['can_moderate_boards'])
391
-			throw new Elk_Exception('no_access', false);
412
+		{
413
+					throw new Elk_Exception('no_access', false);
414
+		}
392 415
 
393 416
 		list ($context['notice_body'], $context['notice_subject']) = $notice;
394 417
 
@@ -427,11 +450,15 @@  discard block
 block discarded – undo
427 450
 
428 451
 		// This comes under the umbrella of moderating posts.
429 452
 		if ($user_info['mod_cache']['bq'] === '0=1')
430
-			isAllowedTo('moderate_forum');
453
+		{
454
+					isAllowedTo('moderate_forum');
455
+		}
431 456
 
432 457
 		// Are they wanting to view a particular report?
433 458
 		if (!empty($this->_req->query->report))
434
-			return $this->action_modReport();
459
+		{
460
+					return $this->action_modReport();
461
+		}
435 462
 
436 463
 		// This should not be needed...
437 464
 		$show_pms = false;
@@ -460,9 +487,13 @@  discard block
 block discarded – undo
460 487
 
461 488
 			// Update the report...
462 489
 			if (isset($this->_req->query->ignore))
463
-				updateReportsStatus($rid, 'ignore', (int) $this->_req->query->ignore);
490
+			{
491
+							updateReportsStatus($rid, 'ignore', (int) $this->_req->query->ignore);
492
+			}
464 493
 			elseif (isset($this->_req->query->close))
465
-				updateReportsStatus($rid, 'close', (int) $this->_req->query->close);
494
+			{
495
+							updateReportsStatus($rid, 'close', (int) $this->_req->query->close);
496
+			}
466 497
 
467 498
 			// Time to update.
468 499
 			updateSettings(array('last_mod_report_action' => time()));
@@ -549,8 +580,10 @@  discard block
 block discarded – undo
549 580
 
550 581
 			// Add the board name to the report array
551 582
 			foreach ($context['reports'] as $id_report => $report)
552
-				if (!empty($board_names[$report['board']]))
583
+			{
584
+							if (!empty($board_names[$report['board']]))
553 585
 					$context['reports'][$id_report]['board_name'] = $board_names[$report['board']]['board_name'];
586
+			}
554 587
 		}
555 588
 
556 589
 		// Now get all the people who reported it.
@@ -560,7 +593,8 @@  discard block
 block discarded – undo
560 593
 			foreach ($comments as $id_rep => $rows)
561 594
 			{
562 595
 				foreach ($rows as $row)
563
-					$context['reports'][$id_rep]['comments'][] = array(
596
+				{
597
+									$context['reports'][$id_rep]['comments'][] = array(
564 598
 						'id' => $row['id_comment'],
565 599
 						'message' => $row['comment'],
566 600
 						'raw_time' => $row['time_sent'],
@@ -574,6 +608,7 @@  discard block
 block discarded – undo
574 608
 							'href' => $row['id_member'] ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
575 609
 						),
576 610
 					);
611
+				}
577 612
 			}
578 613
 		}
579 614
 	}
@@ -602,7 +637,9 @@  discard block
 block discarded – undo
602 637
 		);
603 638
 
604 639
 		if ($context['can_moderate_groups'])
605
-			$context['homepage_blocks']['g'] = $txt['mc_group_requests'];
640
+		{
641
+					$context['homepage_blocks']['g'] = $txt['mc_group_requests'];
642
+		}
606 643
 
607 644
 		if ($context['can_moderate_boards'])
608 645
 		{
@@ -618,8 +655,9 @@  discard block
 block discarded – undo
618 655
 			$pref_binary = 5;
619 656
 			$show_reports = 1;
620 657
 		}
621
-		else
622
-			list ($show_reports, $mod_blocks, $pref_binary) = explode('|', $user_settings['mod_prefs']);
658
+		else {
659
+					list ($show_reports, $mod_blocks, $pref_binary) = explode('|', $user_settings['mod_prefs']);
660
+		}
623 661
 
624 662
 		// Are we saving?
625 663
 		if (isset($this->_req->post->save))
@@ -642,23 +680,29 @@  discard block
 block discarded – undo
642 680
 			// Do blocks first!
643 681
 			$mod_blocks = '';
644 682
 			if (!empty($this->_req->post->mod_homepage))
645
-				foreach ($this->_req->post->mod_homepage as $k => $v)
683
+			{
684
+							foreach ($this->_req->post->mod_homepage as $k => $v)
646 685
 				{
647 686
 					// Make sure they can add this...
648 687
 					if (isset($context['homepage_blocks'][$k]))
649 688
 						$mod_blocks .= $k;
689
+			}
650 690
 				}
651 691
 
652 692
 			// Now check other options!
653 693
 			$pref_binary = 0;
654 694
 
655 695
 			if ($context['can_moderate_approvals'] && !empty($this->_req->post->mod_notify_approval))
656
-				$pref_binary |= 4;
696
+			{
697
+							$pref_binary |= 4;
698
+			}
657 699
 
658 700
 			if ($context['can_moderate_boards'])
659 701
 			{
660 702
 				if (!empty($this->_req->post->mod_notify_report))
661
-					$pref_binary |= ($this->_req->post->mod_notify_report == 2 ? 1 : 2);
703
+				{
704
+									$pref_binary |= ($this->_req->post->mod_notify_report == 2 ? 1 : 2);
705
+				}
662 706
 
663 707
 				$show_reports = !empty($this->_req->post->mod_show_reports) ? 1 : 0;
664 708
 			}
@@ -710,7 +754,9 @@  discard block
 block discarded – undo
710 754
 
711 755
 		// If it's an edit load it.
712 756
 		if ($context['is_edit'])
713
-			modLoadTemplate($context['id_template']);
757
+		{
758
+					modLoadTemplate($context['id_template']);
759
+		}
714 760
 
715 761
 		// Wait, we are saving?
716 762
 		if (isset($this->_req->post->save))
@@ -748,13 +794,18 @@  discard block
 block discarded – undo
748 794
 
749 795
 					// If it wasn't visible and now is they've effectively added it.
750 796
 					if ($context['template_data']['personal'] && !$recipient_id)
751
-						logAction('add_warn_template', array('template' => $template_title));
797
+					{
798
+											logAction('add_warn_template', array('template' => $template_title));
799
+					}
752 800
 					// Conversely if they made it personal it's a delete.
753 801
 					elseif (!$context['template_data']['personal'] && $recipient_id)
754
-						logAction('delete_warn_template', array('template' => $template_title));
802
+					{
803
+											logAction('delete_warn_template', array('template' => $template_title));
804
+					}
755 805
 					// Otherwise just an edit.
756
-					else
757
-						logAction('modify_warn_template', array('template' => $template_title));
806
+					else {
807
+											logAction('modify_warn_template', array('template' => $template_title));
808
+					}
758 809
 				}
759 810
 				else
760 811
 				{
@@ -773,10 +824,14 @@  discard block
 block discarded – undo
773 824
 				$context['template_data']['personal'] = !empty($this->_req->post->make_personal);
774 825
 
775 826
 				if (empty($template_title))
776
-					$context['warning_errors'][] = $txt['mc_warning_template_error_no_title'];
827
+				{
828
+									$context['warning_errors'][] = $txt['mc_warning_template_error_no_title'];
829
+				}
777 830
 
778 831
 				if (empty($template_body))
779
-					$context['warning_errors'][] = $txt['mc_warning_template_error_no_body'];
832
+				{
833
+									$context['warning_errors'][] = $txt['mc_warning_template_error_no_body'];
834
+				}
780 835
 			}
781 836
 		}
782 837
 
@@ -795,7 +850,9 @@  discard block
 block discarded – undo
795 850
 		// Have to at least give us something
796 851
 		$report = $this->_req->getQuery('report', 'intval', 0);
797 852
 		if (empty($report))
798
-			throw new Elk_Exception('mc_no_modreport_specified');
853
+		{
854
+					throw new Elk_Exception('mc_no_modreport_specified');
855
+		}
799 856
 
800 857
 		// This should not be needed...
801 858
 		$show_pms = false;
@@ -810,7 +867,9 @@  discard block
 block discarded – undo
810 867
 
811 868
 		// So did we find anything?
812 869
 		if ($row === false)
813
-			throw new Elk_Exception('mc_no_modreport_found');
870
+		{
871
+					throw new Elk_Exception('mc_no_modreport_found');
872
+		}
814 873
 
815 874
 		// Woohoo we found a report and they can see it!  Bad news is we have more work to do
816 875
 		// If they are adding a comment then... add a comment.
@@ -999,7 +1058,9 @@  discard block
 block discarded – undo
999 1058
 
1000 1059
 		// Make sure to get the correct tab selected.
1001 1060
 		if ($context['report']['closed'])
1002
-			$context[$context['moderation_menu_name']]['current_subsection'] = 'closed';
1061
+		{
1062
+					$context[$context['moderation_menu_name']]['current_subsection'] = 'closed';
1063
+		}
1003 1064
 
1004 1065
 		// Finally we are done :P
1005 1066
 		loadTemplate('ModerationCenter');
@@ -1051,9 +1112,12 @@  discard block
 block discarded – undo
1051 1112
 			// Clicked on remove or using checkboxes to multi delete
1052 1113
 			$toDelete = array();
1053 1114
 			if (isset($this->_req->query->delete))
1054
-				$toDelete[] = (int) $this->_req->query->delete;
1055
-			else
1056
-				$toDelete = array_map('intval', $this->_req->post->delete);
1115
+			{
1116
+							$toDelete[] = (int) $this->_req->query->delete;
1117
+			}
1118
+			else {
1119
+							$toDelete = array_map('intval', $this->_req->post->delete);
1120
+			}
1057 1121
 
1058 1122
 			if (!empty($toDelete))
1059 1123
 			{
@@ -1061,7 +1125,9 @@  discard block
 block discarded – undo
1061 1125
 
1062 1126
 				// If they don't have permission we'll let it error - either way no chance of a security slip here!
1063 1127
 				foreach ($toDelete as $did)
1064
-					$remover->removeMessage($did);
1128
+				{
1129
+									$remover->removeMessage($did);
1130
+				}
1065 1131
 			}
1066 1132
 		}
1067 1133
 
@@ -1078,12 +1144,17 @@  discard block
 block discarded – undo
1078 1144
 			$delete_boards = boardsAllowedTo('delete_any');
1079 1145
 
1080 1146
 			if ($approve_boards == array(0))
1081
-				$approve_query = '';
1147
+			{
1148
+							$approve_query = '';
1149
+			}
1082 1150
 			elseif (!empty($approve_boards))
1083
-				$approve_query = ' AND m.id_board IN (' . implode(',', $approve_boards) . ')';
1151
+			{
1152
+							$approve_query = ' AND m.id_board IN (' . implode(',', $approve_boards) . ')';
1153
+			}
1084 1154
 			// Nada, zip, etc...
1085
-			else
1086
-				$approve_query = ' AND 1=0';
1155
+			else {
1156
+							$approve_query = ' AND 1=0';
1157
+			}
1087 1158
 		}
1088 1159
 
1089 1160
 		// This is all the information required for a watched user listing.
@@ -1183,9 +1254,12 @@  discard block
 block discarded – undo
1183 1254
 							global $scripturl;
1184 1255
 
1185 1256
 							if ($member['last_post_id'])
1186
-								return '<a href="' . $scripturl . '?msg=' . $member['last_post_id'] . '">' . $member['last_post'] . '</a>';
1187
-							else
1188
-								return $member['last_post'];
1257
+							{
1258
+															return '<a href="' . $scripturl . '?msg=' . $member['last_post_id'] . '">' . $member['last_post'] . '</a>';
1259
+							}
1260
+							else {
1261
+															return $member['last_post'];
1262
+							}
1189 1263
 						},
1190 1264
 					),
1191 1265
 				),
@@ -1260,14 +1334,20 @@  discard block
 block discarded – undo
1260 1334
 		$context['url_start'] = '?action=moderate;area=warnings;sa=log;sort=' . $context['order'];
1261 1335
 
1262 1336
 		if (!isset($search_params['string']) || (!empty($this->_req->post->search) && $search_params['string'] != $this->_req->post->search))
1263
-			$search_params_string = empty($this->_req->post->search) ? '' : $this->_req->post->search;
1264
-		else
1265
-			$search_params_string = $search_params['string'];
1337
+		{
1338
+					$search_params_string = empty($this->_req->post->search) ? '' : $this->_req->post->search;
1339
+		}
1340
+		else {
1341
+					$search_params_string = $search_params['string'];
1342
+		}
1266 1343
 
1267 1344
 		if (isset($this->_req->post->search_type) || empty($search_params['type']) || !isset($searchTypes[$search_params['type']]))
1268
-			$search_params_type = isset($this->_req->post->search_type) && isset($searchTypes[$this->_req->post->search_type]) ? $this->_req->post->search_type : (isset($searchTypes[$context['order']]) ? $context['order'] : 'member');
1269
-		else
1270
-			$search_params_type = $search_params['type'];
1345
+		{
1346
+					$search_params_type = isset($this->_req->post->search_type) && isset($searchTypes[$this->_req->post->search_type]) ? $this->_req->post->search_type : (isset($searchTypes[$context['order']]) ? $context['order'] : 'member');
1347
+		}
1348
+		else {
1349
+					$search_params_type = $search_params['type'];
1350
+		}
1271 1351
 
1272 1352
 		$search_params_column = $searchTypes[$search_params_type]['sql'];
1273 1353
 		$search_params = array(
@@ -1358,8 +1438,10 @@  discard block
 block discarded – undo
1358 1438
 
1359 1439
 							// If a notice was sent, provide a link to it
1360 1440
 							if (!empty($warning['id_notice']))
1361
-								$output .= '
1441
+							{
1442
+															$output .= '
1362 1443
 									<a href="' . $scripturl . '?action=moderate;area=notice;nid=' . $warning['id_notice'] . '" onclick="window.open(this.href, \'\', \'scrollbars=yes,resizable=yes,width=480,height=320\');return false;" target="_blank" class="new_win" title="' . $txt['profile_warning_previous_notice'] . '"><i class="icon icon-small i-search" title"' . $txt['profile_warning_previous_notice'] . '"></i></a>';
1444
+							}
1363 1445
 							return $output;
1364 1446
 						},
1365 1447
 					),
@@ -1677,7 +1759,9 @@  discard block
 block discarded – undo
1677 1759
 
1678 1760
 		// Make sure they can even moderate someone!
1679 1761
 		if ($user_info['mod_cache']['gq'] === '0=1')
1680
-			return 'group_requests_block';
1762
+		{
1763
+					return 'group_requests_block';
1764
+		}
1681 1765
 
1682 1766
 		$context['group_requests'] = groupRequests();
1683 1767
 
@@ -1842,7 +1926,9 @@  discard block
 block discarded – undo
1842 1926
 		global $context, $user_info, $scripturl;
1843 1927
 
1844 1928
 		if ($user_info['mod_cache']['bq'] === '0=1')
1845
-			return 'reported_posts_block';
1929
+		{
1930
+					return 'reported_posts_block';
1931
+		}
1846 1932
 
1847 1933
 		$context['reported_posts'] = array();
1848 1934
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
 		if (!empty($options['admin_preferences']))
77 77
 		{
78
-			$context['admin_preferences'] = serializeToJson($options['admin_preferences'], function ($array_form) {
78
+			$context['admin_preferences'] = serializeToJson($options['admin_preferences'], function($array_form) {
79 79
 				global $context;
80 80
 
81 81
 				$context['admin_preferences'] = $array_form;
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
 						'value' => $txt['mc_watched_users_warning'],
1134 1134
 					),
1135 1135
 					'data' => array(
1136
-						'function' => function ($member) {
1136
+						'function' => function($member) {
1137 1137
 							global $scripturl;
1138 1138
 
1139 1139
 							return allowedTo('issue_warning') ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $member['id'] . '">' . $member['warning'] . '%</a>' : $member['warning'] . '%';
@@ -1179,7 +1179,7 @@  discard block
 block discarded – undo
1179 1179
 						'value' => $txt['mc_watched_users_last_post'],
1180 1180
 					),
1181 1181
 					'data' => array(
1182
-						'function' => function ($member) {
1182
+						'function' => function($member) {
1183 1183
 							global $scripturl;
1184 1184
 
1185 1185
 							if ($member['last_post_id'])
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
 			$listOptions['columns'] = array(
1215 1215
 				'posts' => array(
1216 1216
 					'data' => array(
1217
-						'function' => function ($post) {
1217
+						'function' => function($post) {
1218 1218
 							return template_user_watch_post_callback($post);
1219 1219
 						},
1220 1220
 					),
@@ -1348,7 +1348,7 @@  discard block
 block discarded – undo
1348 1348
 						'value' => $txt['profile_warning_previous_reason'],
1349 1349
 					),
1350 1350
 					'data' => array(
1351
-						'function' => function ($warning) {
1351
+						'function' => function($warning) {
1352 1352
 							global $scripturl, $txt;
1353 1353
 
1354 1354
 							$output = '
@@ -1495,7 +1495,7 @@  discard block
 block discarded – undo
1495 1495
 						'style' => 'width: 4%;text-align: center;',
1496 1496
 					),
1497 1497
 					'data' => array(
1498
-						'function' => function ($rowData) {
1498
+						'function' => function($rowData) {
1499 1499
 							return '<input type="checkbox" name="deltpl[]" value="' . $rowData['id_comment'] . '" class="input_check" />';
1500 1500
 						},
1501 1501
 						'class' => 'centertext',
Please login to merge, or discard this patch.