@@ -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 | } |
@@ -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 | /** |
@@ -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 | } |
@@ -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 | } |