Completed
Push — master ( e558ae...2292e9 )
by Gideon
8s
created
src/Gidkom/OpenFireRestApi/OpenFireRestApi.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 class OpenFireRestApi
8 8
 {
9 9
     public $host		= 'localhost';
10
-	public $port		= '9090';
11
-	public $plugin		= '/plugins/restapi/v1';
12
-	public $secret		= 'SuperSecret';
13
-	public $useSSL		= false;
10
+    public $port		= '9090';
11
+    public $plugin		= '/plugins/restapi/v1';
12
+    public $secret		= 'SuperSecret';
13
+    public $useSSL		= false;
14 14
     protected $params   = array();
15 15
     public $client;
16 16
 
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
     
36 36
     private function doRequest($type, $endpoint, $params=array())
37 37
     {
38
-    	$base = ($this->useSSL) ? "https" : "http";
39
-    	$url = $base . "://" . $this->host . ":" .$this->port.$this->plugin.$endpoint;
40
-    	$headers = array(
41
-  			'Accept' => 'application/json',
42
-  			'Authorization' => $this->secret
43
-  		);
38
+        $base = ($this->useSSL) ? "https" : "http";
39
+        $url = $base . "://" . $this->host . ":" .$this->port.$this->plugin.$endpoint;
40
+        $headers = array(
41
+                'Accept' => 'application/json',
42
+                'Authorization' => $this->secret
43
+            );
44 44
 
45 45
         $body = json_encode($params);
46 46
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function getUsers()
82 82
     {
83
-    	$endpoint = '/users';        
84
-    	return $this->doRequest('get',$endpoint);
83
+        $endpoint = '/users';        
84
+        return $this->doRequest('get',$endpoint);
85 85
     }
86 86
 
87 87
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
         return $this->doRequest('put', $endpoint, compact('username', 'password','name','email', 'groups'));
143 143
     }
144 144
 
145
-     /**
146
-     * locks/Disables an OpenFire user
147
-     *
148
-     * @param   string          $username   Username
149
-     * @return  json|false                 Json with data or error, or False when something went fully wrong
150
-     */
145
+        /**
146
+         * locks/Disables an OpenFire user
147
+         *
148
+         * @param   string          $username   Username
149
+         * @return  json|false                 Json with data or error, or False when something went fully wrong
150
+         */
151 151
     public function lockoutUser($username)
152 152
     {
153 153
         $endpoint = '/lockouts/'.$username; 
Please login to merge, or discard this patch.