@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $cacheResult = AntiSpoofCache::getByUsername($username, gGetDb()); |
| 16 | 16 | if ($cacheResult == false) { |
| 17 | 17 | // get the data from the API |
| 18 | - $data = file_get_contents($mediawikiWebServiceEndpoint . "?action=antispoof&format=php&username=" . urlencode($username)); |
|
| 18 | + $data = file_get_contents($mediawikiWebServiceEndpoint."?action=antispoof&format=php&username=".urlencode($username)); |
|
| 19 | 19 | |
| 20 | 20 | $cacheEntry = new AntiSpoofCache(); |
| 21 | 21 | $cacheEntry->setDatabase(gGetDb()); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $cacheResult->delete(); |
| 36 | 36 | |
| 37 | 37 | if (isset($result['error']['info'])) { |
| 38 | - throw new Exception("Unrecognised API response to query: " . $result['error']['info']); |
|
| 38 | + throw new Exception("Unrecognised API response to query: ".$result['error']['info']); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | throw new Exception("Unrecognised API response to query."); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | if ($result['antispoof']['result'] == "error") { |
| 55 | 55 | // we've got conflicts, let's do something with them. |
| 56 | - throw new Exception("Encountered error while getting result: " . $result['antispoof']['error']); |
|
| 56 | + throw new Exception("Encountered error while getting result: ".$result['antispoof']['error']); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | throw new Exception("Unrecognised API response to query."); |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | $cacheEntry->save(); |
| 25 | 25 | |
| 26 | 26 | $cacheResult = $cacheEntry; |
| 27 | - } |
|
| 28 | - else { |
|
| 27 | + } else { |
|
| 29 | 28 | $data = $cacheResult->getData(); |
| 30 | 29 | } |
| 31 | 30 | |
@@ -19,14 +19,14 @@ |
||
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $paths = array( |
| 22 | - $filepath . 'includes/' . $class . ".php", |
|
| 23 | - $filepath . 'includes/DataObjects/' . $class . ".php", |
|
| 24 | - $filepath . 'includes/Providers/' . $class . ".php", |
|
| 25 | - $filepath . 'includes/Providers/Interfaces/' . $class . ".php", |
|
| 26 | - $filepath . 'includes/Validation/' . $class . ".php", |
|
| 27 | - $filepath . 'includes/Helpers/' . $class . ".php", |
|
| 28 | - $filepath . 'includes/Helpers/Interfaces/' . $class . ".php", |
|
| 29 | - $filepath . $class . ".php", |
|
| 22 | + $filepath.'includes/'.$class.".php", |
|
| 23 | + $filepath.'includes/DataObjects/'.$class.".php", |
|
| 24 | + $filepath.'includes/Providers/'.$class.".php", |
|
| 25 | + $filepath.'includes/Providers/Interfaces/'.$class.".php", |
|
| 26 | + $filepath.'includes/Validation/'.$class.".php", |
|
| 27 | + $filepath.'includes/Helpers/'.$class.".php", |
|
| 28 | + $filepath.'includes/Helpers/Interfaces/'.$class.".php", |
|
| 29 | + $filepath.$class.".php", |
|
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | 32 | foreach ($paths as $file) { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | private static function encryptVersion1($password, $salt) |
| 67 | 67 | { |
| 68 | - return ':1:' . $salt . ':' . md5($salt . '-' . md5($password)); |
|
| 68 | + return ':1:'.$salt.':'.md5($salt.'-'.md5($password)); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | private static function encryptVersion2($password) |
| 76 | 76 | { |
| 77 | - return ':2:x:' . password_hash($password, PASSWORD_BCRYPT); |
|
| 77 | + return ':2:x:'.password_hash($password, PASSWORD_BCRYPT); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | // not equal to one, as zero uses the plural form too. |
| 120 | 120 | if ($resultSetCount != 1) { |
| 121 | - $onlinemessage = $resultSetCount . " Account Creators currently online (past 5 minutes): $creators"; |
|
| 121 | + $onlinemessage = $resultSetCount." Account Creators currently online (past 5 minutes): $creators"; |
|
| 122 | 122 | } |
| 123 | 123 | else { |
| 124 | - $onlinemessage = $resultSetCount . " Account Creator currently online (past 5 minutes): $creators"; |
|
| 124 | + $onlinemessage = $resultSetCount." Account Creator currently online (past 5 minutes): $creators"; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - $online = '<p class="span6 text-right"><small>' . $onlinemessage . '</small></p>'; |
|
| 127 | + $online = '<p class="span6 text-right"><small>'.$onlinemessage.'</small></p>'; |
|
| 128 | 128 | |
| 129 | 129 | if (isset($_SESSION['user'])) { |
| 130 | 130 | $smarty->assign("onlineusers", $online); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $returnData = $smarty->fetch("alert.tpl"); |
| 172 | 172 | |
| 173 | 173 | if ($centre) { |
| 174 | - $returnData = '<div class="row-fluid"><div class="span8 offset2">' . $returnData . '</div></div>'; |
|
| 174 | + $returnData = '<div class="row-fluid"><div class="span8 offset2">'.$returnData.'</div></div>'; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if ($return) { |
@@ -119,8 +119,7 @@ discard block |
||
| 119 | 119 | // not equal to one, as zero uses the plural form too. |
| 120 | 120 | if ($resultSetCount != 1) { |
| 121 | 121 | $onlinemessage = $resultSetCount . " Account Creators currently online (past 5 minutes): $creators"; |
| 122 | - } |
|
| 123 | - else { |
|
| 122 | + } else { |
|
| 124 | 123 | $onlinemessage = $resultSetCount . " Account Creator currently online (past 5 minutes): $creators"; |
| 125 | 124 | } |
| 126 | 125 | |
@@ -128,8 +127,7 @@ discard block |
||
| 128 | 127 | |
| 129 | 128 | if (isset($_SESSION['user'])) { |
| 130 | 129 | $smarty->assign("onlineusers", $online); |
| 131 | - } |
|
| 132 | - else { |
|
| 130 | + } else { |
|
| 133 | 131 | $emptystring = ""; |
| 134 | 132 | $smarty->assign("onlineusers", $emptystring); |
| 135 | 133 | } |
@@ -176,8 +174,7 @@ discard block |
||
| 176 | 174 | |
| 177 | 175 | if ($return) { |
| 178 | 176 | return $returnData; |
| 179 | - } |
|
| 180 | - else { |
|
| 177 | + } else { |
|
| 181 | 178 | echo $returnData; |
| 182 | 179 | return null; |
| 183 | 180 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // Generates a new host name by means of the IP array and TOR string. |
| 63 | - $ahbladdr = $p['3'] . "." . $p['2'] . "." . $p['1'] . "." . $p['0'] . "." . "tor.ahbl.org"; |
|
| 63 | + $ahbladdr = $p['3'].".".$p['2'].".".$p['1'].".".$p['0']."."."tor.ahbl.org"; |
|
| 64 | 64 | |
| 65 | 65 | // Get the IP address corresponding to a given host name. |
| 66 | 66 | $ahbl = gethostbyname($ahbladdr); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public static function getById($id, PdoDatabase $database) |
| 53 | 53 | { |
| 54 | - $statement = $database->prepare("SELECT * FROM `" . strtolower(get_called_class()) . "` WHERE id = :id LIMIT 1;"); |
|
| 54 | + $statement = $database->prepare("SELECT * FROM `".strtolower(get_called_class())."` WHERE id = :id LIMIT 1;"); |
|
| 55 | 55 | $statement->bindValue(":id", $id); |
| 56 | 56 | |
| 57 | 57 | $statement->execute(); |
@@ -98,6 +98,6 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | public function getObjectDescription() |
| 100 | 100 | { |
| 101 | - return '[' . get_called_class() . " " . $this->getId() . ']'; |
|
| 101 | + return '['.get_called_class()." ".$this->getId().']'; |
|
| 102 | 102 | } |
| 103 | 103 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | catch (PDOException $ex) { |
| 54 | 54 | // wrap around any potential stack traces which may include passwords |
| 55 | - throw new Exception("Error connecting to database '$connectionName': " . $ex->getMessage()); |
|
| 55 | + throw new Exception("Error connecting to database '$connectionName': ".$ex->getMessage()); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $databaseObject->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | ); |
| 187 | 187 | } |
| 188 | 188 | catch (Exception $ex) { |
| 189 | - trigger_error("Error logging query. Disabling for this request. " . $ex->getMessage(), E_USER_NOTICE); |
|
| 189 | + trigger_error("Error logging query. Disabling for this request. ".$ex->getMessage(), E_USER_NOTICE); |
|
| 190 | 190 | $enableQueryLog = false; |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -91,8 +91,7 @@ discard block |
||
| 91 | 91 | // all over the rest of the code |
| 92 | 92 | if ($this->hasActiveTransaction) { |
| 93 | 93 | return false; |
| 94 | - } |
|
| 95 | - else { |
|
| 94 | + } else { |
|
| 96 | 95 | // set the transaction isolation level for every transaction. |
| 97 | 96 | $this->exec("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;"); |
| 98 | 97 | |
@@ -146,8 +145,7 @@ discard block |
||
| 146 | 145 | // TODO: yuk. |
| 147 | 146 | if (defined("PUBLICMODE")) { |
| 148 | 147 | BootstrapSkin::displayPublicFooter(); |
| 149 | - } |
|
| 150 | - else { |
|
| 148 | + } else { |
|
| 151 | 149 | BootstrapSkin::displayInternalFooter(); |
| 152 | 150 | } |
| 153 | 151 | |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | global $showGraphs; |
| 35 | 35 | if ($showGraphs == 1) { |
| 36 | 36 | global $filepath; |
| 37 | - require_once($filepath . 'graph/pChart/pChart.class'); |
|
| 38 | - require_once($filepath . 'graph/pChart/pData.class'); |
|
| 37 | + require_once($filepath.'graph/pChart/pChart.class'); |
|
| 38 | + require_once($filepath.'graph/pChart/pData.class'); |
|
| 39 | 39 | |
| 40 | 40 | $queries = array(); |
| 41 | 41 | |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | ORDER BY YEAR(timestamp) , MONTH(timestamp) ASC; |
| 136 | 136 | SQL |
| 137 | 137 | , |
| 138 | - 'series' => "Requests deferred to " . $state['deferto'] . " by month" |
|
| 138 | + 'series' => "Requests deferred to ".$state['deferto']." by month" |
|
| 139 | 139 | ); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | global $baseurl; |
| 143 | 143 | foreach ($this->createClosuresGraph($queries) as $i) { |
| 144 | 144 | |
| 145 | - $out .= '<img src="' . $baseurl . '/render/' . $i[0] . '" alt="' . $i[1] . '"/>'; |
|
| 145 | + $out .= '<img src="'.$baseurl.'/render/'.$i[0].'" alt="'.$i[1].'"/>'; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | // Finish the graph |
| 217 | 217 | $Test->setFontProperties("graph/Fonts/tahoma.ttf", 10); |
| 218 | 218 | $Test->drawTitle(50, 22, $q['series'], 50, 50, 50, 585); |
| 219 | - $Test->Render("render/" . $chartname); |
|
| 219 | + $Test->Render("render/".$chartname); |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | } |
@@ -232,11 +232,11 @@ discard block |
||
| 232 | 232 | private function createPathFromHash($imghash, $basedirectory = "render/") |
| 233 | 233 | { |
| 234 | 234 | $imghashparts = str_split($imghash); |
| 235 | - $imgpath = array_shift($imghashparts) . "/"; |
|
| 236 | - $imgpath .= array_shift($imghashparts) . "/"; |
|
| 237 | - $imgpath .= array_shift($imghashparts) . "/"; |
|
| 235 | + $imgpath = array_shift($imghashparts)."/"; |
|
| 236 | + $imgpath .= array_shift($imghashparts)."/"; |
|
| 237 | + $imgpath .= array_shift($imghashparts)."/"; |
|
| 238 | 238 | |
| 239 | - is_dir($basedirectory . $imgpath) || mkdir($basedirectory . $imgpath, 0777, true); |
|
| 239 | + is_dir($basedirectory.$imgpath) || mkdir($basedirectory.$imgpath, 0777, true); |
|
| 240 | 240 | |
| 241 | 241 | $imgpath .= implode("", $imghashparts); |
| 242 | 242 | return $imgpath; |
@@ -145,8 +145,7 @@ |
||
| 145 | 145 | $out .= '<img src="' . $baseurl . '/render/' . $i[0] . '" alt="' . $i[1] . '"/>'; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - } |
|
| 149 | - else { |
|
| 148 | + } else { |
|
| 150 | 149 | $out .= BootstrapSkin::displayAlertBox("Graph drawing is currently disabled.", "alert-info", "", false, false, true); |
| 151 | 150 | } |
| 152 | 151 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | global $smarty, $filepath; |
| 20 | 20 | |
| 21 | - $files = scandir($filepath . "/includes/statistics/"); |
|
| 21 | + $files = scandir($filepath."/includes/statistics/"); |
|
| 22 | 22 | |
| 23 | 23 | $statsPageDefinitions = preg_grep("/php$/", $files); |
| 24 | 24 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | foreach ($statsPageDefinitions as $i) { |
| 28 | 28 | // TODO: is this require still needed? AutoLoader ftw. |
| 29 | - require_once($filepath . "/includes/statistics/" . $i); |
|
| 29 | + require_once($filepath."/includes/statistics/".$i); |
|
| 30 | 30 | $expld = explode('.', $i); |
| 31 | 31 | $className = $expld[0]; |
| 32 | 32 | |