@@ -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) { |
@@ -54,7 +54,7 @@ |
||
| 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 | |
@@ -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."); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $blacklist = array("DCC", "CCTP", "PRIVMSG"); |
| 99 | 99 | $message = str_replace($blacklist, "(IRC Blacklist)", $message); //Lets stop DCC etc |
| 100 | 100 | |
| 101 | - $msg = IrcColourCode::RESET . IrcColourCode::BOLD . "[$whichami]" . IrcColourCode::RESET . ": $message"; |
|
| 101 | + $msg = IrcColourCode::RESET.IrcColourCode::BOLD."[$whichami]".IrcColourCode::RESET.": $message"; |
|
| 102 | 102 | |
| 103 | 103 | try { |
| 104 | 104 | $database = gGetDb('notifications'); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public static function userApproved(User $user) |
| 138 | 138 | { |
| 139 | - self::send("{$user->getUsername()} approved by " . User::getCurrent()->getUsername()); |
|
| 139 | + self::send("{$user->getUsername()} approved by ".User::getCurrent()->getUsername()); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public static function userPromoted(User $user) |
| 147 | 147 | { |
| 148 | - self::send("{$user->getUsername()} promoted to tool admin by " . User::getCurrent()->getUsername()); |
|
| 148 | + self::send("{$user->getUsername()} promoted to tool admin by ".User::getCurrent()->getUsername()); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public static function userDeclined(User $user, $reason) |
| 157 | 157 | { |
| 158 | - self::send("{$user->getUsername()} declined by " . User::getCurrent()->getUsername() . " ($reason)"); |
|
| 158 | + self::send("{$user->getUsername()} declined by ".User::getCurrent()->getUsername()." ($reason)"); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public static function userDemoted(User $user, $reason) |
| 167 | 167 | { |
| 168 | - self::send("{$user->getUsername()} demoted by " . User::getCurrent()->getUsername() . " ($reason)"); |
|
| 168 | + self::send("{$user->getUsername()} demoted by ".User::getCurrent()->getUsername()." ($reason)"); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public static function userSuspended(User $user, $reason) |
| 177 | 177 | { |
| 178 | - self::send("{$user->getUsername()} suspended by " . User::getCurrent()->getUsername() . " ($reason)"); |
|
| 178 | + self::send("{$user->getUsername()} suspended by ".User::getCurrent()->getUsername()." ($reason)"); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public static function userPrefChange(User $user) |
| 186 | 186 | { |
| 187 | - self::send("{$user->getUsername()}'s preferences were changed by " . User::getCurrent()->getUsername()); |
|
| 187 | + self::send("{$user->getUsername()}'s preferences were changed by ".User::getCurrent()->getUsername()); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public static function userRenamed(User $user, $old) |
| 196 | 196 | { |
| 197 | - self::send(User::getCurrent()->getUsername() . " renamed $old to {$user->getUsername()}"); |
|
| 197 | + self::send(User::getCurrent()->getUsername()." renamed $old to {$user->getUsername()}"); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | #endregion |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public static function interfaceMessageEdited(InterfaceMessage $message) |
| 209 | 209 | { |
| 210 | - self::send("Message {$message->getDescription()} ({$message->getId()}) edited by " . User::getCurrent()->getUsername()); |
|
| 210 | + self::send("Message {$message->getDescription()} ({$message->getId()}) edited by ".User::getCurrent()->getUsername()); |
|
| 211 | 211 | } |
| 212 | 212 | #endregion |
| 213 | 213 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public static function welcomeTemplateCreated(WelcomeTemplate $template) |
| 220 | 220 | { |
| 221 | - self::send("Welcome template {$template->getId()} created by " . User::getCurrent()->getUsername()); |
|
| 221 | + self::send("Welcome template {$template->getId()} created by ".User::getCurrent()->getUsername()); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | public static function welcomeTemplateDeleted($templateid) |
| 229 | 229 | { |
| 230 | - self::send("Welcome template {$templateid} deleted by " . User::getCurrent()->getUsername()); |
|
| 230 | + self::send("Welcome template {$templateid} deleted by ".User::getCurrent()->getUsername()); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public static function welcomeTemplateEdited(WelcomeTemplate $template) |
| 238 | 238 | { |
| 239 | - self::send("Welcome template {$template->getId()} edited by " . User::getCurrent()->getUsername()); |
|
| 239 | + self::send("Welcome template {$template->getId()} edited by ".User::getCurrent()->getUsername()); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | #endregion |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $duration = "indefinitely"; |
| 253 | 253 | } |
| 254 | 254 | else { |
| 255 | - $duration = "until " . date("F j, Y, g:i a", $ban->getDuration()); |
|
| 255 | + $duration = "until ".date("F j, Y, g:i a", $ban->getDuration()); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | $username = User::getCurrent()->getUsername(); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | public static function unbanned(Ban $ban, $unbanreason) |
| 269 | 269 | { |
| 270 | - self::send($ban->getTarget() . " unbanned by " . User::getCurrent()->getUsername() . " (" . $unbanreason . ")"); |
|
| 270 | + self::send($ban->getTarget()." unbanned by ".User::getCurrent()->getUsername()." (".$unbanreason.")"); |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | #endregion |
@@ -283,15 +283,15 @@ discard block |
||
| 283 | 283 | global $baseurl; |
| 284 | 284 | |
| 285 | 285 | self::send( |
| 286 | - IrcColourCode::DARK_GREY . "[[" |
|
| 287 | - . IrcColourCode::DARK_GREEN . "acc:" |
|
| 288 | - . IrcColourCode::ORANGE . $request->getId() |
|
| 289 | - . IrcColourCode::DARK_GREY . "]]" |
|
| 290 | - . IrcColourCode::RED . " N " |
|
| 291 | - . IrcColourCode::DARK_BLUE . $baseurl . "/acc.php?action=zoom&id={$request->getId()} " |
|
| 292 | - . IrcColourCode::DARK_RED . "* " |
|
| 293 | - . IrcColourCode::DARK_GREEN . $request->getName() |
|
| 294 | - . IrcColourCode::DARK_RED . " * " |
|
| 286 | + IrcColourCode::DARK_GREY."[[" |
|
| 287 | + . IrcColourCode::DARK_GREEN."acc:" |
|
| 288 | + . IrcColourCode::ORANGE.$request->getId() |
|
| 289 | + . IrcColourCode::DARK_GREY."]]" |
|
| 290 | + . IrcColourCode::RED." N " |
|
| 291 | + . IrcColourCode::DARK_BLUE.$baseurl."/acc.php?action=zoom&id={$request->getId()} " |
|
| 292 | + . IrcColourCode::DARK_RED."* " |
|
| 293 | + . IrcColourCode::DARK_GREEN.$request->getName() |
|
| 294 | + . IrcColourCode::DARK_RED." * " |
|
| 295 | 295 | . IrcColourCode::RESET |
| 296 | 296 | ); |
| 297 | 297 | } |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | */ |
| 435 | 435 | public static function emailCreated(EmailTemplate $template) |
| 436 | 436 | { |
| 437 | - self::send("Email {$template->getId()} ({$template->getName()}) created by " . User::getCurrent()->getUsername()); |
|
| 437 | + self::send("Email {$template->getId()} ({$template->getName()}) created by ".User::getCurrent()->getUsername()); |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | /** |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | */ |
| 444 | 444 | public static function emailEdited(EmailTemplate $template) |
| 445 | 445 | { |
| 446 | - self::send("Email {$template->getId()} ({$template->getName()}) edited by " . User::getCurrent()->getUsername()); |
|
| 446 | + self::send("Email {$template->getId()} ({$template->getName()}) edited by ".User::getCurrent()->getUsername()); |
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | #endregion |
@@ -258,6 +258,6 @@ |
||
| 258 | 258 | |
| 259 | 259 | public function getObjectDescription() |
| 260 | 260 | { |
| 261 | - return 'Ban #' . $this->getId() . " (" . htmlentities($this->target) . ")</a>"; |
|
| 261 | + return 'Ban #'.$this->getId()." (".htmlentities($this->target).")</a>"; |
|
| 262 | 262 | } |
| 263 | 263 | } |
@@ -118,6 +118,6 @@ |
||
| 118 | 118 | |
| 119 | 119 | public function getObjectDescription() |
| 120 | 120 | { |
| 121 | - return '<a href="acc.php?action=messagemgmt&view=' . $this->getId() . '">' . htmlentities($this->description) . "</a>"; |
|
| 121 | + return '<a href="acc.php?action=messagemgmt&view='.$this->getId().'">'.htmlentities($this->description)."</a>"; |
|
| 122 | 122 | } |
| 123 | 123 | } |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | if ($this->isNew) { |
| 64 | 64 | // insert |
| 65 | 65 | $statement = $this->dbObject->prepare( |
| 66 | - "INSERT INTO `request` (" . |
|
| 67 | - "email, ip, name, comment, status, date, checksum, emailsent, emailconfirm, reserved, useragent, forwardedip" . |
|
| 68 | - ") VALUES (" . |
|
| 69 | - ":email, :ip, :name, :comment, :status, CURRENT_TIMESTAMP(), :checksum, :emailsent," . |
|
| 70 | - ":emailconfirm, :reserved, :useragent, :forwardedip" . |
|
| 66 | + "INSERT INTO `request` (". |
|
| 67 | + "email, ip, name, comment, status, date, checksum, emailsent, emailconfirm, reserved, useragent, forwardedip". |
|
| 68 | + ") VALUES (". |
|
| 69 | + ":email, :ip, :name, :comment, :status, CURRENT_TIMESTAMP(), :checksum, :emailsent,". |
|
| 70 | + ":emailconfirm, :reserved, :useragent, :forwardedip". |
|
| 71 | 71 | ");"); |
| 72 | 72 | $statement->bindValue(":email", $this->email); |
| 73 | 73 | $statement->bindValue(":ip", $this->ip); |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | else { |
| 92 | 92 | // update |
| 93 | - $statement = $this->dbObject->prepare("UPDATE `request` SET " . |
|
| 94 | - "status = :status, checksum = :checksum, emailsent = :emailsent, emailconfirm = :emailconfirm, " . |
|
| 95 | - "reserved = :reserved " . |
|
| 93 | + $statement = $this->dbObject->prepare("UPDATE `request` SET ". |
|
| 94 | + "status = :status, checksum = :checksum, emailsent = :emailsent, emailconfirm = :emailconfirm, ". |
|
| 95 | + "reserved = :reserved ". |
|
| 96 | 96 | "WHERE id = :id LIMIT 1;"); |
| 97 | 97 | $statement->bindValue(":id", $this->id); |
| 98 | 98 | $statement->bindValue(":status", $this->status); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | public function updateChecksum() |
| 198 | 198 | { |
| 199 | - $this->checksum = md5($this->id . $this->name . $this->email . microtime()); |
|
| 199 | + $this->checksum = md5($this->id.$this->name.$this->email.microtime()); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | public function getEmailSent() |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | $query = $this->dbObject->prepare("SELECT * FROM request WHERE (ip = :ip OR forwardedip LIKE :forwarded) AND ip != :clearedip AND id != :id AND emailconfirm = 'Confirmed';"); |
| 312 | 312 | |
| 313 | 313 | $trustedIp = $this->getTrustedIp(); |
| 314 | - $trustedFilter = '%' . $trustedIp . '%'; |
|
| 314 | + $trustedFilter = '%'.$trustedIp.'%'; |
|
| 315 | 315 | |
| 316 | 316 | $query->bindValue(":id", $this->id); |
| 317 | 317 | $query->bindValue(":ip", $trustedIp); |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | return false; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - $apiResult = file_get_contents("https://en.wikipedia.org/w/api.php?action=titleblacklist&tbtitle=" . urlencode($this->name) . "&tbaction=new-account&tbnooverride&format=php"); |
|
| 342 | + $apiResult = file_get_contents("https://en.wikipedia.org/w/api.php?action=titleblacklist&tbtitle=".urlencode($this->name)."&tbaction=new-account&tbnooverride&format=php"); |
|
| 343 | 343 | |
| 344 | 344 | $data = unserialize($apiResult); |
| 345 | 345 | |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | |
| 412 | 412 | public function getObjectDescription() |
| 413 | 413 | { |
| 414 | - return '<a href="acc.php?action=zoom&id=' . $this->getId() . '">Request #' . $this->getId() . " (" . htmlentities($this->name) . ")</a>"; |
|
| 414 | + return '<a href="acc.php?action=zoom&id='.$this->getId().'">Request #'.$this->getId()." (".htmlentities($this->name).")</a>"; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | public function getClosureReason() |
@@ -108,6 +108,6 @@ |
||
| 108 | 108 | |
| 109 | 109 | public function getObjectDescription() |
| 110 | 110 | { |
| 111 | - return '<a href="acc.php?action=templatemgmt&view=' . $this->getId() . '">' . htmlentities($this->usercode) . "</a>"; |
|
| 111 | + return '<a href="acc.php?action=templatemgmt&view='.$this->getId().'">'.htmlentities($this->usercode)."</a>"; |
|
| 112 | 112 | } |
| 113 | 113 | } |
@@ -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) { |
@@ -102,8 +102,7 @@ |
||
| 102 | 102 | $creators = implode( |
| 103 | 103 | ", ", |
| 104 | 104 | array_map( |
| 105 | - function($arg) |
|
| 106 | - { |
|
| 105 | + function($arg) { |
|
| 107 | 106 | /** @var User $arg */ |
| 108 | 107 | return |
| 109 | 108 | "<a href=\"statistics.php?page=Users&user=" |