Completed
Push — api-fix ( 7f9ead )
by Michael
07:17 queued 01:09
created
includes/API/Actions/StatusAction.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -17,75 +17,75 @@
 block discarded – undo
17 17
  */
18 18
 class StatusAction extends XmlApiPageBase implements IXmlApiAction
19 19
 {
20
-    public function executeApiAction(DOMElement $apiDocument)
21
-    {
22
-        $statusElement = $this->document->createElement("status");
23
-        $apiDocument->appendChild($statusElement);
20
+	public function executeApiAction(DOMElement $apiDocument)
21
+	{
22
+		$statusElement = $this->document->createElement("status");
23
+		$apiDocument->appendChild($statusElement);
24 24
 
25
-        $query = $this->getDatabase()->prepare(<<<SQL
25
+		$query = $this->getDatabase()->prepare(<<<SQL
26 26
             SELECT /* Api/StatusAction */ COUNT(*) AS count
27 27
             FROM request
28 28
             WHERE
29 29
                 status = :pstatus
30 30
                 AND emailconfirm = 'Confirmed';
31 31
 SQL
32
-        );
32
+		);
33 33
 
34
-        $availableRequestStates = $this->getSiteConfiguration()->getRequestStates();
34
+		$availableRequestStates = $this->getSiteConfiguration()->getRequestStates();
35 35
 
36
-        foreach ($availableRequestStates as $key => $value) {
37
-            $query->bindValue(":pstatus", $key);
38
-            $query->execute();
39
-            $sus = $query->fetchColumn();
40
-            $statusElement->setAttribute($value['api'], $sus);
41
-            $query->closeCursor();
42
-        }
36
+		foreach ($availableRequestStates as $key => $value) {
37
+			$query->bindValue(":pstatus", $key);
38
+			$query->execute();
39
+			$sus = $query->fetchColumn();
40
+			$statusElement->setAttribute($value['api'], $sus);
41
+			$query->closeCursor();
42
+		}
43 43
 
44
-        $query = $this->getDatabase()->prepare(<<<SQL
44
+		$query = $this->getDatabase()->prepare(<<<SQL
45 45
             SELECT /* Api/StatusAction */ COUNT(*) AS count
46 46
             FROM ban
47 47
             WHERE
48 48
                 (duration > UNIX_TIMESTAMP() OR duration is null)
49 49
                 AND active = 1;
50 50
 SQL
51
-        );
51
+		);
52 52
 
53
-        $query->execute();
54
-        $sus = $query->fetchColumn();
55
-        $statusElement->setAttribute("bans", $sus);
56
-        $query->closeCursor();
53
+		$query->execute();
54
+		$sus = $query->fetchColumn();
55
+		$statusElement->setAttribute("bans", $sus);
56
+		$query->closeCursor();
57 57
 
58
-        $query = $this->getDatabase()->prepare(<<<SQL
58
+		$query = $this->getDatabase()->prepare(<<<SQL
59 59
 SELECT /* Api/StatusAction */ COUNT(*) AS count
60 60
 FROM user WHERE status = :ulevel;
61 61
 SQL
62
-        );
62
+		);
63 63
 
64
-        $query->bindValue(":ulevel", "New");
65
-        $query->execute();
66
-        $sus = $query->fetchColumn();
67
-        $statusElement->setAttribute("usernew", $sus);
68
-        $query->closeCursor();
64
+		$query->bindValue(":ulevel", "New");
65
+		$query->execute();
66
+		$sus = $query->fetchColumn();
67
+		$statusElement->setAttribute("usernew", $sus);
68
+		$query->closeCursor();
69 69
 
70
-        $query = $this->getDatabase()->prepare(<<<SQL
70
+		$query = $this->getDatabase()->prepare(<<<SQL
71 71
 select /* Api/StatusAction */ COUNT(*) from user u
72 72
 inner join userrole ur on u.id = ur.user
73 73
 where u.status = 'Active' and ur.role = :ulevel
74 74
 SQL
75
-        );
75
+		);
76 76
 
77
-        $query->bindValue(":ulevel", "admin");
78
-        $query->execute();
79
-        $sus = $query->fetchColumn();
80
-        $statusElement->setAttribute("useradmin", $sus);
81
-        $query->closeCursor();
77
+		$query->bindValue(":ulevel", "admin");
78
+		$query->execute();
79
+		$sus = $query->fetchColumn();
80
+		$statusElement->setAttribute("useradmin", $sus);
81
+		$query->closeCursor();
82 82
 
83
-        $query->bindValue(":ulevel", "user");
84
-        $query->execute();
85
-        $sus = $query->fetchColumn();
86
-        $statusElement->setAttribute("user", $sus);
87
-        $query->closeCursor();
83
+		$query->bindValue(":ulevel", "user");
84
+		$query->execute();
85
+		$sus = $query->fetchColumn();
86
+		$statusElement->setAttribute("user", $sus);
87
+		$query->closeCursor();
88 88
 
89
-        return $apiDocument;
90
-    }
89
+		return $apiDocument;
90
+	}
91 91
 }
Please login to merge, or discard this patch.