Completed
Push — master ( 691ef6...986102 )
by Patrick
43s
created
class.SecurePage.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
         $script_dir = dirname(__FILE__);
11 11
         $ret = substr($script_dir, strlen($root));
12 12
 
13
-        if($ret === false || strlen($ret) === 0)
13
+        if ($ret === false || strlen($ret) === 0)
14 14
         {
15 15
             return '/';
16 16
         }
17
-        else if($ret[strlen($ret)-1] !== '/')
17
+        else if ($ret[strlen($ret)-1] !== '/')
18 18
         {
19 19
             $ret .= '/';
20 20
         }
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
         $script_dir = dirname(__FILE__);
27 27
         $plugin_files = glob($script_dir.'/*/plugin.php');
28 28
         $count = count($plugin_files);
29
-        for($i = 0; $i < $count; $i++)
29
+        for ($i = 0; $i < $count; $i++)
30 30
         {
31 31
             include($plugin_files[$i]);
32 32
         }
33 33
         $ret = array();
34
-        foreach(get_declared_classes() as $class)
34
+        foreach (get_declared_classes() as $class)
35 35
         {
36
-            if(is_subclass_of($class, 'SecurePlugin'))
36
+            if (is_subclass_of($class, 'SecurePlugin'))
37 37
             {
38 38
                 $ret[] = new $class();
39 39
             }
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
     public function addPluginLinks($count, $plugins)
45 45
     {
46 46
         $secure_menu = array();
47
-        for($i = 0; $i < $count; $i++)
47
+        for ($i = 0; $i < $count; $i++)
48 48
         {
49 49
             $ret = $plugins[$i]->get_secure_menu_entries($this, $this->user);
50
-            if($ret !== false)
50
+            if ($ret !== false)
51 51
             {
52 52
                 $secure_menu = array_merge($secure_menu, $ret);
53 53
             }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
     function add_links()
80 80
     {
81
-        if($this->user !== false)
81
+        if ($this->user !== false)
82 82
         {
83 83
             $this->addPluginLinks($this->plugin_count, $this->plugins);
84 84
         }
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
     function get_secure_child_entry_points()
88 88
     {
89 89
         $entry_points = '';
90
-        for($i = 0; $i < $this->plugin_count; $i++)
90
+        for ($i = 0; $i < $this->plugin_count; $i++)
91 91
         {
92 92
             $ret = $this->plugins[$i]->get_plugin_entry_point();
93
-            if($ret !== false)
93
+            if ($ret !== false)
94 94
             {
95 95
                 $entry_points .= '<li><a href="'.$ret['link'].'">'.$ret['name'].'</a></li>';
96 96
             }
Please login to merge, or discard this patch.
api/v1/class.SecureAPI.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
19 19
         if($res === false)
20 20
         {
21 21
             return $response->withStatus(403);
22
-        }
23
-        else
22
+        } else
24 23
         {
25 24
             return $response->withJson($res);
26 25
         }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
     public function login($request, $response, $args)
11 11
     {
12 12
         $params = $request->getParams();
13
-        if(!isset($params['username']) || !isset($params['password']))
13
+        if (!isset($params['username']) || !isset($params['password']))
14 14
         {
15 15
             return $response->withStatus(400);
16 16
         }
17 17
         $auth = \Flipside\AuthProvider::getInstance();
18 18
         $res = $auth->login($params['username'], $params['password']);
19
-        if($res === false)
19
+        if ($res === false)
20 20
         {
21 21
             return $response->withStatus(403);
22 22
         }
Please login to merge, or discard this patch.
class.SecureLoginRequiredPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     function add_links()
22 22
     {
23
-        if($this->user !== false)
23
+        if ($this->user !== false)
24 24
         {
25 25
             $this->addPluginLinks($this->plugin_count, $this->plugins);
26 26
         }
Please login to merge, or discard this patch.
Autoload.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(file_exists(__DIR__ . '/vendor/autoload.php'))
2
+if (file_exists(__DIR__.'/vendor/autoload.php'))
3 3
 {
4
-    require __DIR__ . '/vendor/autoload.php';
4
+    require __DIR__.'/vendor/autoload.php';
5 5
 }
6
-else if(file_exists(__DIR__ . '/../common/Autoload.php'))
6
+else if (file_exists(__DIR__.'/../common/Autoload.php'))
7 7
 {
8
-    require(__DIR__ . '/../common/Autoload.php');
8
+    require(__DIR__.'/../common/Autoload.php');
9 9
 }
10 10
 
11
-spl_autoload_register(function ($class) {
11
+spl_autoload_register(function($class) {
12 12
 
13 13
     // project-specific namespace prefix
14 14
     $prefix = 'Flipside\\Secure\\';
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     // replace the namespace prefix with the base directory, replace namespace
30 30
     // separators with directory separators in the relative class name, append
31 31
     // with .php
32
-    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
32
+    $file = $base_dir.str_replace('\\', '/', $relative_class).'.php';
33 33
 
34 34
     // if the file exists, require it
35 35
     if (file_exists($file)) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@
 block discarded – undo
2 2
 if(file_exists(__DIR__ . '/vendor/autoload.php'))
3 3
 {
4 4
     require __DIR__ . '/vendor/autoload.php';
5
-}
6
-else if(file_exists(__DIR__ . '/../common/Autoload.php'))
5
+} else if(file_exists(__DIR__ . '/../common/Autoload.php'))
7 6
 {
8 7
     require(__DIR__ . '/../common/Autoload.php');
9 8
 }
Please login to merge, or discard this patch.