@@ -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 | } |
@@ -52,6 +52,9 @@ |
||
52 | 52 | return $ret; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param integer $count |
|
57 | + */ |
|
55 | 58 | public function addPluginLinks($count, $plugins) |
56 | 59 | { |
57 | 60 | $secure_menu = array(); |
@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | $script_dir = dirname(__FILE__); |
12 | 12 | $ret = substr($script_dir, strlen($root)); |
13 | 13 | |
14 | - if($ret === false || strlen($ret) === 0) |
|
14 | + if ($ret === false || strlen($ret) === 0) |
|
15 | 15 | { |
16 | 16 | return '/'; |
17 | 17 | } |
18 | - else if($ret[strlen($ret)-1] !== '/') |
|
18 | + else if ($ret[strlen($ret)-1] !== '/') |
|
19 | 19 | { |
20 | 20 | $ret .= '/'; |
21 | 21 | } |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | $script_dir = dirname(__FILE__); |
38 | 38 | $plugin_files = glob($script_dir.'/*/plugin.php'); |
39 | 39 | $count = count($plugin_files); |
40 | - for($i = 0; $i < $count; $i++) |
|
40 | + for ($i = 0; $i < $count; $i++) |
|
41 | 41 | { |
42 | 42 | include($plugin_files[$i]); |
43 | 43 | } |
44 | 44 | $ret = array(); |
45 | - foreach(get_declared_classes() as $class) |
|
45 | + foreach (get_declared_classes() as $class) |
|
46 | 46 | { |
47 | - if(is_subclass_of($class, 'SecurePlugin')) |
|
47 | + if (is_subclass_of($class, 'SecurePlugin')) |
|
48 | 48 | { |
49 | 49 | $ret[] = new $class(); |
50 | 50 | } |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | public function addPluginLinks($count, $plugins) |
56 | 56 | { |
57 | 57 | $secure_menu = array(); |
58 | - for($i = 0; $i < $count; $i++) |
|
58 | + for ($i = 0; $i < $count; $i++) |
|
59 | 59 | { |
60 | 60 | $ret = $plugins[$i]->get_secure_menu_entries($this, $this->user); |
61 | - if($ret !== false) |
|
61 | + if ($ret !== false) |
|
62 | 62 | { |
63 | 63 | $ret["<hr id='hr_$i'/>"] = false; |
64 | 64 | $secure_menu = array_merge($secure_menu, $ret); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->addSecureCss(); |
85 | 85 | $this->addSecureScript(); |
86 | 86 | $this->add_login_form(); |
87 | - $this->body_tags='data-login-url="'.$this->secure_root.'api/v1/login"'; |
|
87 | + $this->body_tags = 'data-login-url="'.$this->secure_root.'api/v1/login"'; |
|
88 | 88 | $this->plugins = $this->loadAndGetPlugins(); |
89 | 89 | $this->plugin_count = count($this->plugins); |
90 | 90 | $this->add_links(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | function add_links() |
94 | 94 | { |
95 | - if($this->user !== false) |
|
95 | + if ($this->user !== false) |
|
96 | 96 | { |
97 | 97 | $this->addPluginLinks($this->plugin_count, $this->plugins); |
98 | 98 | } |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | function get_secure_child_entry_points() |
102 | 102 | { |
103 | 103 | $entry_points = ''; |
104 | - for($i = 0; $i < $this->plugin_count; $i++) |
|
104 | + for ($i = 0; $i < $this->plugin_count; $i++) |
|
105 | 105 | { |
106 | 106 | $ret = $this->plugins[$i]->get_plugin_entry_point(); |
107 | - if($ret !== false) |
|
107 | + if ($ret !== false) |
|
108 | 108 | { |
109 | - $entry_points .= '<li>'.$this->createLink($ret['name'],$ret['link']).'</li>'; |
|
109 | + $entry_points .= '<li>'.$this->createLink($ret['name'], $ret['link']).'</li>'; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | return $entry_points; |
@@ -14,8 +14,7 @@ |
||
14 | 14 | if($ret === false || strlen($ret) === 0) |
15 | 15 | { |
16 | 16 | return '/'; |
17 | - } |
|
18 | - else if($ret[strlen($ret)-1] !== '/') |
|
17 | + } else if($ret[strlen($ret)-1] !== '/') |
|
19 | 18 | { |
20 | 19 | $ret .= '/'; |
21 | 20 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $this->addSecureCss(); |
17 | 17 | $this->addSecureScript(); |
18 | 18 | $this->add_login_form(); |
19 | - $this->body_tags='data-login-url="'.$this->secure_root.'api/v1/login"'; |
|
19 | + $this->body_tags = 'data-login-url="'.$this->secure_root.'api/v1/login"'; |
|
20 | 20 | $this->plugins = $this->loadAndGetPlugins(); |
21 | 21 | $this->plugin_count = count($this->plugins); |
22 | 22 | $this->add_links(); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | function add_links() |
26 | 26 | { |
27 | - if($this->user !== false) |
|
27 | + if ($this->user !== false) |
|
28 | 28 | { |
29 | 29 | $this->addPluginLinks($this->plugin_count, $this->plugins); |
30 | 30 | } |