@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | require_once('class.FlipREST.php'); |
| 5 | 5 | require_once('class.AuthProvider.php'); |
| 6 | 6 | |
| 7 | -if($_SERVER['REQUEST_URI'][0] == '/' && $_SERVER['REQUEST_URI'][1] == '/') |
|
| 7 | +if ($_SERVER['REQUEST_URI'][0] == '/' && $_SERVER['REQUEST_URI'][1] == '/') |
|
| 8 | 8 | { |
| 9 | 9 | $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 1); |
| 10 | 10 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | global $app; |
| 18 | 18 | $auth = AuthProvider::getInstance(); |
| 19 | 19 | $res = $auth->login($app->request->params('username'), $app->request->params('password')); |
| 20 | - if($res === false) |
|
| 20 | + if ($res === false) |
|
| 21 | 21 | { |
| 22 | 22 | $app->response->setStatus(403); |
| 23 | 23 | } |
@@ -20,8 +20,7 @@ |
||
| 20 | 20 | if($res === false) |
| 21 | 21 | { |
| 22 | 22 | $app->response->setStatus(403); |
| 23 | - } |
|
| 24 | - else |
|
| 23 | + } else |
|
| 25 | 24 | { |
| 26 | 25 | echo json_encode($res); |
| 27 | 26 | } |
@@ -14,28 +14,28 @@ discard block |
||
| 14 | 14 | $root = $_SERVER['DOCUMENT_ROOT']; |
| 15 | 15 | $script_dir = dirname(__FILE__); |
| 16 | 16 | $this->secure_root = substr($script_dir, strlen($root)); |
| 17 | - if($this->secure_root === false || strlen($this->secure_root) === 0) |
|
| 17 | + if ($this->secure_root === false || strlen($this->secure_root) === 0) |
|
| 18 | 18 | { |
| 19 | 19 | $this->secure_root = '/'; |
| 20 | 20 | } |
| 21 | - else if($this->secure_root[strlen($this->secure_root)-1] !== '/') |
|
| 21 | + else if ($this->secure_root[strlen($this->secure_root)-1] !== '/') |
|
| 22 | 22 | { |
| 23 | - $this->secure_root.='/'; |
|
| 23 | + $this->secure_root .= '/'; |
|
| 24 | 24 | } |
| 25 | 25 | $this->add_secure_css(); |
| 26 | 26 | $this->add_secure_script(); |
| 27 | 27 | $this->add_login_form(); |
| 28 | - $this->body_tags='data-login-url="'.$this->secure_root.'api/v1/login"'; |
|
| 28 | + $this->body_tags = 'data-login-url="'.$this->secure_root.'api/v1/login"'; |
|
| 29 | 29 | $plugin_files = glob($script_dir.'/*/plugin.php'); |
| 30 | 30 | $count = count($plugin_files); |
| 31 | - for($i = 0; $i < $count; $i++) |
|
| 31 | + for ($i = 0; $i < $count; $i++) |
|
| 32 | 32 | { |
| 33 | 33 | include($plugin_files[$i]); |
| 34 | 34 | } |
| 35 | 35 | $this->plugins = array(); |
| 36 | - foreach(get_declared_classes() as $class) |
|
| 36 | + foreach (get_declared_classes() as $class) |
|
| 37 | 37 | { |
| 38 | - if(is_subclass_of($class, 'SecurePlugin')) |
|
| 38 | + if (is_subclass_of($class, 'SecurePlugin')) |
|
| 39 | 39 | { |
| 40 | 40 | $this->plugins[] = new $class(); |
| 41 | 41 | } |
@@ -56,13 +56,13 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | function add_links() |
| 58 | 58 | { |
| 59 | - if($this->user !== false) |
|
| 59 | + if ($this->user !== false) |
|
| 60 | 60 | { |
| 61 | 61 | $secure_menu = array(); |
| 62 | - for($i = 0; $i < $this->plugin_count; $i++) |
|
| 62 | + for ($i = 0; $i < $this->plugin_count; $i++) |
|
| 63 | 63 | { |
| 64 | 64 | $ret = $this->plugins[$i]->get_secure_menu_entries($this, $this->user); |
| 65 | - if($ret !== false) |
|
| 65 | + if ($ret !== false) |
|
| 66 | 66 | { |
| 67 | 67 | $ret["<hr id='hr_$i'/>"] = false; |
| 68 | 68 | $secure_menu = array_merge($secure_menu, $ret); |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | function get_secure_child_entry_points() |
| 77 | 77 | { |
| 78 | 78 | $entry_points = ''; |
| 79 | - for($i = 0; $i < $this->plugin_count; $i++) |
|
| 79 | + for ($i = 0; $i < $this->plugin_count; $i++) |
|
| 80 | 80 | { |
| 81 | 81 | $ret = $this->plugins[$i]->get_plugin_entry_point(); |
| 82 | - if($ret !== false) |
|
| 82 | + if ($ret !== false) |
|
| 83 | 83 | { |
| 84 | - $entry_points .= '<li>'.$this->create_link($ret['name'],$ret['link']).'</li>'; |
|
| 84 | + $entry_points .= '<li>'.$this->create_link($ret['name'], $ret['link']).'</li>'; |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | return $entry_points; |
@@ -17,8 +17,7 @@ |
||
| 17 | 17 | if($this->secure_root === false || strlen($this->secure_root) === 0) |
| 18 | 18 | { |
| 19 | 19 | $this->secure_root = '/'; |
| 20 | - } |
|
| 21 | - else if($this->secure_root[strlen($this->secure_root)-1] !== '/') |
|
| 20 | + } else if($this->secure_root[strlen($this->secure_root)-1] !== '/') |
|
| 22 | 21 | { |
| 23 | 22 | $this->secure_root.='/'; |
| 24 | 23 | } |