@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | 89 | * Summary of getUserObject |
| 90 | - * @return User|null |
|
| 90 | + * @return DataObject|null |
|
| 91 | 91 | */ |
| 92 | 92 | public function getUserObject() |
| 93 | 93 | { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * Summary of getRequestObject |
| 129 | - * @return Request|null |
|
| 129 | + * @return DataObject|null |
|
| 130 | 130 | */ |
| 131 | 131 | public function getRequestObject() |
| 132 | 132 | { |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Summary of getUserObject |
| 88 | - * @return User|null |
|
| 88 | + * @return DataObject|null |
|
| 89 | 89 | */ |
| 90 | 90 | public function getUserObject() |
| 91 | 91 | { |
@@ -155,7 +155,7 @@ |
||
| 155 | 155 | $object = $type::getById($this->objectid, $this->dbObject); |
| 156 | 156 | |
| 157 | 157 | if ($object === false) { |
| 158 | - return '[' . $this->objecttype . " " . $this->objectid . ']'; |
|
| 158 | + return '['.$this->objecttype." ".$this->objectid.']'; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | return $object->getObjectDescription(); |
@@ -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 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | $BUbasefile = "backup"; // The basefile's name. |
| 140 | 140 | $BUdir = "/home/project/a/c/c/acc/backups"; // The directory where backups should be stored. |
| 141 | -$BUmonthdir = $BUdir . "/monthly"; // The directory where monthly backups should be stored. |
|
| 141 | +$BUmonthdir = $BUdir."/monthly"; // The directory where monthly backups should be stored. |
|
| 142 | 142 | $BUdumper = "/opt/ts/mysql/5.1/bin/mysqldump --defaults-file=~/.my.cnf p_acc_live"; // Add parameters here if they are needed. |
| 143 | 143 | $BUgzip = "/usr/bin/gzip"; // Add the gzip parameters here if needed. |
| 144 | 144 | $BUtar = "/bin/tar -cvf"; // Add the tar parameters here if needed. |
@@ -276,17 +276,17 @@ discard block |
||
| 276 | 276 | |
| 277 | 277 | $cDatabaseConfig = array( |
| 278 | 278 | "acc" => array( |
| 279 | - "dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database, |
|
| 279 | + "dsrcname" => "mysql:host=".$toolserver_host.";dbname=".$toolserver_database, |
|
| 280 | 280 | "username" => $toolserver_username, |
| 281 | 281 | "password" => $toolserver_password |
| 282 | 282 | ), |
| 283 | 283 | "wikipedia" => array( |
| 284 | - "dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db, |
|
| 284 | + "dsrcname" => "mysql:host=".$antispoof_host.";dbname=".$antispoof_db, |
|
| 285 | 285 | "username" => $toolserver_username, |
| 286 | 286 | "password" => $toolserver_password |
| 287 | 287 | ), |
| 288 | 288 | "notifications" => array( |
| 289 | - "dsrcname" => "mysql:host=" . $toolserver_notification_dbhost . ";dbname=" . $toolserver_notification_database, |
|
| 289 | + "dsrcname" => "mysql:host=".$toolserver_notification_dbhost.";dbname=".$toolserver_notification_database, |
|
| 290 | 290 | "username" => $notifications_username, |
| 291 | 291 | "password" => $notifications_password |
| 292 | 292 | ), |
@@ -308,11 +308,11 @@ discard block |
||
| 308 | 308 | "mcrypt", "openssl", // password encryption etc |
| 309 | 309 | ) as $x) {if (!extension_loaded($x)) {die("extension $x is required."); }} |
| 310 | 310 | |
| 311 | -require_once($filepath . "includes/AutoLoader.php"); |
|
| 311 | +require_once($filepath."includes/AutoLoader.php"); |
|
| 312 | 312 | |
| 313 | 313 | spl_autoload_register("AutoLoader::load"); |
| 314 | 314 | |
| 315 | 315 | // Extra includes which are just plain awkward wherever they are. |
| 316 | -require_once($filepath . 'oauth/OAuthUtility.php'); |
|
| 317 | -require_once($filepath . 'lib/mediawiki-extensions-OAuth/lib/OAuth.php'); |
|
| 318 | -require_once($filepath . 'lib/mediawiki-extensions-OAuth/lib/JWT.php'); |
|
| 316 | +require_once($filepath.'oauth/OAuthUtility.php'); |
|
| 317 | +require_once($filepath.'lib/mediawiki-extensions-OAuth/lib/OAuth.php'); |
|
| 318 | +require_once($filepath.'lib/mediawiki-extensions-OAuth/lib/JWT.php'); |
|