Completed
Push — master ( f3d443...f2ef51 )
by Patrick
03:59 queued 01:03
created
class.FlipAdminPage.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@  discard block
 block discarded – undo
34 34
         if($this->user === false || $this->user === null)
35 35
         {
36 36
             $this->add_link('<i class="fa fa-sign-in"></i> Login', $this->loginUrl);
37
-        }
38
-        else
37
+        } else
39 38
         {
40 39
             $this->add_links();
41 40
             $this->add_link('<i class="fa fa-sign-out"></i> Logout', $this->logoutUrl);
@@ -166,8 +165,7 @@  discard block
 block discarded – undo
166 165
                 <h1 class="page-header">You must <a href="'.$this->loginUrl.'?return='.$this->current_url().'">log in <span class="glyphicon glyphicon-log-in"></span></a> to access the '.$this->title.' Admin system!</h1>
167 166
             </div>
168 167
         </div>';
169
-        }
170
-        else if($this->is_admin === false)
168
+        } else if($this->is_admin === false)
171 169
         {
172 170
             $this->body = '
173 171
         <div class="row">
Please login to merge, or discard this patch.
Auth/class.Group.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,12 +86,13 @@
 block discarded – undo
86 86
                 {
87 87
                     $isLast = true;
88 88
                 }
89
-                if(!isset($group->member[$i]->type)) continue;
89
+                if(!isset($group->member[$i]->type)) {
90
+                    continue;
91
+                }
90 92
                 if($group->member[$i]->type === 'Group')
91 93
                 {
92 94
                     $this->addMember($group->member[$i]->cn, true, $isLast);
93
-                }
94
-                else
95
+                } else
95 96
                 {
96 97
                     $this->addMember($group->member[$i]->uid, false, $isLast);
97 98
                 }
Please login to merge, or discard this patch.
Auth/class.SQLAuthenticator.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -149,7 +149,9 @@  discard block
 block discarded – undo
149 149
 
150 150
     public function login($username, $password)
151 151
     {
152
-        if($this->current === false) return false;
152
+        if($this->current === false) {
153
+            return false;
154
+        }
153 155
         $userDataTable = $this->getDataTable('user');
154 156
         $filter = new \Data\Filter("uid eq '$username'");
155 157
         $users = $userDataTable->read($filter, 'uid,pass');
@@ -235,9 +237,13 @@  discard block
 block discarded – undo
235 237
 
236 238
     public function getPendingUserCount()
237 239
     {
238
-        if($this->pending === false) return 0;
240
+        if($this->pending === false) {
241
+            return 0;
242
+        }
239 243
         $dataTable = $this->getPendingUserDataTable();
240
-        if($dataTable === null) return 0;
244
+        if($dataTable === null) {
245
+            return 0;
246
+        }
241 247
         return $dataTable->count();
242 248
     }
243 249
 
@@ -275,7 +281,9 @@  discard block
 block discarded – undo
275 281
     public function getPendingUsersByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false)
276 282
 
277 283
     {
278
-        if($this->pending === false) return false;
284
+        if($this->pending === false) {
285
+            return false;
286
+        }
279 287
         if($filter !== false && !$filter->contains('hash'))
280 288
         {
281 289
             return $this->searchPendingUsers($filter, $select, $top, $skip, $orderby);
@@ -296,7 +304,9 @@  discard block
 block discarded – undo
296 304
 
297 305
     public function createPendingUser($user)
298 306
     {
299
-        if($this->pending === false) return false;
307
+        if($this->pending === false) {
308
+            return false;
309
+        }
300 310
         $userDataTable = $this->getPendingUserDataTable();
301 311
         if(isset($user->password2))
302 312
         {
Please login to merge, or discard this patch.
Auth/class.GoogleAuthenticator.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
             }
56 56
             $currentUser = $localUsers[0];
57 57
             return self::ALREADY_PRESENT;
58
-        }
59
-        else
58
+        } else
60 59
         {
61 60
             $user = new PendingUser();
62 61
             $user->setEmail($googleUser->email);
Please login to merge, or discard this patch.
Auth/class.User.php 1 patch
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -280,11 +280,15 @@  discard block
 block discarded – undo
280 280
     function canLoginWith($provider)
281 281
     {
282 282
         $hosts = $this->getLoginProviders();
283
-        if($hosts === false) return false;
283
+        if($hosts === false) {
284
+            return false;
285
+        }
284 286
         $count = count($hosts);
285 287
         for($i = 0; $i < $count; $i++)
286 288
         {
287
-            if(strcasecmp($hosts[$i], $provider) === 0) return true;
289
+            if(strcasecmp($hosts[$i], $provider) === 0) {
290
+                return true;
291
+            }
288 292
         }
289 293
         return false;
290 294
     }
@@ -607,8 +611,7 @@  discard block
 block discarded – undo
607 611
             $this->change_pass($data->oldpass, $data->password);
608 612
             unset($data->oldpass);
609 613
             unset($data->password);
610
-        }
611
-        else if(isset($data->hash) && isset($data->password))
614
+        } else if(isset($data->hash) && isset($data->password))
612 615
         {
613 616
             $this->change_pass($data->hash, $data->password, true);
614 617
             return;
Please login to merge, or discard this patch.
class.FlipREST.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -75,8 +75,7 @@  discard block
 block discarded – undo
75 75
         if(!isset($this->headers['Authorization']))
76 76
         {
77 77
             $this->app->user = $this->getUserFromSession();
78
-        } 
79
-        else 
78
+        } else 
80 79
         {
81 80
             $header = $this->headers['Authorization'];
82 81
             $this->app->user = $this->getUserFromHeader($header);
@@ -99,16 +98,13 @@  discard block
 block discarded – undo
99 98
         if(is_array($value))
100 99
         {
101 100
             $array[$key] = implode(';', $value);
102
-        }
103
-        else if($key === '_id' && is_object($value))
101
+        } else if($key === '_id' && is_object($value))
104 102
         {
105 103
             $array[$key] = $value->{'$id'};
106
-        }
107
-        else if(is_object($value))
104
+        } else if(is_object($value))
108 105
         {
109 106
             $array[$key] = $this->app->request->getUrl().$this->app->request->getPath().$prefix.'/'.$key;
110
-        }
111
-        else if(strncmp($value, 'data:', 5) === 0)
107
+        } else if(strncmp($value, 'data:', 5) === 0)
112 108
         {
113 109
             $array[$key] = $this->app->request->getUrl().$this->app->request->getPath().$prefix.'/'.$key;
114 110
         }
@@ -129,8 +125,7 @@  discard block
 block discarded – undo
129 125
             if(is_array($first))
130 126
             {
131 127
                 $keys = array_keys($first);
132
-            }
133
-            else if(is_object($first))
128
+            } else if(is_object($first))
134 129
             {
135 130
                 $keys = array_keys(get_object_vars($first));
136 131
             }
@@ -145,8 +140,7 @@  discard block
 block discarded – undo
145 140
                         $this->fix_encoded_element($key, $value, $row, '/'.$id);
146 141
                     }
147 142
                     fputcsv($df, $row);
148
-                }
149
-                else if(is_object($row))
143
+                } else if(is_object($row))
150 144
                 {
151 145
                     $keyName = $keys[0];
152 146
                     $id = $row->$keyName;
@@ -162,8 +156,7 @@  discard block
 block discarded – undo
162 156
                     fputcsv($df, $values);
163 157
                 }
164 158
             }
165
-        }
166
-        else
159
+        } else
167 160
         {
168 161
             $array = get_object_vars($array);
169 162
             fputcsv($df, array_keys($array));
@@ -262,8 +255,7 @@  discard block
 block discarded – undo
262 255
                     break;
263 256
             }
264 257
             $this->app->response->setBody($text);
265
-        }
266
-        else if($this->app->response->getStatus() == 200)
258
+        } else if($this->app->response->getStatus() == 200)
267 259
         {
268 260
             $this->app->response->headers->set('Content-Type', 'application/json;odata.metadata=none');
269 261
         }
Please login to merge, or discard this patch.
Data/class.SQLDataSet.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@  discard block
 block discarded – undo
10 10
         if(isset($params['user']))
11 11
         {
12 12
             $this->pdo = new \PDO($params['dsn'], $params['user'], $params['pass']);
13
-        }
14
-        else
13
+        } else
15 14
         {
16 15
             $this->pdo = new \PDO($params['dsn']);
17 16
         }
@@ -38,8 +37,7 @@  discard block
 block discarded – undo
38 37
         if($this->_get_row_count_for_query('SHOW TABLES LIKE '.$this->pdo->quote($name)) > 0)
39 38
         {
40 39
             return true;
41
-        }
42
-        else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote($name)) > 0)
40
+        } else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote($name)) > 0)
43 41
         {
44 42
             return true;
45 43
         }
@@ -51,8 +49,7 @@  discard block
 block discarded – undo
51 49
         if($this->_get_row_count_for_query('SHOW TABLES LIKE '.$this->pdo->quote('tbl'.$name)) > 0)
52 50
         {
53 51
             return true;
54
-        }
55
-        else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote('tbl'.$name)) > 0)
52
+        } else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote('tbl'.$name)) > 0)
56 53
         {
57 54
             return true;
58 55
         }
@@ -64,8 +61,7 @@  discard block
 block discarded – undo
64 61
         if($this->_get_row_count_for_query('SHOW TABLES LIKE '.$this->pdo->quote('v'.$name)) > 0)
65 62
         {
66 63
             return true;
67
-        }
68
-        else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote('v'.$name)) > 0)
64
+        } else if($this->_get_row_count_for_query('SELECT * FROM sqlite_master WHERE name LIKE '.$this->pdo->quote('v'.$name)) > 0)
69 65
         {
70 66
             return true;
71 67
         }
@@ -122,8 +118,7 @@  discard block
 block discarded – undo
122 118
             if($skip === false)
123 119
             {
124 120
                 $sql.=' LIMIT '.(int)$count;
125
-            }
126
-            else
121
+            } else
127 122
             {
128 123
                 $sql.=" LIMIT $skip, $count";
129 124
             }
Please login to merge, or discard this patch.
Data/class.Filter.php 1 patch
Braces   +20 added lines, -25 removed lines patch added patch discarded remove patch
@@ -30,11 +30,15 @@  discard block
 block discarded – undo
30 30
             return array(new FilterClause($string));
31 31
         }
32 32
         $children = array();
33
-        if($parens) array_push($children, '(');
33
+        if($parens) {
34
+            array_push($children, '(');
35
+        }
34 36
         $children = array_merge($children, self::process_string($clauses[1]));
35 37
         array_push($children, trim($clauses[2]));
36 38
         $children = array_merge($children, self::process_string($clauses[3]));
37
-        if($parens) array_push($children, ')');
39
+        if($parens) {
40
+            array_push($children, ')');
41
+        }
38 42
         return $children;
39 43
     }
40 44
 
@@ -47,16 +51,13 @@  discard block
 block discarded – undo
47 51
             if($this->children[$i] === '(' || $this->children[$i] === ')')
48 52
             {
49 53
                 $ret.=$this->children[$i];
50
-            }
51
-            else if($this->children[$i] === 'and')
54
+            } else if($this->children[$i] === 'and')
52 55
             {
53 56
                 $ret.=' AND ';
54
-            }
55
-            else if($this->children[$i] === 'or')
57
+            } else if($this->children[$i] === 'or')
56 58
             {
57 59
                 $ret.=' OR ';
58
-            }
59
-            else
60
+            } else
60 61
             {
61 62
                 $ret.=$this->children[$i]->to_sql_string();
62 63
             }
@@ -78,16 +79,14 @@  discard block
 block discarded – undo
78 79
                     throw new \Exception('Do not support both and or');
79 80
                 }
80 81
                 $prefix = '&';
81
-            }
82
-            else if($this->children[$i] === 'or')
82
+            } else if($this->children[$i] === 'or')
83 83
             {
84 84
                 if($prefix == '&')
85 85
                 {
86 86
                     throw new \Exception('Do not support both and or');
87 87
                 }
88 88
                 $prefix = '|';
89
-            }
90
-            else
89
+            } else
91 90
             {
92 91
                 $ret.=$this->children[$i]->to_ldap_string();
93 92
             }
@@ -109,13 +108,11 @@  discard block
 block discarded – undo
109 108
             {
110 109
                 $old = array_pop($ret);
111 110
                 array_push($ret, array('$and'=>array($old, $this->children[++$i]->to_mongo_filter())));
112
-            }
113
-            else if($this->children[$i] === 'or')
111
+            } else if($this->children[$i] === 'or')
114 112
             {
115 113
                 $old = array_pop($ret);
116 114
                 array_push($ret, array('$or'=>array($old, $this->children[++$i]->to_mongo_filter())));
117
-            }
118
-            else
115
+            } else
119 116
             {
120 117
                 array_push($ret, $this->children[$i]->to_mongo_filter());
121 118
             }
@@ -140,12 +137,10 @@  discard block
 block discarded – undo
140 137
                 if($this->children[$i] === 'and')
141 138
                 {
142 139
                     $search = $res;
143
-                }
144
-                else if($this->children[$i] === 'or')
140
+                } else if($this->children[$i] === 'or')
145 141
                 {
146 142
                     $search = $array;
147
-                }
148
-                else
143
+                } else
149 144
                 {
150 145
                     foreach($search as $subarray)
151 146
                     {
@@ -173,7 +168,9 @@  discard block
 block discarded – undo
173 168
         $count = count($this->children);
174 169
         for($i = 0; $i < $count; $i++)
175 170
         {
176
-            if(!is_object($this->children[$i])) continue;
171
+            if(!is_object($this->children[$i])) {
172
+                continue;
173
+            }
177 174
             if(strstr($this->children[$i]->var1, $substr) !== false ||
178 175
                strstr($this->children[$i]->var2, $substr) !== false)
179 176
             {
@@ -193,12 +190,10 @@  discard block
 block discarded – undo
193 190
         {
194 191
             array_push($this->children, $child);
195 192
             return;
196
-        }
197
-        else if(is_a($child, '\Data\Filter'))
193
+        } else if(is_a($child, '\Data\Filter'))
198 194
         {
199 195
             $this->children = array_merge($this->children, $child->children);
200
-        }
201
-        else
196
+        } else
202 197
         {
203 198
             $this->children = array_merge($this->children, self::process_string($child));
204 199
         }
Please login to merge, or discard this patch.
Data/class.MongoDataSet.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,19 +40,16 @@  discard block
 block discarded – undo
40 40
         if(class_exists('MongoClient'))
41 41
         {
42 42
             $this->setupMongoClient($params);
43
-        }
44
-        else if(class_exists('\MongoDB\Driver\Manager'))
43
+        } else if(class_exists('\MongoDB\Driver\Manager'))
45 44
         {
46 45
             $this->setupMongoManager($params);
47
-        }
48
-        else
46
+        } else
49 47
         {
50 48
             require __DIR__.'/../libs/mongofill/src/functions.php';
51 49
             if(version_compare(PHP_VERSION, '5.3.0', '>='))
52 50
             {
53 51
                 spl_autoload_register('\Data\MongofillAutoload', true, true);
54
-            }
55
-            else
52
+            } else
56 53
             {
57 54
                 spl_autoload_register('\Data\MongofillAutoload');
58 55
             }
@@ -75,8 +72,7 @@  discard block
 block discarded – undo
75 72
         if($this->db !== null)
76 73
         {
77 74
             return new MongoDataTable($this->db->selectCollection($name));
78
-        }
79
-        else
75
+        } else
80 76
         {
81 77
             return new MongoDataTable($this->db_name, $name);
82 78
         }
@@ -87,8 +83,7 @@  discard block
 block discarded – undo
87 83
         if(isset($params['user']))
88 84
         {
89 85
             $this->client = new \MongoClient('mongodb://'.$params['host'].'/'.$params['db'], array('username'=>$params['user'], 'password'=>$params['pass']));
90
-        }
91
-        else
86
+        } else
92 87
         {
93 88
             $this->client = new \MongoClient('mongodb://'.$params['host'].'/'.$params['db']);
94 89
         }
@@ -100,8 +95,7 @@  discard block
 block discarded – undo
100 95
         if(isset($params['user']))
101 96
         {
102 97
             $this->manager = new \MongoDB\Driver\Manager('mongodb://'.$params['user'].':'.$params['pass'].'@'.$params['host'].'/'.$params['db']);
103
-        }
104
-        else
98
+        } else
105 99
         {
106 100
             $this->manager = new \MongoDB\Driver\Manager('mongodb://'.$params['host'].'/'.$params['db']);
107 101
         }
Please login to merge, or discard this patch.