@@ -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,19 +276,19 @@ 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 | "options" => array(), |
283 | 283 | ), |
284 | 284 | "wikipedia" => array( |
285 | - "dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db, |
|
285 | + "dsrcname" => "mysql:host=".$antispoof_host.";dbname=".$antispoof_db, |
|
286 | 286 | "username" => $toolserver_username, |
287 | 287 | "password" => $toolserver_password, |
288 | 288 | "options" => array(), |
289 | 289 | ), |
290 | 290 | "notifications" => array( |
291 | - "dsrcname" => "mysql:host=" . $toolserver_notification_dbhost . ";dbname=" . $toolserver_notification_database, |
|
291 | + "dsrcname" => "mysql:host=".$toolserver_notification_dbhost.";dbname=".$toolserver_notification_database, |
|
292 | 292 | "username" => $notifications_username, |
293 | 293 | "password" => $notifications_password, |
294 | 294 | "options" => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'), |
@@ -311,11 +311,11 @@ discard block |
||
311 | 311 | "openssl", // email confirmation hash gen, oauth stuff |
312 | 312 | ) as $x) {if (!extension_loaded($x)) {die("extension $x is required."); }} |
313 | 313 | |
314 | -require_once($filepath . "includes/AutoLoader.php"); |
|
314 | +require_once($filepath."includes/AutoLoader.php"); |
|
315 | 315 | |
316 | 316 | spl_autoload_register("AutoLoader::load"); |
317 | 317 | |
318 | 318 | // Extra includes which are just plain awkward wherever they are. |
319 | -require_once($filepath . 'oauth/OAuthUtility.php'); |
|
320 | -require_once($filepath . 'lib/mediawiki-extensions-OAuth/lib/OAuth.php'); |
|
321 | -require_once($filepath . 'lib/mediawiki-extensions-OAuth/lib/JWT.php'); |
|
319 | +require_once($filepath.'oauth/OAuthUtility.php'); |
|
320 | +require_once($filepath.'lib/mediawiki-extensions-OAuth/lib/OAuth.php'); |
|
321 | +require_once($filepath.'lib/mediawiki-extensions-OAuth/lib/JWT.php'); |
@@ -14,31 +14,31 @@ discard block |
||
14 | 14 | |
15 | 15 | class StatsIdUsers extends StatisticsPage |
16 | 16 | { |
17 | - protected function execute() |
|
18 | - { |
|
19 | - return $this->getUserList(); |
|
20 | - } |
|
17 | + protected function execute() |
|
18 | + { |
|
19 | + return $this->getUserList(); |
|
20 | + } |
|
21 | 21 | |
22 | - public function getPageTitle() |
|
23 | - { |
|
24 | - return "User identification status"; |
|
25 | - } |
|
22 | + public function getPageTitle() |
|
23 | + { |
|
24 | + return "User identification status"; |
|
25 | + } |
|
26 | 26 | |
27 | - public function getPageName() |
|
28 | - { |
|
29 | - return "IdUsers"; |
|
30 | - } |
|
27 | + public function getPageName() |
|
28 | + { |
|
29 | + return "IdUsers"; |
|
30 | + } |
|
31 | 31 | |
32 | - public function isProtected() |
|
33 | - { |
|
34 | - return true; |
|
35 | - } |
|
32 | + public function isProtected() |
|
33 | + { |
|
34 | + return true; |
|
35 | + } |
|
36 | 36 | |
37 | - private function getUserList() |
|
38 | - { |
|
39 | - global $currentIdentificationVersion, $forceIdentification; |
|
37 | + private function getUserList() |
|
38 | + { |
|
39 | + global $currentIdentificationVersion, $forceIdentification; |
|
40 | 40 | |
41 | - $query = <<<SQL |
|
41 | + $query = <<<SQL |
|
42 | 42 | select username, status, checkuser, identified, case |
43 | 43 | when coalesce(identified, 0) = 0 then 'Not identified' |
44 | 44 | when identified < ${forceIdentification} then 'Expired' |
@@ -51,16 +51,16 @@ discard block |
||
51 | 51 | order by username; |
52 | 52 | SQL; |
53 | 53 | |
54 | - $qb = new QueryBrowser(); |
|
55 | - $qb->rowFetchMode = PDO::FETCH_NUM; |
|
56 | - $qb->overrideTableTitles = array("User name", "Access level", "Checkuser?", "Version", "Identification status"); |
|
57 | - $r = $qb->executeQueryToTable($query); |
|
54 | + $qb = new QueryBrowser(); |
|
55 | + $qb->rowFetchMode = PDO::FETCH_NUM; |
|
56 | + $qb->overrideTableTitles = array("User name", "Access level", "Checkuser?", "Version", "Identification status"); |
|
57 | + $r = $qb->executeQueryToTable($query); |
|
58 | 58 | |
59 | - return $r; |
|
60 | - } |
|
59 | + return $r; |
|
60 | + } |
|
61 | 61 | |
62 | - public function requiresWikiDatabase() |
|
63 | - { |
|
64 | - return false; |
|
65 | - } |
|
62 | + public function requiresWikiDatabase() |
|
63 | + { |
|
64 | + return false; |
|
65 | + } |
|
66 | 66 | } |
@@ -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;"); |
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() |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $query = $this->dbObject->prepare("SELECT * FROM request WHERE (ip = :ip OR forwardedip LIKE :forwarded) AND ip != :clearedip AND id != :id AND emailconfirm = 'Confirmed';"); |
324 | 324 | |
325 | 325 | $trustedIp = $this->getTrustedIp(); |
326 | - $trustedFilter = '%' . $trustedIp . '%'; |
|
326 | + $trustedFilter = '%'.$trustedIp.'%'; |
|
327 | 327 | |
328 | 328 | $query->bindValue(":id", $this->id); |
329 | 329 | $query->bindValue(":ip", $trustedIp); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | return false; |
352 | 352 | } |
353 | 353 | |
354 | - $apiResult = file_get_contents("https://en.wikipedia.org/w/api.php?action=titleblacklist&tbtitle=" . urlencode($this->name) . "&tbaction=new-account&tbnooverride&format=php"); |
|
354 | + $apiResult = file_get_contents("https://en.wikipedia.org/w/api.php?action=titleblacklist&tbtitle=".urlencode($this->name)."&tbaction=new-account&tbnooverride&format=php"); |
|
355 | 355 | |
356 | 356 | $data = unserialize($apiResult); |
357 | 357 | |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | |
424 | 424 | public function getObjectDescription() |
425 | 425 | { |
426 | - return '<a href="acc.php?action=zoom&id=' . $this->getId() . '">Request #' . $this->getId() . " (" . htmlentities($this->name) . ")</a>"; |
|
426 | + return '<a href="acc.php?action=zoom&id='.$this->getId().'">Request #'.$this->getId()." (".htmlentities($this->name).")</a>"; |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | public function getClosureReason() |