@@ -219,7 +219,8 @@ |
||
219 | 219 | public function getGroupByName($name) |
220 | 220 | { |
221 | 221 | $group = $this->getEntityByFilter('group', "cn eq '$name'", '\Flipside\Auth\SQLGroup'); |
222 | - if($group === null) { |
|
222 | + if($group === null) |
|
223 | + { |
|
223 | 224 | return $this->getEntityByFilter('group', "gid eq '$name'", '\Flipside\Auth\SQLGroup'); |
224 | 225 | } |
225 | 226 | return $group; |
@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | require(__DIR__ . '/vendor/autoload.php'); |
14 | 14 | } |
15 | 15 | set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); |
16 | -spl_autoload_register(function ($class) { |
|
16 | +spl_autoload_register(function ($class) |
|
17 | +{ |
|
17 | 18 | |
18 | 19 | // project-specific namespace prefix |
19 | 20 | $prefix = 'Flipside\\'; |
@@ -23,7 +24,8 @@ discard block |
||
23 | 24 | |
24 | 25 | // does the class use the namespace prefix? |
25 | 26 | $len = strlen($prefix); |
26 | - if (strncmp($prefix, $class, $len) !== 0) { |
|
27 | + if (strncmp($prefix, $class, $len) !== 0) |
|
28 | + { |
|
27 | 29 | // no, move to the next registered autoloader |
28 | 30 | return; |
29 | 31 | } |
@@ -37,7 +39,8 @@ discard block |
||
37 | 39 | $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
38 | 40 | |
39 | 41 | // if the file exists, require it |
40 | - if (file_exists($file)) { |
|
42 | + if (file_exists($file)) |
|
43 | + { |
|
41 | 44 | require $file; |
42 | 45 | } |
43 | 46 | }); |
@@ -152,9 +152,9 @@ |
||
152 | 152 | $case = true; |
153 | 153 | } |
154 | 154 | if($case) |
155 | - { |
|
155 | + { |
|
156 | 156 | if(class_exists('MongoRegex')) |
157 | - { |
|
157 | + { |
|
158 | 158 | return array($field=>array('$regex'=>new \MongoRegex('/'.$this->var2.'/i'))); |
159 | 159 | } |
160 | 160 | else |
@@ -79,11 +79,11 @@ |
||
79 | 79 | { |
80 | 80 | $auth = $request->getHeaderLine('Authorization'); |
81 | 81 | if(empty($auth)) |
82 | - { |
|
82 | + { |
|
83 | 83 | $request = $request->withAttribute('user', $this->getUserFromSession()); |
84 | 84 | } |
85 | 85 | else |
86 | - { |
|
86 | + { |
|
87 | 87 | $request = $request->withAttribute('user', $this->getUserFromHeader($auth)); |
88 | 88 | } |
89 | 89 | $response = $next($request, $response); |