Completed
Branch fix/scruitinizer (a30f58)
by Patrick
03:55 queued 01:17
created
oauth2callback.php 1 patch
Switch Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 
25 25
 switch($src)
26 26
 {
27
-    case 'google':
28
-        $google = $auth->getMethodByName('Auth\GoogleAuthenticator');
29
-        if(!isset($_GET['code']))
30
-        {
31
-            $google->redirect();
32
-            die();
33
-        }
34
-        else
35
-        {
36
-            $res = $google->authenticate($_GET['code'], $current_user);
37
-            switch($res)
27
+        case 'google':
28
+            $google = $auth->getMethodByName('Auth\GoogleAuthenticator');
29
+            if(!isset($_GET['code']))
30
+            {
31
+                $google->redirect();
32
+                die();
33
+            }
34
+            else
38 35
             {
36
+                $res = $google->authenticate($_GET['code'], $current_user);
37
+                switch($res)
38
+                {
39 39
                 case \Auth\Authenticator::SUCCESS:
40 40
                     header('Location: '.$ref);
41 41
                     die();
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
                 case \Auth\Authenticator::ALREADY_PRESENT:
47 47
                     header('Location: user_exists.php?src=google&uid='.$current_user->uid);
48 48
                     die();
49
-            }
49
+                }
50 50
         }
51 51
         break;
52
-    case 'twitter':
53
-        $twitter = $auth->getMethodByName('Auth\TwitterAuthenticator');
54
-        if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier']))
55
-        {
56
-            $twitter->redirect();
57
-            die();
58
-        }
59
-        else
60
-        {
61
-            $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user);
62
-            switch($res)
52
+        case 'twitter':
53
+            $twitter = $auth->getMethodByName('Auth\TwitterAuthenticator');
54
+            if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier']))
55
+            {
56
+                $twitter->redirect();
57
+                die();
58
+            }
59
+            else
63 60
             {
61
+                $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user);
62
+                switch($res)
63
+                {
64 64
                 case \Auth\Authenticator::SUCCESS:
65 65
                     header('Location: '.$ref);
66 66
                     die();
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
                 case \Auth\Authenticator::ALREADY_PRESENT:
72 72
                     header('Location: user_exists.php?src=twitter&uid='.$current_user->uid);
73 73
                     die();
74
-            }
74
+                }
75 75
         }
76 76
         break;
77
-    case 'gitlab':
78
-        $gitlab = $auth->getMethodByName('Auth\OAuth2\GitLabAuthenticator');
79
-        if(!isset($_GET['code']))
80
-        {
81
-            $google->redirect();
82
-            die();
83
-        }
84
-        else
85
-        {
86
-            $res = $gitlab->authenticate($_GET['code'], $current_user);
87
-            switch($res)
77
+        case 'gitlab':
78
+            $gitlab = $auth->getMethodByName('Auth\OAuth2\GitLabAuthenticator');
79
+            if(!isset($_GET['code']))
80
+            {
81
+                $google->redirect();
82
+                die();
83
+            }
84
+            else
88 85
             {
86
+                $res = $gitlab->authenticate($_GET['code'], $current_user);
87
+                switch($res)
88
+                {
89 89
                 case \Auth\Authenticator::SUCCESS:
90 90
                     header('Location: '.$ref);
91 91
                     die();
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
                 case \Auth\Authenticator::ALREADY_PRESENT:
97 97
                     header('Location: user_exists.php?src=gitlab&uid='.$current_user->uid);
98 98
                     die();
99
-            }
99
+                }
100 100
         }
101 101
     //Generic OAuth...
102
-    default:
103
-        print_r($_SERVER);
104
-        break;
102
+        default:
103
+            print_r($_SERVER);
104
+            break;
105 105
 }
106 106
 ?>
Please login to merge, or discard this patch.
api/v1/class.GroupsAPI.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -49,6 +49,9 @@
 block discarded – undo
49 49
         return $response->withJson($groups);
50 50
     }
51 51
 
52
+    /**
53
+     * @param boolean $directOnly
54
+     */
52 55
     private function expandGroupMembers($group, $odata, $directOnly)
53 56
     {
54 57
         if($odata->expand !== false && in_array('member', $odata->expand))
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         $auth = AuthProvider::getInstance();
46 46
         $odata = $request->getAttribute('odata', new \ODataParams(array()));
47 47
         $groups = $auth->getGroupsByFilter($odata->filter, $odata->select, $odata->top, $odata->skip, 
48
-                                           $odata->orderby);
48
+                                            $odata->orderby);
49 49
         return $response->withJson($groups);
50 50
     }
51 51
 
Please login to merge, or discard this patch.
api/v1/class.UsersAPI.php 3 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -52,6 +52,9 @@  discard block
 block discarded – undo
52 52
         return $response->withJson($users);
53 53
     }
54 54
 
55
+    /**
56
+     * @param boolean $message
57
+     */
55 58
     protected function validateCanCreateUser($proposedUser, $auth, &$message)
56 59
     {
57 60
         $user = $auth->getUsersByFilter(new \Data\Filter('mail eq '.$proposedUser->mail));
@@ -367,6 +370,10 @@  discard block
 block discarded – undo
367 370
         return $response->withJson(array('success'=>true));
368 371
     }
369 372
 
373
+    /**
374
+     * @param Data\Filter $filter
375
+     * @param boolean $pending
376
+     */
370 377
     protected function getAllUsersByFilter($filter, &$pending)
371 378
     {
372 379
         $auth = AuthProvider::getInstance();
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         {
48 48
             $auth = AuthProvider::getInstance();
49 49
             $users = $auth->getUsersByFilter($odata->filter, $odata->select, $odata->top, $odata->skip, 
50
-                                             $odata->orderby);
50
+                                                $odata->orderby);
51 51
         }
52 52
         return $response->withJson($users);
53 53
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
         {
81 81
             return false;
82 82
         }
83
-        $domain = substr($email, $pos+1);
83
+        $domain = substr($email, $pos + 1);
84 84
         if(checkdnsrr($domain, 'MX') === false)
85 85
         {
86 86
             return false;
Please login to merge, or discard this patch.
api/v1/class.AreasAPI.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $dataTable = DataSetFactory::getDataTableByNames('profiles', 'position');
44 44
         $odata = $request->getAttribute('odata', new \ODataParams(array()));
45 45
         $leads = $dataTable->read(new \Data\Filter("area eq '".$args['name']."'"), $odata->select, $odata->top,
46
-                                  $odata->skip, $odata->orderby);
46
+                                    $odata->skip, $odata->orderby);
47 47
         if(empty($leads))
48 48
         {
49 49
             return $response->withStatus(404);
Please login to merge, or discard this patch.
lead/class.ProfilesLeadPage.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -42,24 +42,24 @@
 block discarded – undo
42 42
 
43 43
     public function add_links()
44 44
     {
45
-         $dirMenu = array(
46
-             'All' => 'directory.php',
47
-             'AAR' => 'directory.php?filter=aar',
48
-             'AFs' => 'directory.php?filter=af',
49
-             'CC'  => 'directory.php?filter=cc',
50
-             '360/24/7 Department' => 'directory.php?filter=360',
51
-             'Art' => 'directory.php?filter=Art',
52
-             'City Planning' => 'directory.php?filter=CityPlanning',
53
-             'Communications' => 'directory.php?filter=Comm',
54
-             'Genesis' => 'directory.php?filter=Genesis',
55
-             'Safety' => 'directory.php?filter=Safety',
56
-             'Site-Ops' => 'directory.php?filter=site-ops',
57
-             'Site Prep' => 'directory.php?filter=siteprep',
58
-             'Site Sign-Off' => 'directory.php?filter=sign-off',
59
-             'Volunteer Coordinator' => 'directory.php?filter=vc'
60
-         );
61
-         $this->addLink('<span class="fa fa-dashboard"></span> Dashboard', 'index.php');
62
-         $this->addLink('<span class="fa fa-th-list"></span> Directory', false, $dirMenu);
45
+            $dirMenu = array(
46
+                'All' => 'directory.php',
47
+                'AAR' => 'directory.php?filter=aar',
48
+                'AFs' => 'directory.php?filter=af',
49
+                'CC'  => 'directory.php?filter=cc',
50
+                '360/24/7 Department' => 'directory.php?filter=360',
51
+                'Art' => 'directory.php?filter=Art',
52
+                'City Planning' => 'directory.php?filter=CityPlanning',
53
+                'Communications' => 'directory.php?filter=Comm',
54
+                'Genesis' => 'directory.php?filter=Genesis',
55
+                'Safety' => 'directory.php?filter=Safety',
56
+                'Site-Ops' => 'directory.php?filter=site-ops',
57
+                'Site Prep' => 'directory.php?filter=siteprep',
58
+                'Site Sign-Off' => 'directory.php?filter=sign-off',
59
+                'Volunteer Coordinator' => 'directory.php?filter=vc'
60
+            );
61
+            $this->addLink('<span class="fa fa-dashboard"></span> Dashboard', 'index.php');
62
+            $this->addLink('<span class="fa fa-th-list"></span> Directory', false, $dirMenu);
63 63
     }
64 64
     
65 65
     public function isAdmin()
Please login to merge, or discard this patch.