@@ -12,8 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | $database = gGetDb(); |
| 14 | 14 | |
| 15 | -$database->transactionally(function() use ($database) |
|
| 16 | -{ |
|
| 15 | +$database->transactionally(function() use ($database) { |
|
| 17 | 16 | $database->exec(<<<SQL |
| 18 | 17 | UPDATE user |
| 19 | 18 | SET |
@@ -87,8 +87,7 @@ |
||
| 87 | 87 | $database = gGetDb(); |
| 88 | 88 | |
| 89 | 89 | echo "Executing transaction...\n"; |
| 90 | -$database->transactionally(function() use ($ip, $database) |
|
| 91 | -{ |
|
| 90 | +$database->transactionally(function() use ($ip, $database) { |
|
| 92 | 91 | $database->exec("DELETE FROM xfftrustcache;"); |
| 93 | 92 | |
| 94 | 93 | $insert = $database->prepare("INSERT INTO xfftrustcache (ip) VALUES (:ip);"); |
@@ -71,8 +71,7 @@ discard block |
||
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $database->transactionally(function() use($database, $request, $smarty) |
|
| 75 | - { |
|
| 74 | + $database->transactionally(function() use($database, $request, $smarty) { |
|
| 76 | 75 | if ($request === false) { |
| 77 | 76 | throw new TransactionException($smarty->fetch('request/request-not-found.tpl'), "Ooops!"); |
| 78 | 77 | } |
@@ -136,8 +135,7 @@ discard block |
||
| 136 | 135 | else if ($enableEmailConfirm == 1) { |
| 137 | 136 | $request->generateEmailConfirmationHash(); |
| 138 | 137 | |
| 139 | - $database->transactionally(function() use($request) |
|
| 140 | - { |
|
| 138 | + $database->transactionally(function() use($request) { |
|
| 141 | 139 | $request->save(); |
| 142 | 140 | |
| 143 | 141 | // checksum depends on the ID, so we have to save again! |
@@ -151,8 +149,7 @@ discard block |
||
| 151 | 149 | } |
| 152 | 150 | else { |
| 153 | 151 | $request->setEmailConfirm(0); // Since it can't be null |
| 154 | - $database->transactionally(function() use($request) |
|
| 155 | - { |
|
| 152 | + $database->transactionally(function() use($request) { |
|
| 156 | 153 | $request->save(); |
| 157 | 154 | $request->updateChecksum(); |
| 158 | 155 | $request->save(); |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | if (count($validationErrors) > 0) { |
| 128 | 128 | foreach ($validationErrors as $validationError) { |
| 129 | 129 | BootstrapSkin::displayAlertBox( |
| 130 | - $smarty->fetch("validation/" . $validationError->getErrorCode() . ".tpl"), |
|
| 130 | + $smarty->fetch("validation/".$validationError->getErrorCode().".tpl"), |
|
| 131 | 131 | "alert-error"); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -593,8 +593,7 @@ discard block |
||
| 593 | 593 | |
| 594 | 594 | public function approve() |
| 595 | 595 | { |
| 596 | - $this->dbObject->transactionally(function() |
|
| 597 | - { |
|
| 596 | + $this->dbObject->transactionally(function() { |
|
| 598 | 597 | $this->status = "User"; |
| 599 | 598 | $this->save(); |
| 600 | 599 | Logger::approvedUser($this->dbObject, $this); |
@@ -603,8 +602,7 @@ discard block |
||
| 603 | 602 | |
| 604 | 603 | public function suspend($comment) |
| 605 | 604 | { |
| 606 | - $this->dbObject->transactionally(function() use ($comment) |
|
| 607 | - { |
|
| 605 | + $this->dbObject->transactionally(function() use ($comment) { |
|
| 608 | 606 | $this->status = "Suspended"; |
| 609 | 607 | $this->save(); |
| 610 | 608 | Logger::suspendedUser($this->dbObject, $this, $comment); |
@@ -613,8 +611,7 @@ discard block |
||
| 613 | 611 | |
| 614 | 612 | public function decline($comment) |
| 615 | 613 | { |
| 616 | - $this->dbObject->transactionally(function() use ($comment) |
|
| 617 | - { |
|
| 614 | + $this->dbObject->transactionally(function() use ($comment) { |
|
| 618 | 615 | $this->status = "Declined"; |
| 619 | 616 | $this->save(); |
| 620 | 617 | Logger::declinedUser($this->dbObject, $this, $comment); |
@@ -623,8 +620,7 @@ discard block |
||
| 623 | 620 | |
| 624 | 621 | public function promote() |
| 625 | 622 | { |
| 626 | - $this->dbObject->transactionally(function() |
|
| 627 | - { |
|
| 623 | + $this->dbObject->transactionally(function() { |
|
| 628 | 624 | $this->status = "Admin"; |
| 629 | 625 | $this->save(); |
| 630 | 626 | Logger::promotedUser($this->dbObject, $this); |
@@ -633,8 +629,7 @@ discard block |
||
| 633 | 629 | |
| 634 | 630 | public function demote($comment) |
| 635 | 631 | { |
| 636 | - $this->dbObject->transactionally(function() use ($comment) |
|
| 637 | - { |
|
| 632 | + $this->dbObject->transactionally(function() use ($comment) { |
|
| 638 | 633 | $this->status = "User"; |
| 639 | 634 | $this->save(); |
| 640 | 635 | Logger::demotedUser($this->dbObject, $this, $comment); |
@@ -654,9 +654,9 @@ |
||
| 654 | 654 | |
| 655 | 655 | public function isCheckuser() |
| 656 | 656 | { |
| 657 | - if($this->isCheckuserCache === null) { |
|
| 658 | - $this->isCheckuserCache = $this->checkuser == 1 || $this->oauthCanCheckUser(); |
|
| 659 | - } |
|
| 657 | + if($this->isCheckuserCache === null) { |
|
| 658 | + $this->isCheckuserCache = $this->checkuser == 1 || $this->oauthCanCheckUser(); |
|
| 659 | + } |
|
| 660 | 660 | |
| 661 | 661 | return $this->isCheckuserCache; |
| 662 | 662 | } |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | |
| 655 | 655 | public function isCheckuser() |
| 656 | 656 | { |
| 657 | - if($this->isCheckuserCache === null) { |
|
| 657 | + if ($this->isCheckuserCache === null) { |
|
| 658 | 658 | $this->isCheckuserCache = $this->checkuser == 1 || $this->oauthCanCheckUser(); |
| 659 | 659 | } |
| 660 | 660 | |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | prepare("UPDATE user SET oauthidentitycache = null WHERE id = :id;")-> |
| 795 | 795 | execute(array(":id" => $this->id)); |
| 796 | 796 | |
| 797 | - SessionAlert::warning("OAuth error getting identity from MediaWiki: " . $ex->getMessage()); |
|
| 797 | + SessionAlert::warning("OAuth error getting identity from MediaWiki: ".$ex->getMessage()); |
|
| 798 | 798 | } |
| 799 | 799 | } |
| 800 | 800 | |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | |
| 870 | 870 | public function getForgottenPasswordHash() |
| 871 | 871 | { |
| 872 | - return md5($this->username . $this->email . $this->welcome_template . $this->id . $this->password); |
|
| 872 | + return md5($this->username.$this->email.$this->welcome_template.$this->id.$this->password); |
|
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | public function getApprovalDate() |
@@ -894,6 +894,6 @@ discard block |
||
| 894 | 894 | |
| 895 | 895 | public function getObjectDescription() |
| 896 | 896 | { |
| 897 | - return '<a href="statistics.php?page=Users&user=' . $this->getId() . '">' . htmlentities($this->username) . "</a>"; |
|
| 897 | + return '<a href="statistics.php?page=Users&user='.$this->getId().'">'.htmlentities($this->username)."</a>"; |
|
| 898 | 898 | } |
| 899 | 899 | } |
@@ -217,8 +217,7 @@ |
||
| 217 | 217 | |
| 218 | 218 | $items = array_merge($logs, $comments); |
| 219 | 219 | |
| 220 | - $sortKey = function(DataObject $item) |
|
| 221 | - { |
|
| 220 | + $sortKey = function(DataObject $item) { |
|
| 222 | 221 | if ($item instanceof Log) { |
| 223 | 222 | return $item->getTimestamp(); |
| 224 | 223 | } |
@@ -292,7 +292,7 @@ |
||
| 292 | 292 | $template = EmailTemplate::getById((int)$id, $entry->getDatabase()); |
| 293 | 293 | |
| 294 | 294 | if ($template != false) { |
| 295 | - return "closed (" . $template->getName() . ")"; |
|
| 295 | + return "closed (".$template->getName().")"; |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | } |
@@ -52,18 +52,18 @@ discard block |
||
| 52 | 52 | $out .= '<table class="table table-striped table-hover table-condensed"><tr>'; |
| 53 | 53 | |
| 54 | 54 | if ($this->numberedList == true) { |
| 55 | - $out .= "<th>" . $this->numberedListTitle . "</th>"; |
|
| 55 | + $out .= "<th>".$this->numberedListTitle."</th>"; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if ($this->overrideTableTitles != false) { |
| 59 | 59 | foreach ($this->overrideTableTitles as $value) { |
| 60 | - $out .= "<th>" . $value . "</th>"; |
|
| 60 | + $out .= "<th>".$value."</th>"; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | else { |
| 64 | 64 | if (count($results) > 0) { |
| 65 | 65 | foreach ($results[0] as $k => $v) { |
| 66 | - $out .= "<th>" . $k . "</th>"; |
|
| 66 | + $out .= "<th>".$k."</th>"; |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | $out .= '<tr>'; |
| 81 | 81 | |
| 82 | 82 | if ($this->numberedList == true) { |
| 83 | - $out .= "<th>" . $currentreq . "</th>"; |
|
| 83 | + $out .= "<th>".$currentreq."</th>"; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | foreach ($row as $cell) { |
| 88 | 88 | |
| 89 | - $out .= "<td>" . $cell . "</td>"; |
|
| 89 | + $out .= "<td>".$cell."</td>"; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | global $CORSallowed; |
| 17 | 17 | |
| 18 | 18 | if (in_array($httpOrigin, $CORSallowed)) { |
| 19 | - header("Access-Control-Allow-Origin: " . $httpOrigin); |
|
| 19 | + header("Access-Control-Allow-Origin: ".$httpOrigin); |
|
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | } |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | |
| 96 | 96 | $statement = $this->database->prepare($query); |
| 97 | 97 | $statement->bindValue(":username", $this->user->getUsername()); |
| 98 | - $statement->bindValue(":date", date('Y-m-d') . "%"); |
|
| 98 | + $statement->bindValue(":date", date('Y-m-d')."%"); |
|
| 99 | 99 | $statement->execute(); |
| 100 | 100 | $today = $statement->fetchColumn(); |
| 101 | 101 | $statement->closeCursor(); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | $substr = mb_substr($string, 0, 1); |
| 13 | 13 | $substr2 = mb_substr($string, 1, $strlen - 1); |
| 14 | 14 | $upstring = mb_strtoupper($substr); |
| 15 | - $ustring = $upstring . $substr2; |
|
| 15 | + $ustring = $upstring.$substr2; |
|
| 16 | 16 | return $ustring; |
| 17 | 17 | } |
| 18 | 18 | |