Test Failed
Push — master ( 3b3a9e...7cd567 )
by Michael
02:25
created
users.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	$user->approve();
107 107
 
108 108
 	BootstrapSkin::displayAlertBox(
109
-		"Approved user " . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8'), 
109
+		"Approved user ".htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8'), 
110 110
 		"alert-info", 
111 111
 		"", 
112 112
 		false);
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 	$headers = 'From: [email protected]';
117 117
 	// TODO: move to template?
118
-	mail($user->getEmail(), "ACC Account Approved", "Dear " . $user->getOnWikiName() . ",\nYour account " . $user->getUsername() . " has been approved by " . User::getCurrent()->getUsername() . ". To login please go to $baseurl/acc.php.\nPlease note that if you cannot login immediately, we may be updating your identification information in the system.  Please let us know if you continue to have issues if you cannot login after 12 hours pass from the time you receive this approval.\n- The English Wikipedia Account Creation Team", $headers);
118
+	mail($user->getEmail(), "ACC Account Approved", "Dear ".$user->getOnWikiName().",\nYour account ".$user->getUsername()." has been approved by ".User::getCurrent()->getUsername().". To login please go to $baseurl/acc.php.\nPlease note that if you cannot login immediately, we may be updating your identification information in the system.  Please let us know if you continue to have issues if you cannot login after 12 hours pass from the time you receive this approval.\n- The English Wikipedia Account Creation Team", $headers);
119 119
 	BootstrapSkin::displayInternalFooter();
120 120
 	die();
121 121
 }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		$user->demote($_POST['reason']);
160 160
 
161 161
 		BootstrapSkin::displayAlertBox( 
162
-			"Changed " . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8') . "'s access to 'User'", 
162
+			"Changed ".htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')."'s access to 'User'", 
163 163
 			"alert-info", 
164 164
 			"", 
165 165
 			false);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		$headers = 'From: [email protected]';
170 170
         
171 171
 		// TODO: move to template?
172
-		mail($user->getEmail(), "ACC Account Demoted", "Dear " . $user->getOnWikiName() . ",\nYour account " . $user->getUsername() . " has been demoted by " . User::getCurrent()->getUsername() . " because " . User::getCurrent()->getUsername() . ". To contest this demotion please email [email protected].\n- The English Wikipedia Account Creation Team", $headers);
172
+		mail($user->getEmail(), "ACC Account Demoted", "Dear ".$user->getOnWikiName().",\nYour account ".$user->getUsername()." has been demoted by ".User::getCurrent()->getUsername()." because ".User::getCurrent()->getUsername().". To contest this demotion please email [email protected].\n- The English Wikipedia Account Creation Team", $headers);
173 173
 		BootstrapSkin::displayInternalFooter();
174 174
 		die();
175 175
 	}
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
 		Notification::userSuspended($user, $_POST['reason']);
215 215
 		BootstrapSkin::displayAlertBox(
216
-			"Suspended user " . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8'), 
216
+			"Suspended user ".htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8'), 
217 217
 			"alert-info", 
218 218
 			"", 
219 219
 			false);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		$headers = 'From: [email protected]';
222 222
         
223 223
 		// TODO: move to template?
224
-		mail($user->getEmail(), "ACC Account Suspended", "Dear " . $user->getOnWikiName() . ",\nYour account " . $user->getUsername() . " has been suspended by " . User::getCurrent()->getUsername() . " because " . $_POST['reason'] . ". To contest this suspension please email [email protected].\n- The English Wikipedia Account Creation Team", $headers);
224
+		mail($user->getEmail(), "ACC Account Suspended", "Dear ".$user->getOnWikiName().",\nYour account ".$user->getUsername()." has been suspended by ".User::getCurrent()->getUsername()." because ".$_POST['reason'].". To contest this suspension please email [email protected].\n- The English Wikipedia Account Creation Team", $headers);
225 225
 		BootstrapSkin::displayInternalFooter();
226 226
 		die();
227 227
 	}
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	Notification::userPromoted($user);
258 258
 
259 259
 	BootstrapSkin::displayAlertBox(
260
-		htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8') . " promoted to 'Admin'", 
260
+		htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')." promoted to 'Admin'", 
261 261
 		"alert-info", 
262 262
 		"", 
263 263
 		false);
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	$headers = 'From: [email protected]';
266 266
     
267 267
 	// TODO: move to template?
268
-	mail($user->getEmail(), "ACC Account Promoted", "Dear " . $user->getOnWikiName() . ",\nYour account " . $user->getUsername() . " has been promted to admin status by " . User::getCurrent()->getUsername() . ".\n- The English Wikipedia Account Creation Team", $headers);
268
+	mail($user->getEmail(), "ACC Account Promoted", "Dear ".$user->getOnWikiName().",\nYour account ".$user->getUsername()." has been promted to admin status by ".User::getCurrent()->getUsername().".\n- The English Wikipedia Account Creation Team", $headers);
269 269
 	die();
270 270
 }
271 271
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		Notification::userDeclined($user, $_POST['reason']);
309 309
 
310 310
 		BootstrapSkin::displayAlertBox(
311
-			"Declined user " . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8'), 
311
+			"Declined user ".htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8'), 
312 312
 			"alert-info", 
313 313
 			"", 
314 314
 			false);
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$headers = 'From: [email protected]';
317 317
         
318 318
 		// TODO: move to template?
319
-		mail($user->getEmail(), "ACC Account Declined", "Dear " . $user->getOnWikiName() . ",\nYour account " . $user->getUsername() . " has been declined access to the account creation tool by " . User::getCurrent()->getUsername() . " because " . $_POST['reason'] . ". For more infomation please email [email protected].\n- The English Wikipedia Account Creation Team", $headers);
319
+		mail($user->getEmail(), "ACC Account Declined", "Dear ".$user->getOnWikiName().",\nYour account ".$user->getUsername()." has been declined access to the account creation tool by ".User::getCurrent()->getUsername()." because ".$_POST['reason'].". For more infomation please email [email protected].\n- The English Wikipedia Account Creation Team", $headers);
320 320
 		BootstrapSkin::displayInternalFooter();
321 321
 		die();
322 322
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -154,8 +154,7 @@  discard block
 block discarded – undo
154 154
 		$smarty->display("usermanagement/changelevel-reason.tpl");
155 155
 		BootstrapSkin::displayInternalFooter();
156 156
 		die();
157
-	}
158
-	else {
157
+	} else {
159 158
 		$user->demote($_POST['reason']);
160 159
 
161 160
 		BootstrapSkin::displayAlertBox( 
@@ -198,8 +197,7 @@  discard block
 block discarded – undo
198 197
 			false);
199 198
 		BootstrapSkin::displayInternalFooter();
200 199
 		die();
201
-	}
202
-	elseif (!isset($_POST['reason'])) {
200
+	} elseif (!isset($_POST['reason'])) {
203 201
 		global $smarty;
204 202
 		$smarty->assign("user", $user);
205 203
 		$smarty->assign("status", "Suspended");
@@ -207,8 +205,7 @@  discard block
 block discarded – undo
207 205
 		$smarty->display("usermanagement/changelevel-reason.tpl");
208 206
 		BootstrapSkin::displayInternalFooter();
209 207
 		die();
210
-	}
211
-	else {
208
+	} else {
212 209
 		$user->suspend($_POST['reason']);
213 210
 
214 211
 		Notification::userSuspended($user, $_POST['reason']);
@@ -301,8 +298,7 @@  discard block
 block discarded – undo
301 298
 		$smarty->display("usermanagement/changelevel-reason.tpl");
302 299
 		BootstrapSkin::displayInternalFooter();
303 300
 		die();
304
-	}
305
-	else {
301
+	} else {
306 302
 		$user->decline($_POST['reason']);
307 303
 
308 304
 		Notification::userDeclined($user, $_POST['reason']);
@@ -346,8 +342,7 @@  discard block
 block discarded – undo
346 342
 		$smarty->display("usermanagement/renameuser.tpl");
347 343
 		BootstrapSkin::displayInternalFooter();
348 344
 		die();
349
-	}
350
-	else {
345
+	} else {
351 346
 		if (!isset($_POST['newname']) || trim($_POST['newname']) == "") {
352 347
 			BootstrapSkin::displayAlertBox("The new username cannot be empty.", "alert-error", "Error", true, false);
353 348
 			BootstrapSkin::displayInternalFooter();
@@ -429,8 +424,7 @@  discard block
 block discarded – undo
429 424
 		global $smarty;
430 425
 		$smarty->assign("user", $user);
431 426
 		$smarty->display("usermanagement/edituser.tpl");
432
-	}
433
-	else {
427
+	} else {
434 428
 		$database = gGetDb();
435 429
 		if (!$database->beginTransaction()) {
436 430
 			BootstrapSkin::displayAlertBox(
Please login to merge, or discard this patch.
search.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 			die();
81 81
 		}			
82 82
 
83
-		$qterm = '%' . $term . '%';
83
+		$qterm = '%'.$term.'%';
84 84
         
85 85
 		$statement = gGetDb()->prepare("SELECT * FROM request WHERE email LIKE :term;");
86 86
 		$statement->bindValue(":term", $qterm);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		$smarty->display("search/searchresult.tpl");
99 99
 	}
100 100
 	elseif ($_GET['type'] == 'IP') {
101
-		$qterm = '%' . $term . '%';
101
+		$qterm = '%'.$term.'%';
102 102
         
103 103
 		$statement = gGetDb()->prepare("SELECT * FROM request WHERE email <> '[email protected]' and ip <> '127.0.0.1' and ip LIKE :term or forwardedip LIKE :term2;");
104 104
 		$statement->bindValue(":term", $qterm);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		$smarty->display("search/searchresult.tpl");
118 118
 	}
119 119
 	elseif ($_GET['type'] == 'Request') {
120
-		$qterm = '%' . $term . '%';
120
+		$qterm = '%'.$term.'%';
121 121
         
122 122
 		$statement = gGetDb()->prepare("SELECT * FROM request WHERE name LIKE :term;");
123 123
 		$statement->bindValue(":term", $qterm);
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 if (isset($_SESSION['user'])) {
34 34
 	$sessionuser = $_SESSION['user'];
35
-}
36
-else {
35
+} else {
37 36
 	$sessionuser = "";
38 37
 }
39 38
 
@@ -96,8 +95,7 @@  discard block
 block discarded – undo
96 95
 		$smarty->assign("target", $target);
97 96
         
98 97
 		$smarty->display("search/searchresult.tpl");
99
-	}
100
-	elseif ($_GET['type'] == 'IP') {
98
+	} elseif ($_GET['type'] == 'IP') {
101 99
 		$qterm = '%' . $term . '%';
102 100
         
103 101
 		$statement = gGetDb()->prepare("SELECT * FROM request WHERE email <> '[email protected]' and ip <> '127.0.0.1' and ip LIKE :term or forwardedip LIKE :term2;");
@@ -115,8 +113,7 @@  discard block
 block discarded – undo
115 113
 		$smarty->assign("target", $target);
116 114
         
117 115
 		$smarty->display("search/searchresult.tpl");
118
-	}
119
-	elseif ($_GET['type'] == 'Request') {
116
+	} elseif ($_GET['type'] == 'Request') {
120 117
 		$qterm = '%' . $term . '%';
121 118
         
122 119
 		$statement = gGetDb()->prepare("SELECT * FROM request WHERE name LIKE :term;");
@@ -133,15 +130,13 @@  discard block
 block discarded – undo
133 130
 		$smarty->assign("target", $target);
134 131
         
135 132
 		$smarty->display("search/searchresult.tpl");
136
-	}
137
-	else {
133
+	} else {
138 134
 		BootstrapSkin::displayAlertBox("Unknown search type", "alert-error", "Error");
139 135
 		$smarty->display("search/searchform.tpl");
140 136
 		BootstrapSkin::displayInternalFooter();
141 137
 		die();
142 138
 	}
143
-}
144
-else {
139
+} else {
145 140
 	$smarty->display("search/searchform.tpl");
146 141
 }
147 142
 
Please login to merge, or discard this patch.
acc.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -2043,41 +2043,41 @@
 block discarded – undo
2043 2043
 	});
2044 2044
 }
2045 2045
 elseif ($action == "listall") {
2046
-    global $availableRequestStates, $enableEmailConfirm;
2046
+	global $availableRequestStates, $enableEmailConfirm;
2047 2047
 
2048 2048
 	if (isset($_GET['status']) && isset($availableRequestStates[$_GET['status']])) {
2049 2049
 		$type = $_GET['status']; // safe, we've verified it's sane in the above if statement.
2050 2050
 
2051
-	    $database = gGetDb();
2051
+		$database = gGetDb();
2052 2052
 
2053
-	    if ($enableEmailConfirm == 1) {
2054
-	        $query = "SELECT * FROM request WHERE status = :type AND emailconfirm = 'Confirmed';";
2055
-	    } else {
2056
-	        $query = "SELECT * FROM request WHERE status = :type;";
2057
-	    }
2053
+		if ($enableEmailConfirm == 1) {
2054
+			$query = "SELECT * FROM request WHERE status = :type AND emailconfirm = 'Confirmed';";
2055
+		} else {
2056
+			$query = "SELECT * FROM request WHERE status = :type;";
2057
+		}
2058 2058
 
2059
-	    $statement = $database->prepare($query);
2059
+		$statement = $database->prepare($query);
2060 2060
 
2061
-        $statement->bindValue(":type", $type);
2062
-        $statement->execute();
2061
+		$statement->bindValue(":type", $type);
2062
+		$statement->execute();
2063 2063
 
2064
-        $requests = $statement->fetchAll(PDO::FETCH_CLASS, "Request");
2065
-        foreach ($requests as $req) {
2066
-        	/** @var Request $req */
2067
-            $req->setDatabase($database);
2068
-        }
2064
+		$requests = $statement->fetchAll(PDO::FETCH_CLASS, "Request");
2065
+		foreach ($requests as $req) {
2066
+			/** @var Request $req */
2067
+			$req->setDatabase($database);
2068
+		}
2069 2069
 
2070
-        global $smarty;
2071
-        $smarty->assign("requests", $requests);
2072
-        $smarty->assign("showStatus", false);
2073
-        $html = $smarty->fetch("mainpage/requesttable.tpl");
2074
-        echo $html;
2075
-    } else {
2076
-        echo defaultpage();
2077
-    }
2070
+		global $smarty;
2071
+		$smarty->assign("requests", $requests);
2072
+		$smarty->assign("showStatus", false);
2073
+		$html = $smarty->fetch("mainpage/requesttable.tpl");
2074
+		echo $html;
2075
+	} else {
2076
+		echo defaultpage();
2077
+	}
2078 2078
 
2079
-    BootstrapSkin::displayInternalFooter();
2080
-    die();
2079
+	BootstrapSkin::displayInternalFooter();
2080
+	die();
2081 2081
 }
2082 2082
 # If the action specified does not exist, goto the default page.
2083 2083
 else {
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 	$user = User::getByUsername($_POST['username'], gGetDb());
350 350
     
351 351
 	if ($user == false || !$user->authenticate($_POST['password'])) {
352
-		header("Location: $baseurl/acc.php?error=authfail&tplUsername=" . urlencode($_POST['username']));
352
+		header("Location: $baseurl/acc.php?error=authfail&tplUsername=".urlencode($_POST['username']));
353 353
 		die();
354 354
 	}
355 355
     
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 				Logger::unbanned($database, $ban, $_POST['unbanreason']);
903 903
 			});
904 904
         
905
-			BootstrapSkin::displayAlertBox("Unbanned " . $ban->getTarget(), "alert-info", "", false, false);
905
+			BootstrapSkin::displayAlertBox("Unbanned ".$ban->getTarget(), "alert-info", "", false, false);
906 906
 			BootstrapSkin::displayInternalFooter();
907 907
 			Notification::unbanned($ban, $_POST['unbanreason']);
908 908
 			die();
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
         
1035 1035
 		if ($request->getStatus() == $_GET['target']) {
1036 1036
 			SessionAlert::error(
1037
-				"Cannot set status, target already deferred to " . htmlentities($_GET['target']), 
1037
+				"Cannot set status, target already deferred to ".htmlentities($_GET['target']), 
1038 1038
 				"Error");
1039 1039
 			header("Location: acc.php?action=zoom&id={$request->getId()}");
1040 1040
 			die();
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 	if ($request->getEmailSent() == "1" && !isset($_GET['override']) && $gem != 0) {
1151 1151
 		$alertContent = "<p>This request has already been closed in a manner that has generated an e-mail to the user, Proceed?</p><br />";
1152 1152
 		$alertContent .= "<div class=\"row-fluid\">";
1153
-		$alertContent .= "<a class=\"btn btn-success offset3 span3\"  href=\"$baseurl/acc.php?sum=" . $_GET['sum'] . "&amp;action=done&amp;id=" . $_GET['id'] . "&amp;override=yes&amp;email=" . $_GET['email'] . "\">Yes</a>";
1153
+		$alertContent .= "<a class=\"btn btn-success offset3 span3\"  href=\"$baseurl/acc.php?sum=".$_GET['sum']."&amp;action=done&amp;id=".$_GET['id']."&amp;override=yes&amp;email=".$_GET['email']."\">Yes</a>";
1154 1154
 		$alertContent .= "<a class=\"btn btn-danger span3\" href=\"$baseurl/acc.php\">No</a>";
1155 1155
 		$alertContent .= "</div>";
1156 1156
         
@@ -1161,9 +1161,9 @@  discard block
 block discarded – undo
1161 1161
 	
1162 1162
 	// check the request is not reserved by someone else
1163 1163
 	if ($request->getReserved() != 0 && !isset($_GET['reserveoverride']) && $request->getReserved() != User::getCurrent()->getId()) {
1164
-		$alertContent = "<p>This request is currently marked as being handled by " . $request->getReservedObject()->getUsername() . ", Proceed?</p><br />";
1164
+		$alertContent = "<p>This request is currently marked as being handled by ".$request->getReservedObject()->getUsername().", Proceed?</p><br />";
1165 1165
 		$alertContent .= "<div class=\"row-fluid\">";
1166
-		$alertContent .= "<a class=\"btn btn-success offset3 span3\"  href=\"$baseurl/acc.php?" . $_SERVER["QUERY_STRING"] . "&reserveoverride=yes\">Yes</a>";
1166
+		$alertContent .= "<a class=\"btn btn-success offset3 span3\"  href=\"$baseurl/acc.php?".$_SERVER["QUERY_STRING"]."&reserveoverride=yes\">Yes</a>";
1167 1167
 		$alertContent .= "<a class=\"btn btn-danger span3\" href=\"$baseurl/acc.php\">No</a>";
1168 1168
 		$alertContent .= "</div>";
1169 1169
         
@@ -1179,7 +1179,7 @@  discard block
 block discarded – undo
1179 1179
 	}
1180 1180
 	
1181 1181
 	// Checks whether the username is already in use on Wikipedia.
1182
-	$userexist = file_get_contents("http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=" . urlencode($request->getName()) . "&format=php");
1182
+	$userexist = file_get_contents("http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=".urlencode($request->getName())."&format=php");
1183 1183
 	$ue = unserialize($userexist);
1184 1184
 	if (!isset ($ue['query']['users']['0']['missing'])) {
1185 1185
 		$exists = true;
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
 	if ($isForCreated && !$exists && !isset($_GET['createoverride'])) {
1201 1201
 		$alertContent = "<p>You have chosen to mark this request as \"created\", but the account does not exist on the English Wikipedia, proceed?</p><br />";
1202 1202
 		$alertContent .= "<div class=\"row-fluid\">";
1203
-		$alertContent .= "<a class=\"btn btn-success offset3 span3\"  href=\"$baseurl/acc.php?" . $_SERVER["QUERY_STRING"] . "&amp;createoverride=yes\">Yes</a>";
1203
+		$alertContent .= "<a class=\"btn btn-success offset3 span3\"  href=\"$baseurl/acc.php?".$_SERVER["QUERY_STRING"]."&amp;createoverride=yes\">Yes</a>";
1204 1204
 		$alertContent .= "<a class=\"btn btn-danger span3\" href=\"$baseurl/acc.php\">No</a>";
1205 1205
 		$alertContent .= "</div>";
1206 1206
         
@@ -1245,26 +1245,26 @@  discard block
 block discarded – undo
1245 1245
 			die();
1246 1246
 		}
1247 1247
 
1248
-		$headers = 'From: [email protected]' . "\r\n";
1248
+		$headers = 'From: [email protected]'."\r\n";
1249 1249
 
1250 1250
 		// CC mailing list option
1251 1251
 		if (User::getCurrent()->isAdmin() || User::getCurrent()->isCheckuser()) {
1252 1252
 			// these people get the choice
1253 1253
 			if (isset($_POST['ccmailist']) && $_POST['ccmailist'] == "on") {
1254
-				$headers .= 'Cc: [email protected]' . "\r\n";
1254
+				$headers .= 'Cc: [email protected]'."\r\n";
1255 1255
 			}
1256 1256
 		} else {
1257 1257
 			// these people do not.
1258
-			$headers .= 'Cc: [email protected]' . "\r\n";
1258
+			$headers .= 'Cc: [email protected]'."\r\n";
1259 1259
 		}
1260 1260
 
1261
-		$headers .= 'X-ACC-Request: ' . $request->getId() . "\r\n";
1262
-		$headers .= 'X-ACC-UserID: ' . User::getCurrent()->getId() . "\r\n";
1261
+		$headers .= 'X-ACC-Request: '.$request->getId()."\r\n";
1262
+		$headers .= 'X-ACC-UserID: '.User::getCurrent()->getId()."\r\n";
1263 1263
 
1264 1264
 		// Get the closing user's Email signature and append it to the Email.
1265 1265
 		if (User::getCurrent()->getEmailSig() != "") {
1266 1266
 			$emailsig = html_entity_decode(User::getCurrent()->getEmailSig(), ENT_QUOTES, "UTF-8");
1267
-			mail($request->getEmail(), "RE: [ACC #{$request->getId()}] English Wikipedia Account Request", $_POST['msgbody'] . "\n\n" . $emailsig, $headers);
1267
+			mail($request->getEmail(), "RE: [ACC #{$request->getId()}] English Wikipedia Account Request", $_POST['msgbody']."\n\n".$emailsig, $headers);
1268 1268
 		}
1269 1269
 		else {
1270 1270
 			mail($request->getEmail(), "RE: [ACC #{$request->getId()}] English Wikipedia Account Request", $_POST['msgbody'], $headers);
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 			
1290 1290
 			Notification::requestClosed($request, $crea);
1291 1291
 			BootstrapSkin::displayAlertBox(
1292
-				"Request " . $request->getId() . " (" . htmlentities($request->getName(), ENT_COMPAT, 'UTF-8') . ") marked as '" . htmlentities($crea, ENT_COMPAT, 'UTF-8') . "'.", 
1292
+				"Request ".$request->getId()." (".htmlentities($request->getName(), ENT_COMPAT, 'UTF-8').") marked as '".htmlentities($crea, ENT_COMPAT, 'UTF-8')."'.", 
1293 1293
 				"alert-success");
1294 1294
 		}
1295 1295
 		else if ($_POST['action'] == "mail") {
@@ -1355,7 +1355,7 @@  discard block
 block discarded – undo
1355 1355
 		}
1356 1356
 
1357 1357
 		Notification::requestClosed($request, $crea);
1358
-		BootstrapSkin::displayAlertBox("Request " . $request->getId() . " (" . htmlentities($request->getName(), ENT_COMPAT, 'UTF-8') . ") marked as '" . htmlentities($crea, ENT_COMPAT, 'UTF-8') . "'.", "alert-success");
1358
+		BootstrapSkin::displayAlertBox("Request ".$request->getId()." (".htmlentities($request->getName(), ENT_COMPAT, 'UTF-8').") marked as '".htmlentities($crea, ENT_COMPAT, 'UTF-8')."'.", "alert-success");
1359 1359
 		
1360 1360
 		$towhom = $request->getEmail();
1361 1361
 		if ($gem != "0") {
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
 			if (!isset($_GET['confclosed'])) {
1525 1525
 				if ($request->getStatus() == "Closed") {
1526 1526
 					// FIXME: bootstrappify properly
1527
-					throw new TransactionException('This request is currently closed. Are you sure you wish to reserve it?<br /><ul><li><a href="' . $_SERVER["REQUEST_URI"] . '&confclosed=yes">Yes, reserve this closed request</a></li><li><a href="' . $baseurl . '/acc.php">No, return to main request interface</a></li></ul>', "Request closed", "alert-info");
1527
+					throw new TransactionException('This request is currently closed. Are you sure you wish to reserve it?<br /><ul><li><a href="'.$_SERVER["REQUEST_URI"].'&confclosed=yes">Yes, reserve this closed request</a></li><li><a href="'.$baseurl.'/acc.php">No, return to main request interface</a></li></ul>', "Request closed", "alert-info");
1528 1528
 				}
1529 1529
 			}	
1530 1530
         
@@ -1595,7 +1595,7 @@  discard block
 block discarded – undo
1595 1595
 			}
1596 1596
 		}
1597 1597
 		else {
1598
-			echo "You cannot break " . htmlentities($reservedUser->getUsername()) . "'s reservation";
1598
+			echo "You cannot break ".htmlentities($reservedUser->getUsername())."'s reservation";
1599 1599
 		}
1600 1600
 	}
1601 1601
 	else {
@@ -1695,7 +1695,7 @@  discard block
 block discarded – undo
1695 1695
 	}
1696 1696
     
1697 1697
 	if (!isset($_POST['comment']) || $_POST['comment'] == "") {
1698
-		header("Location: acc.php?action=zoom&id=" . $request->getId());
1698
+		header("Location: acc.php?action=zoom&id=".$request->getId());
1699 1699
 		die(); 
1700 1700
 	}
1701 1701
     
@@ -1728,7 +1728,7 @@  discard block
 block discarded – undo
1728 1728
     
1729 1729
 	Notification::commentCreated($comment);
1730 1730
     
1731
-	header("Location: acc.php?action=zoom&id=" . $request->getId());
1731
+	header("Location: acc.php?action=zoom&id=".$request->getId());
1732 1732
 }
1733 1733
 elseif ($action == "changepassword") {
1734 1734
 	if ((!isset($_POST['oldpassword'])) || $_POST['oldpassword'] == "") {
@@ -1806,7 +1806,7 @@  discard block
 block discarded – undo
1806 1806
 			Notification::commentEdited($comment);
1807 1807
         
1808 1808
 			SessionAlert::success("Comment has been saved successfully");
1809
-			header("Location: $baseurl/acc.php?action=zoom&id=" . $comment->getRequest());
1809
+			header("Location: $baseurl/acc.php?action=zoom&id=".$comment->getRequest());
1810 1810
 		});
1811 1811
         
1812 1812
 		die();    
Please login to merge, or discard this patch.
Braces   +72 added lines, -144 removed lines patch added patch discarded remove patch
@@ -77,8 +77,7 @@  discard block
 block discarded – undo
77 77
 		echo showlogin();
78 78
 		BootstrapSkin::displayInternalFooter();
79 79
 		die();
80
-	}
81
-	else {
80
+	} else {
82 81
 		// A content block is created if the action is none of the above.
83 82
 		// This block would later be used to keep all the HTML except the header and footer.
84 83
 		$out = "<div id=\"content\">";
@@ -101,8 +100,7 @@  discard block
 block discarded – undo
101 100
 	echo defaultpage();
102 101
 	BootstrapSkin::displayInternalFooter();
103 102
 	die();
104
-}
105
-elseif ($action == "sreg") {
103
+} elseif ($action == "sreg") {
106 104
 	global $useOauthSignup, $smarty;
107 105
         
108 106
 	// TODO: check blocked
@@ -196,8 +194,7 @@  discard block
 block discarded – undo
196 194
 					0, 
197 195
 					$ex);
198 196
 			}
199
-		}
200
-		else {
197
+		} else {
201 198
 			global $baseurl;
202 199
 			Notification::userNew($newUser);
203 200
 			header("Location: {$baseurl}/acc.php?action=registercomplete");
@@ -205,19 +202,16 @@  discard block
 block discarded – undo
205 202
 	});
206 203
     
207 204
 	die();
208
-}
209
-elseif ($action == "register") {
205
+} elseif ($action == "register") {
210 206
 	global $useOauthSignup, $smarty;
211 207
 	$smarty->assign("useOauthSignup", $useOauthSignup);
212 208
 	$smarty->display("registration/register.tpl");
213 209
 	BootstrapSkin::displayInternalFooter();
214 210
 	die();
215
-}
216
-elseif ($action == "registercomplete") {
211
+} elseif ($action == "registercomplete") {
217 212
 	$smarty->display("registration/alert-registrationcomplete.tpl");
218 213
 	BootstrapSkin::displayInternalFooter();
219
-}
220
-elseif ($action == "forgotpw") {
214
+} elseif ($action == "forgotpw") {
221 215
 	global $baseurl, $smarty;
222 216
     
223 217
 	if (isset ($_GET['si']) && isset ($_GET['id'])) {
@@ -246,14 +240,12 @@  discard block
 block discarded – undo
246 240
                     
247 241
 					BootstrapSkin::displayInternalFooter();
248 242
 					die();
249
-				}
250
-				else {
243
+				} else {
251 244
 					BootstrapSkin::displayAlertBox("Passwords did not match!", "alert-error", "Error", true, false);
252 245
 					BootstrapSkin::displayInternalFooter();
253 246
 					die();
254 247
 				}
255
-			}
256
-			else {
248
+			} else {
257 249
 				BootstrapSkin::displayAlertBox("Invalid request<!-- 1 -->", "alert-error", "Error", true, false);
258 250
 				BootstrapSkin::displayInternalFooter();
259 251
 				die();
@@ -267,8 +259,7 @@  discard block
 block discarded – undo
267 259
 			$smarty->assign('si', $_GET['si']);
268 260
 			$smarty->assign('id', $_GET['id']);
269 261
 			$smarty->display('forgot-password/forgotpwreset.tpl');
270
-		}
271
-		else {
262
+		} else {
272 263
 			BootstrapSkin::displayAlertBox(
273 264
 				"The hash supplied in the link did not match the hash in the database!", 
274 265
 				"alert-error", 
@@ -294,8 +285,7 @@  discard block
 block discarded – undo
294 285
             
295 286
 			BootstrapSkin::displayInternalFooter();
296 287
 			die();
297
-		}
298
-		elseif (strtolower($_POST['email']) != strtolower($user->getEmail())) {
288
+		} elseif (strtolower($_POST['email']) != strtolower($user->getEmail())) {
299 289
 			BootstrapSkin::displayAlertBox("Could not find user with that username and email address!", 
300 290
 				"alert-error", 
301 291
 				"Error", 
@@ -304,8 +294,7 @@  discard block
 block discarded – undo
304 294
             
305 295
 			BootstrapSkin::displayInternalFooter();
306 296
 			die();
307
-		}
308
-		else {
297
+		} else {
309 298
 			$hash = $user->getForgottenPasswordHash();
310 299
                        
311 300
 			$smarty->assign("user", $user);
@@ -337,8 +326,7 @@  discard block
 block discarded – undo
337 326
 
338 327
 	BootstrapSkin::displayInternalFooter();
339 328
 	die();
340
-}
341
-elseif ($action == "login") {
329
+} elseif ($action == "login") {
342 330
 	global $baseurl, $smarty;
343 331
     
344 332
 	if (!isset($_POST['username'])) {
@@ -369,8 +357,7 @@  discard block
 block discarded – undo
369 357
             
370 358
 			reattachOAuthAccount($user);
371 359
 		}
372
-	}
373
-	else {
360
+	} else {
374 361
 		global $enforceOAuth;
375 362
         
376 363
 		if ($enforceOAuth) {
@@ -453,8 +440,7 @@  discard block
 block discarded – undo
453 440
 	}
454 441
     
455 442
 	header("Location: $baseurl/acc.php");
456
-}
457
-elseif ($action == "messagemgmt") {
443
+} elseif ($action == "messagemgmt") {
458 444
 	global $smarty;
459 445
     
460 446
 	if (isset($_GET['view'])) {
@@ -538,8 +524,7 @@  discard block
 block discarded – undo
538 524
    
539 525
 	BootstrapSkin::displayInternalFooter();
540 526
 	die();
541
-}
542
-elseif ($action == "templatemgmt") {
527
+} elseif ($action == "templatemgmt") {
543 528
 	global $baseurl, $smarty;
544 529
     
545 530
 	if (isset($_GET['view'])) {
@@ -585,15 +570,13 @@  discard block
 block discarded – undo
585 570
 				SessionAlert::success("Template successfully created.");
586 571
 				header("Location: $baseurl/acc.php?action=templatemgmt");
587 572
 			});
588
-		}
589
-		else {
573
+		} else {
590 574
 			
591 575
 			if (isset($_POST['preview'])) {
592 576
 				$usercode = $_POST['usercode'];
593 577
 				$botcode = $_POST['botcode'];
594 578
 				echo displayPreview($usercode);
595
-			}
596
-			else {
579
+			} else {
597 580
 				$usercode = '';
598 581
 				$botcode = '';
599 582
 			}
@@ -619,8 +602,7 @@  discard block
 block discarded – undo
619 602
 			SessionAlert::success("Disabled automatic user welcoming.");
620 603
 			header("Location: {$baseurl}/acc.php?action=templatemgmt");
621 604
 			die();
622
-		}
623
-		else {
605
+		} else {
624 606
 			$template = WelcomeTemplate::getById($_GET['select'], gGetDb());
625 607
 			if ($template !== false) {
626 608
 				$user->setWelcomeTemplate($template->getId());
@@ -629,8 +611,7 @@  discard block
 block discarded – undo
629 611
 				SessionAlert::success("Updated selected welcome template for automatic welcoming.");
630 612
 				header("Location: {$baseurl}/acc.php?action=templatemgmt");
631 613
 				die();
632
-			}
633
-			else {
614
+			} else {
634 615
 				SessionAlert::error("Something went wrong, we can't find the template you asked for!");
635 616
 				header("Location: {$baseurl}/acc.php?action=templatemgmt");
636 617
 				die();
@@ -707,8 +688,7 @@  discard block
 block discarded – undo
707 688
             
708 689
 			header("Location: $baseurl/acc.php?action=templatemgmt");
709 690
 			die();
710
-		}
711
-		else {
691
+		} else {
712 692
 			$smarty->assign("template", $template);
713 693
 			$smarty->display("welcometemplate/edit.tpl");
714 694
             
@@ -724,8 +704,7 @@  discard block
 block discarded – undo
724 704
     
725 705
 	BootstrapSkin::displayInternalFooter();
726 706
 	die();
727
-}
728
-elseif ($action == "sban") {
707
+} elseif ($action == "sban") {
729 708
 	global $smarty;
730 709
     
731 710
 	// Checks whether the current user is an admin.
@@ -753,21 +732,18 @@  discard block
 block discarded – undo
753 732
     
754 733
 	if ($duration == "-1") {
755 734
 		$duration = -1;
756
-	}
757
-	elseif ($duration == "other") {
735
+	} elseif ($duration == "other") {
758 736
 		$duration = strtotime($_POST['otherduration']);
759 737
 		if (!$duration) {
760 738
 			BootstrapSkin::displayAlertBox("Invalid ban time", "alert-error", "", false, false);
761 739
 			BootstrapSkin::displayInternalFooter();
762 740
 			die();
763
-		}
764
-		elseif (time() > $duration) {
741
+		} elseif (time() > $duration) {
765 742
 			BootstrapSkin::displayAlertBox("Ban time has already expired!", "alert-error", "", false, false);
766 743
 			BootstrapSkin::displayInternalFooter();
767 744
 			die();
768 745
 		}
769
-	}
770
-	else {
746
+	} else {
771 747
 		$duration = $duration + time();
772 748
 	}
773 749
     
@@ -847,8 +823,7 @@  discard block
 block discarded – undo
847 823
     
848 824
 	BootstrapSkin::displayInternalFooter();
849 825
 	die();
850
-}
851
-elseif ($action == "unban") {
826
+} elseif ($action == "unban") {
852 827
 	global $smarty;
853 828
     
854 829
 	if (!isset($_GET['id']) || $_GET['id'] == "") {
@@ -887,8 +862,7 @@  discard block
 block discarded – undo
887 862
 			BootstrapSkin::displayAlertBox("You must enter an unban reason!", "alert-error", "", false, false);
888 863
 			BootstrapSkin::displayInternalFooter();
889 864
 			die();
890
-		}
891
-		else {
865
+		} else {
892 866
 			$database = gGetDb();
893 867
             
894 868
 			$database->transactionally(function() use ($database, $ban)
@@ -907,15 +881,13 @@  discard block
 block discarded – undo
907 881
 			Notification::unbanned($ban, $_POST['unbanreason']);
908 882
 			die();
909 883
 		}
910
-	}
911
-	else {
884
+	} else {
912 885
 		$smarty->assign("ban", $ban);
913 886
 		$smarty->display("bans/unban.tpl");
914 887
         
915 888
 		BootstrapSkin::displayInternalFooter();
916 889
 	}
917
-}
918
-elseif ($action == "ban") {
890
+} elseif ($action == "ban") {
919 891
 	global $smarty;
920 892
     
921 893
 	if (isset ($_GET['ip']) || isset ($_GET['email']) || isset ($_GET['name'])) {
@@ -935,8 +907,7 @@  discard block
 block discarded – undo
935 907
 			$row = $statement->fetch(PDO::FETCH_ASSOC);
936 908
 			$target = getTrustedClientIP($row['ip'], $row['forwardedip']);
937 909
 			$type = "IP";
938
-		}
939
-		elseif (isset($_GET['email'])) {
910
+		} elseif (isset($_GET['email'])) {
940 911
 			$query = "SELECT email FROM request WHERE id = :ip;";
941 912
 			$statement = $database->prepare($query);
942 913
 			$statement->bindValue(":ip", $_GET['email']);
@@ -944,8 +915,7 @@  discard block
 block discarded – undo
944 915
 			$row = $statement->fetch(PDO::FETCH_ASSOC);
945 916
 			$target = $row['email'];
946 917
 			$type = "EMail";
947
-		}
948
-		elseif (isset($_GET['name'])) {
918
+		} elseif (isset($_GET['name'])) {
949 919
 			$query = "SELECT name FROM request WHERE id = :ip;";
950 920
 			$statement = $database->prepare($query);
951 921
 			$statement->bindValue(":ip", $_GET['name']);
@@ -953,8 +923,7 @@  discard block
 block discarded – undo
953 923
 			$row = $statement->fetch(PDO::FETCH_ASSOC);
954 924
 			$target = $row['name'];
955 925
 			$type = "Name";
956
-		}
957
-		else {
926
+		} else {
958 927
 			BootstrapSkin::displayAlertBox("Unknown ban type.", "alert-error");
959 928
 			BootstrapSkin::displayInternalFooter();
960 929
 			die();    
@@ -969,8 +938,7 @@  discard block
 block discarded – undo
969 938
 		$smarty->assign("bantype", $type);
970 939
 		$smarty->assign("bantarget", trim($target));
971 940
 		$smarty->display("bans/banform.tpl");
972
-	}
973
-	else {
941
+	} else {
974 942
 		$bans = Ban::getActiveBans();
975 943
   
976 944
 		$smarty->assign("activebans", $bans);
@@ -979,8 +947,7 @@  discard block
 block discarded – undo
979 947
     
980 948
 	BootstrapSkin::displayInternalFooter();
981 949
 	die();
982
-}
983
-elseif ($action == "defer" && $_GET['id'] != "" && $_GET['sum'] != "") {
950
+} elseif ($action == "defer" && $_GET['id'] != "" && $_GET['sum'] != "") {
984 951
 	global $availableRequestStates;
985 952
 	
986 953
 	if (array_key_exists($_GET['target'], $availableRequestStates)) {
@@ -1061,14 +1028,12 @@  discard block
 block discarded – undo
1061 1028
 		});
1062 1029
         
1063 1030
 		die();
1064
-	}
1065
-	else {
1031
+	} else {
1066 1032
 		BootstrapSkin::displayAlertBox("Defer target not valid.", "alert-error", "Error", true, false);
1067 1033
 		BootstrapSkin::displayInternalFooter();
1068 1034
 		die();
1069 1035
 	}
1070
-}
1071
-elseif ($action == "prefs") {
1036
+} elseif ($action == "prefs") {
1072 1037
 	global $smarty, $enforceOAuth;
1073 1038
     
1074 1039
 	if (isset ($_POST['sig'])) {
@@ -1082,8 +1047,7 @@  discard block
 block discarded – undo
1082 1047
             
1083 1048
 			if ($mailisvalid === false) {
1084 1049
 				BootstrapSkin::displayAlertBox("Invalid email address", "alert-error", "Error!");
1085
-			}
1086
-			else {
1050
+			} else {
1087 1051
 				$user->setEmail(trim($_POST['email']));
1088 1052
 			}
1089 1053
 		}
@@ -1104,20 +1068,17 @@  discard block
 block discarded – undo
1104 1068
 	$smarty->display("prefs.tpl");
1105 1069
 	BootstrapSkin::displayInternalFooter();
1106 1070
 	die();
1107
-}
1108
-elseif ($action == "done" && $_GET['id'] != "") {
1071
+} elseif ($action == "done" && $_GET['id'] != "") {
1109 1072
 	// check for valid close reasons
1110 1073
 	global $messages, $baseurl, $smarty;
1111 1074
 	
1112 1075
 	if (isset($_GET['email'])) {
1113 1076
 		if ($_GET['email'] == 0 || $_GET['email'] == "custom") {
1114 1077
 			$validEmail = true;
1115
-		}
1116
-		else {
1078
+		} else {
1117 1079
 			$validEmail = EmailTemplate::getById($_GET['email'], gGetDb()) != false;
1118 1080
 		}
1119
-	}
1120
-	else {
1081
+	} else {
1121 1082
 		$validEmail = false;
1122 1083
 	}
1123 1084
     
@@ -1183,8 +1144,7 @@  discard block
 block discarded – undo
1183 1144
 	$ue = unserialize($userexist);
1184 1145
 	if (!isset ($ue['query']['users']['0']['missing'])) {
1185 1146
 		$exists = true;
1186
-	}
1187
-	else {
1147
+	} else {
1188 1148
 		$exists = false;
1189 1149
 	}
1190 1150
 
@@ -1226,8 +1186,7 @@  discard block
 block discarded – undo
1226 1186
 				$preloadTitle = $template->getName();
1227 1187
 				$preloadText = $template->getText();
1228 1188
 				$preloadAction = $template->getDefaultAction();
1229
-			}
1230
-			else {
1189
+			} else {
1231 1190
 				$preloadText = "";
1232 1191
 				$preloadTitle = "";
1233 1192
 				$preloadAction = "";
@@ -1265,8 +1224,7 @@  discard block
 block discarded – undo
1265 1224
 		if (User::getCurrent()->getEmailSig() != "") {
1266 1225
 			$emailsig = html_entity_decode(User::getCurrent()->getEmailSig(), ENT_QUOTES, "UTF-8");
1267 1226
 			mail($request->getEmail(), "RE: [ACC #{$request->getId()}] English Wikipedia Account Request", $_POST['msgbody'] . "\n\n" . $emailsig, $headers);
1268
-		}
1269
-		else {
1227
+		} else {
1270 1228
 			mail($request->getEmail(), "RE: [ACC #{$request->getId()}] English Wikipedia Account Request", $_POST['msgbody'], $headers);
1271 1229
 		}
1272 1230
 
@@ -1279,8 +1237,7 @@  discard block
 block discarded – undo
1279 1237
 			if ($_POST['action'] == EmailTemplate::CREATED) {
1280 1238
 				$gem  = 'custom-y';
1281 1239
 				$crea = "Custom, Created";
1282
-			}
1283
-			else {
1240
+			} else {
1284 1241
 				$gem  = 'custom-n';
1285 1242
 				$crea = "Custom, Not Created";
1286 1243
 			}
@@ -1291,8 +1248,7 @@  discard block
 block discarded – undo
1291 1248
 			BootstrapSkin::displayAlertBox(
1292 1249
 				"Request " . $request->getId() . " (" . htmlentities($request->getName(), ENT_COMPAT, 'UTF-8') . ") marked as '" . htmlentities($crea, ENT_COMPAT, 'UTF-8') . "'.", 
1293 1250
 				"alert-success");
1294
-		}
1295
-		else if ($_POST['action'] == "mail") {
1251
+		} else if ($_POST['action'] == "mail") {
1296 1252
 			// no action other than send mail!
1297 1253
 			Logger::sentMail(gGetDb(), $request, $messageBody);
1298 1254
 			Logger::unreserve(gGetDb(), $request);
@@ -1300,8 +1256,7 @@  discard block
 block discarded – undo
1300 1256
 			Notification::sentMail($request);
1301 1257
 			BootstrapSkin::displayAlertBox("Sent mail to Request {$request->getId()}", 
1302 1258
 				"alert-success");
1303
-		}
1304
-		else if (array_key_exists($_POST['action'], $availableRequestStates)) {
1259
+		} else if (array_key_exists($_POST['action'], $availableRequestStates)) {
1305 1260
 			// Defer
1306 1261
 
1307 1262
 			$request->setStatus($_POST['action']);
@@ -1314,8 +1269,7 @@  discard block
 block discarded – undo
1314 1269
 			Notification::requestDeferredWithMail($request);
1315 1270
 			BootstrapSkin::displayAlertBox("Request {$request->getId()} deferred to $deto, sending an email.", 
1316 1271
 				"alert-success");
1317
-		}
1318
-		else {
1272
+		} else {
1319 1273
 			// hmm. not sure what happened. Log that we sent the mail anyway.
1320 1274
 			Logger::sentMail(gGetDb(), $request, $messageBody);
1321 1275
 			Logger::unreserve(gGetDb(), $request);
@@ -1334,8 +1288,7 @@  discard block
 block discarded – undo
1334 1288
 		echo defaultpage();
1335 1289
 		BootstrapSkin::displayInternalFooter();
1336 1290
 		die();		
1337
-	}
1338
-	else {
1291
+	} else {
1339 1292
 		// Not a custom close, just a normal close
1340 1293
 	    
1341 1294
 		$request->setStatus('Closed');
@@ -1348,8 +1301,7 @@  discard block
 block discarded – undo
1348 1301
 		
1349 1302
 		if ($gem == '0') {
1350 1303
 			$crea = "Dropped";
1351
-		}
1352
-		else {
1304
+		} else {
1353 1305
 			$template = EmailTemplate::getById($gem, gGetDb());
1354 1306
 			$crea = $template->getName();
1355 1307
 		}
@@ -1370,8 +1322,7 @@  discard block
 block discarded – undo
1370 1322
 		BootstrapSkin::displayInternalFooter();
1371 1323
 		die();
1372 1324
 	}
1373
-}
1374
-elseif ($action == "zoom") {
1325
+} elseif ($action == "zoom") {
1375 1326
 	if (!isset($_GET['id'])) {
1376 1327
 		BootstrapSkin::displayAlertBox("No request specified!", "alert-error", "Error!", true, false);
1377 1328
 		BootstrapSkin::displayInternalFooter();
@@ -1380,8 +1331,7 @@  discard block
 block discarded – undo
1380 1331
     
1381 1332
 	if (isset($_GET['hash'])) {
1382 1333
 		$urlhash = $_GET['hash'];
1383
-	}
1384
-	else {
1334
+	} else {
1385 1335
 		$urlhash = "";
1386 1336
 	}
1387 1337
 	echo zoomPage($_GET['id'], $urlhash);
@@ -1389,8 +1339,7 @@  discard block
 block discarded – undo
1389 1339
 	$tailscript = getTypeaheadSource(User::getAllUsernames(gGetDb()));
1390 1340
 	BootstrapSkin::displayInternalFooter($tailscript);
1391 1341
 	die();
1392
-}
1393
-elseif ($action == "logs") {
1342
+} elseif ($action == "logs") {
1394 1343
 	global $baseurl;
1395 1344
 	
1396 1345
 	$filterUser = isset($_GET['filterUser']) && $_GET['filterUser'] != "" ? $_GET['filterUser'] : false;
@@ -1438,11 +1387,9 @@  discard block
 block discarded – undo
1438 1387
 	if ($pageCount < $pageLimit) {
1439 1388
 		if ($pageData['lowpage'] == 1 && $pageData['hipage'] == $pageData['maxpage']) {
1440 1389
 			// nothing to do, we're already at max range.	
1441
-		}
1442
-		elseif ($pageData['lowpage'] == 1 && $pageData['hipage'] < $pageData['maxpage']) {
1390
+		} elseif ($pageData['lowpage'] == 1 && $pageData['hipage'] < $pageData['maxpage']) {
1443 1391
 			$pageData['hipage'] = min($pageLimit, $pageData['maxpage']);
1444
-		}
1445
-		elseif ($pageData['lowpage'] > 1 && $pageData['hipage'] == $pageData['maxpage']) {
1392
+		} elseif ($pageData['lowpage'] > 1 && $pageData['hipage'] == $pageData['maxpage']) {
1446 1393
 			$pageData['lowpage'] = max(1, $pageData['maxpage'] - $pageLimit + 1);
1447 1394
 		}
1448 1395
 	}
@@ -1465,8 +1412,7 @@  discard block
 block discarded – undo
1465 1412
 	
1466 1413
 	BootstrapSkin::displayInternalFooter($tailscript);
1467 1414
 	die();
1468
-}
1469
-elseif ($action == "reserve") {
1415
+} elseif ($action == "reserve") {
1470 1416
 	$database = gGetDb();
1471 1417
     
1472 1418
 	$database->transactionally(function() use ($database)
@@ -1542,8 +1488,7 @@  discard block
 block discarded – undo
1542 1488
 	});
1543 1489
 	    
1544 1490
 	die();	
1545
-}
1546
-elseif ($action == "breakreserve") {
1491
+} elseif ($action == "breakreserve") {
1547 1492
 	global $smarty;
1548 1493
     
1549 1494
 	$database = gGetDb();
@@ -1585,20 +1530,17 @@  discard block
 block discarded – undo
1585 1530
 				});
1586 1531
                 
1587 1532
 				die();
1588
-			}
1589
-			else {
1533
+			} else {
1590 1534
 				global $baseurl;
1591 1535
 				$smarty->assign("reservedUser", $reservedUser);
1592 1536
 				$smarty->assign("request", $request);
1593 1537
                 
1594 1538
 				$smarty->display("confirmations/breakreserve.tpl");
1595 1539
 			}
1596
-		}
1597
-		else {
1540
+		} else {
1598 1541
 			echo "You cannot break " . htmlentities($reservedUser->getUsername()) . "'s reservation";
1599 1542
 		}
1600
-	}
1601
-	else {
1543
+	} else {
1602 1544
 		$database->transactionally(function() use ($database, $request)
1603 1545
 		{
1604 1546
 			$request->setReserved(0);
@@ -1615,8 +1557,7 @@  discard block
 block discarded – undo
1615 1557
     
1616 1558
 	BootstrapSkin::displayInternalFooter();
1617 1559
 	die();		
1618
-}
1619
-elseif ($action == "comment") {
1560
+} elseif ($action == "comment") {
1620 1561
 	global $smarty;
1621 1562
     
1622 1563
 	$request = Request::getById($_GET['id'], gGetDb());
@@ -1624,8 +1565,7 @@  discard block
 block discarded – undo
1624 1565
 	$smarty->display("commentform.tpl");
1625 1566
 	BootstrapSkin::displayInternalFooter();
1626 1567
 	die();
1627
-}
1628
-elseif ($action == "comment-add") {
1568
+} elseif ($action == "comment-add") {
1629 1569
 	global $baseurl, $smarty;
1630 1570
     
1631 1571
 	$request = Request::getById($_POST['id'], gGetDb());
@@ -1670,8 +1610,7 @@  discard block
 block discarded – undo
1670 1610
     
1671 1611
 	if (isset($_GET['hash'])) {
1672 1612
 		$urlhash = urlencode(htmlentities($_GET['hash']));
1673
-	}
1674
-	else {
1613
+	} else {
1675 1614
 		$urlhash = "";
1676 1615
 	}
1677 1616
 
@@ -1685,8 +1624,7 @@  discard block
 block discarded – undo
1685 1624
         
1686 1625
 	BootstrapSkin::displayInternalFooter();
1687 1626
 	die();
1688
-}
1689
-elseif ($action == "comment-quick") {
1627
+} elseif ($action == "comment-quick") {
1690 1628
 	$request = Request::getById($_POST['id'], gGetDb());
1691 1629
 	if ($request == false) {
1692 1630
 		BootstrapSkin::displayAlertBox("Could not find request!", "alert-error", "Error", true, false);
@@ -1729,8 +1667,7 @@  discard block
 block discarded – undo
1729 1667
 	Notification::commentCreated($comment);
1730 1668
     
1731 1669
 	header("Location: acc.php?action=zoom&id=" . $request->getId());
1732
-}
1733
-elseif ($action == "changepassword") {
1670
+} elseif ($action == "changepassword") {
1734 1671
 	if ((!isset($_POST['oldpassword'])) || $_POST['oldpassword'] == "") {
1735 1672
 		//Throw an error if old password is not specified.
1736 1673
 		BootstrapSkin::displayAlertBox("You did not enter your old password.", "alert-error", "Error", true, false);
@@ -1767,8 +1704,7 @@  discard block
 block discarded – undo
1767 1704
 	BootstrapSkin::displayAlertBox("Password successfully changed!", "alert-success", "", false, false);
1768 1705
 	BootstrapSkin::displayInternalFooter();
1769 1706
 	die();
1770
-}
1771
-elseif ($action == "ec") {
1707
+} elseif ($action == "ec") {
1772 1708
 	// edit comment
1773 1709
   
1774 1710
 	global $smarty, $baseurl;
@@ -1810,15 +1746,13 @@  discard block
 block discarded – undo
1810 1746
 		});
1811 1747
         
1812 1748
 		die();    
1813
-	}
1814
-	else {
1749
+	} else {
1815 1750
 		$smarty->assign("comment", $comment);
1816 1751
 		$smarty->display("edit-comment.tpl");
1817 1752
 		BootstrapSkin::displayInternalFooter();
1818 1753
 		die();
1819 1754
 	}
1820
-}
1821
-elseif ($action == "sendtouser") {
1755
+} elseif ($action == "sendtouser") {
1822 1756
 	global $baseurl;
1823 1757
     
1824 1758
 	$database = gGetDb();
@@ -1857,8 +1791,7 @@  discard block
 block discarded – undo
1857 1791
 	Notification::requestReservationSent($requestObject, $user);
1858 1792
 	SessionAlert::success("Reservation sent successfully");
1859 1793
 	header("Location: $baseurl/acc.php?action=zoom&id=$request");
1860
-}
1861
-elseif ($action == "emailmgmt") {
1794
+} elseif ($action == "emailmgmt") {
1862 1795
 	global $smarty, $createdid, $availableRequestStates;
1863 1796
     
1864 1797
 	/* New page for managing Emails, since I would rather not be handling editing
@@ -1935,8 +1868,7 @@  discard block
 block discarded – undo
1935 1868
 				$emailTemplate->setDefaultAction(EmailTemplate::CREATED);
1936 1869
 				$emailTemplate->setActive(1);
1937 1870
 				$emailTemplate->setPreloadOnly(0);
1938
-			}
1939
-			else {
1871
+			} else {
1940 1872
 				$emailTemplate->setDefaultAction($_POST['defaultaction']);
1941 1873
 				$emailTemplate->setActive(isset($_POST['active']));
1942 1874
 				$emailTemplate->setPreloadOnly(isset($_POST['preloadonly']));
@@ -1991,16 +1923,14 @@  discard block
 block discarded – undo
1991 1923
  
1992 1924
 	if (count($inactiverows) > 0) {
1993 1925
 		$smarty->assign('displayinactive', true);
1994
-	}
1995
-	else {
1926
+	} else {
1996 1927
 		$smarty->assign('displayinactive', false);
1997 1928
 	}
1998 1929
     
1999 1930
 	$smarty->display("email-management/main.tpl");
2000 1931
 	BootstrapSkin::displayInternalFooter();
2001 1932
 	die();
2002
-}
2003
-elseif ($action == "oauthdetach") {
1933
+} elseif ($action == "oauthdetach") {
2004 1934
 	if ($enforceOAuth) {
2005 1935
 		BootstrapSkin::displayAccessDenied();
2006 1936
 		BootstrapSkin::displayInternalFooter();
@@ -2013,8 +1943,7 @@  discard block
 block discarded – undo
2013 1943
 	$currentUser->detachAccount();
2014 1944
         
2015 1945
 	header("Location: {$baseurl}/acc.php?action=logout");
2016
-}
2017
-elseif ($action == "oauthattach") {
1946
+} elseif ($action == "oauthattach") {
2018 1947
 	$database = gGetDb();
2019 1948
 	$database->transactionally(function() use ($database)
2020 1949
 	{
@@ -2041,8 +1970,7 @@  discard block
 block discarded – undo
2041 1970
 			throw new TransactionException($ex->getMessage(), "Connection to Wikipedia failed.", "alert-error", 0, $ex);
2042 1971
 		}
2043 1972
 	});
2044
-}
2045
-elseif ($action == "listall") {
1973
+} elseif ($action == "listall") {
2046 1974
     global $availableRequestStates, $enableEmailConfirm;
2047 1975
 
2048 1976
 	if (isset($_GET['status']) && isset($availableRequestStates[$_GET['status']])) {
Please login to merge, or discard this patch.
oauth/OAuthUtility.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	{
25 25
 		global $toolUserAgent;
26 26
 
27
-		$endpoint = $this->baseUrlInternal . '/initiate&format=json&oauth_callback=oob';
27
+		$endpoint = $this->baseUrlInternal.'/initiate&format=json&oauth_callback=oob';
28 28
 
29 29
 		$c = new OAuthConsumer($this->consumerToken, $this->consumerSecret);
30 30
 		$parsed = parse_url($endpoint);
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$data = curl_exec($ch);
44 44
 
45 45
 		if (!$data) {
46
-			throw new Exception('Curl error: ' . curl_error($ch));
46
+			throw new Exception('Curl error: '.curl_error($ch));
47 47
 		}
48 48
 
49 49
 		$token = json_decode($data);
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	{
65 65
 		global $toolUserAgent;
66 66
 
67
-		$endpoint = $this->baseUrlInternal . '/token&format=json';
67
+		$endpoint = $this->baseUrlInternal.'/token&format=json';
68 68
 
69 69
 		$c = new OAuthConsumer($this->consumerToken, $this->consumerSecret);
70 70
 		$rc = new OAuthConsumer($requestToken, $requestSecret);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		$data = curl_exec($ch);
89 89
 
90 90
 		if (!$data) {
91
-			throw new Exception('Curl error: ' . curl_error($ch));
91
+			throw new Exception('Curl error: '.curl_error($ch));
92 92
 		}
93 93
 
94 94
 		$token = json_decode($data);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
 		$ch = curl_init();
122 122
 		if ($method == "GET") {
123
-			curl_setopt($ch, CURLOPT_URL, $mediawikiWebServiceEndpoint . "?" . http_build_query($apiParams));
123
+			curl_setopt($ch, CURLOPT_URL, $mediawikiWebServiceEndpoint."?".http_build_query($apiParams));
124 124
 		}
125 125
         
126 126
 		if ($method == "POST") {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		$data = curl_exec($ch);
139 139
 
140 140
 		if (!$data) {
141
-			throw new Exception('Curl error: ' . curl_error($ch));
141
+			throw new Exception('Curl error: '.curl_error($ch));
142 142
 		}
143 143
 
144 144
 		return json_decode($data);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 		global $toolUserAgent;
151 151
 
152
-		$endpoint = $this->baseUrlInternal . '/identify&format=json';
152
+		$endpoint = $this->baseUrlInternal.'/identify&format=json';
153 153
 
154 154
 		$c = new OAuthConsumer($this->consumerToken, $this->consumerSecret);
155 155
 		$rc = new OAuthToken($accessToken, $accessSecret);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		$data = curl_exec($ch);
173 173
 
174 174
 		if (!$data) {
175
-			throw new Exception('Curl error: ' . curl_error($ch));
175
+			throw new Exception('Curl error: '.curl_error($ch));
176 176
 		}
177 177
 
178 178
 		$decodedData = json_decode($data);
Please login to merge, or discard this patch.
RecreateTrustedIPs.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
 	$hashPos = strpos($rawline, '#');
25 25
 	if ($hashPos !== false) {
26 26
 		$line = substr($rawline, 0, $hashPos);
27
-	}
28
-	else {
27
+	} else {
29 28
 		$line = $rawline;
30 29
 	}
31 30
     
Please login to merge, or discard this patch.
includes/session.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 					reattachOAuthAccount(User::getCurrent());
71 71
 				}
72
-			}
73
-			else {
72
+			} else {
74 73
 				global $enforceOAuth;
75 74
 
76 75
 				if ($enforceOAuth) {
@@ -83,8 +82,7 @@  discard block
 block discarded – undo
83 82
 			BootstrapSkin::displayAlertBox("I'm sorry, but, your account has not been approved by a site administrator yet. Please stand by.", "alert-error", "New account", true, false);
84 83
 			BootstrapSkin::displayInternalFooter();
85 84
 			die();
86
-		}
87
-		elseif (User::getCurrent()->isSuspended()) {
85
+		} elseif (User::getCurrent()->isSuspended()) {
88 86
 			$database = gGetDb();
89 87
 			$suspendstatement = $database->prepare(<<<SQL
90 88
 SELECT comment 
@@ -105,8 +103,7 @@  discard block
 block discarded – undo
105 103
 			$smarty->display("login/suspended.tpl");
106 104
 			BootstrapSkin::displayInternalFooter();
107 105
 			die();
108
-		}
109
-		elseif (User::getCurrent()->isDeclined()) {
106
+		} elseif (User::getCurrent()->isDeclined()) {
110 107
 			$database = gGetDb();
111 108
 			$suspendstatement = $database->prepare(<<<SQL
112 109
 SELECT comment
@@ -127,11 +124,9 @@  discard block
 block discarded – undo
127 124
 			$smarty->display("login/declined.tpl");
128 125
 			BootstrapSkin::displayInternalFooter();
129 126
 			die();
130
-		}
131
-		elseif ((!User::getCurrent()->isCommunityUser()) && (User::getCurrent()->isUser() || User::getCurrent()->isAdmin())) {
127
+		} elseif ((!User::getCurrent()->isCommunityUser()) && (User::getCurrent()->isUser() || User::getCurrent()->isAdmin())) {
132 128
 			$secure = 1;
133
-		}
134
-		else {
129
+		} else {
135 130
 			//die("Not logged in!");
136 131
 		}
137 132
 	}
Please login to merge, or discard this patch.
includes/Providers/IpLocationProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 	{
55 55
 		try {
56 56
 			if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
57
-				$xml = @file_get_contents($this->getApiBase() . '?key=' . $this->apikey . '&ip=' . $ip . '&format=xml');
57
+				$xml = @file_get_contents($this->getApiBase().'?key='.$this->apikey.'&ip='.$ip.'&format=xml');
58 58
 
59 59
 				$response = @new SimpleXMLElement($xml);
60 60
 
Please login to merge, or discard this patch.
config.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
 $BUbasefile = "backup"; // The basefile's name.
143 143
 $BUdir = "/home/project/a/c/c/acc/backups"; // The directory where backups should be stored.
144
-$BUmonthdir = $BUdir . "/monthly"; // The directory where monthly backups should be stored.
144
+$BUmonthdir = $BUdir."/monthly"; // The directory where monthly backups should be stored.
145 145
 $BUdumper = "/opt/ts/mysql/5.1/bin/mysqldump --defaults-file=~/.my.cnf p_acc_live"; // Add parameters here if they are needed.
146 146
 $BUgzip = "/usr/bin/gzip"; // Add the gzip parameters here if needed.
147 147
 $BUtar = "/bin/tar -cvf"; // Add the tar parameters here if needed.
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
 
280 280
 $cDatabaseConfig = array(
281 281
 	"acc" => array(
282
-		"dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database,
282
+		"dsrcname" => "mysql:host=".$toolserver_host.";dbname=".$toolserver_database,
283 283
 		"username" => $toolserver_username,
284 284
 		"password" => $toolserver_password,
285 285
 		"options"  => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'),
286 286
 	),
287 287
 	"wikipedia" => array(
288
-		"dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db,
288
+		"dsrcname" => "mysql:host=".$antispoof_host.";dbname=".$antispoof_db,
289 289
 		"username" => $toolserver_username,
290 290
 		"password" => $toolserver_password,
291 291
 		"options"  => array(),
292 292
 	),
293 293
 	"notifications" => array(
294
-		"dsrcname" => "mysql:host=" . $toolserver_notification_dbhost . ";dbname=" . $toolserver_notification_database,
294
+		"dsrcname" => "mysql:host=".$toolserver_notification_dbhost.";dbname=".$toolserver_notification_database,
295 295
 		"username" => $notifications_username,
296 296
 		"password" => $notifications_password,
297 297
 		"options"  => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'),
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
 	"openssl", // email confirmation hash gen, oauth stuff
315 315
 	) as $x) {if (!extension_loaded($x)) {die("extension $x is required."); }}
316 316
 
317
-require_once($filepath . "includes/AutoLoader.php");
317
+require_once($filepath."includes/AutoLoader.php");
318 318
 
319 319
 spl_autoload_register("AutoLoader::load");
320 320
 
321
-require_once($filepath . 'vendor/autoload.php');
321
+require_once($filepath.'vendor/autoload.php');
322 322
 
323 323
 // Extra includes which are just plain awkward wherever they are.
324
-require_once($filepath . 'oauth/OAuthUtility.php');
324
+require_once($filepath.'oauth/OAuthUtility.php');
Please login to merge, or discard this patch.