Completed
Pull Request — develop (#82)
by Patrick
01:46
created
api/v1/class.GroupsAPI.php 3 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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
         return $response->withJson($group);
105 105
     }
106 106
 
107
-    protected function serializeArray(&$res, $array, $keys, $type=false)
107
+    protected function serializeArray(&$res, $array, $keys, $type = false)
108 108
     {
109 109
         $count = count($array);
110 110
         for($i = 0; $i < $count; $i++)
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         $auth = \Flipside\AuthProvider::getInstance();
19 19
         $odata = $request->getAttribute('odata', new \Flipside\ODataParams(array()));
20 20
         $groups = $auth->getGroupsByFilter($odata->filter, $odata->select, $odata->top, $odata->skip, 
21
-                                           $odata->orderby);
21
+                                            $odata->orderby);
22 22
         return $response->withJson($groups);
23 23
     }
24 24
 
Please login to merge, or discard this patch.
profile.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,21 +36,21 @@
 block discarded – undo
36 36
 {
37 37
     $mails = $page->user->allMail;
38 38
     $count = count($mails);
39
-    $page->body.='
39
+    $page->body .= '
40 40
             <label for="allMail" class="col-sm-2 control-label">Registered Emails:</label>
41 41
             <div class="col-sm-10">';
42 42
     for($i = 0; $i < $count; $i++)
43 43
     {
44
-        $page->body.='<div class="input-group">
44
+        $page->body .= '<div class="input-group">
45 45
                         <input type="text" class="form-control" value="'.$mails[$i].'" readonly>
46 46
                         <div class="input-group-append">
47 47
                           <button class="btn btn-outline-danger" type="button" onClick="removeEmail(\''.$mails[$i].'\')"><i class="fas fa-minus"></i></button>
48 48
                         </div>
49 49
                       </div>';
50 50
     }
51
-    $page->body.='</div>';
51
+    $page->body .= '</div>';
52 52
 }
53
-$page->body.='
53
+$page->body .= '
54 54
             <label for="mail" class="col-sm-2 control-label">Email:</label>
55 55
             <div class="col-sm-10">
56 56
                 <input class="form-control" id="mail" name="mail" type="text" readonly/>
Please login to merge, or discard this patch.
lead/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@
 block discarded – undo
18 18
 $aar_count = 0;
19 19
 if($aarGroup !== false)
20 20
 {
21
-    $aar_count  = $aarGroup->member_count();
21
+    $aar_count = $aarGroup->member_count();
22 22
 }
23 23
 $af_count = 0;
24 24
 if($afGroup !== false)
25 25
 {
26
-    $af_count   = $afGroup->member_count();
26
+    $af_count = $afGroup->member_count();
27 27
 }
28 28
 $cc_count = 0;
29 29
 if($ccGroup !== false)
30 30
 {
31
-    $cc_count   = $ccGroup->member_count();
31
+    $cc_count = $ccGroup->member_count();
32 32
 }
33 33
 
34 34
 $page->content['cards'] = array();
Please login to merge, or discard this patch.
api/v1/class.AreasAPI.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@
 block discarded – undo
32 32
         if($args['name'] === '*')
33 33
         {
34 34
             $leads = $dataTable->read($odata->filter, $odata->select, $odata->top,
35
-                                  $odata->skip, $odata->orderby);
35
+                                    $odata->skip, $odata->orderby);
36 36
         }
37 37
         else
38 38
         {
39 39
             $leads = $dataTable->read(new \Flipside\Data\Filter("area eq '".$args['name']."'"), $odata->select, $odata->top,
40
-                                  $odata->skip, $odata->orderby);
40
+                                    $odata->skip, $odata->orderby);
41 41
         }
42 42
         if(empty($leads))
43 43
         {
Please login to merge, or discard this patch.
api/v1/class.UsersAPI.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
         {
34 34
             $auth = \Flipside\AuthProvider::getInstance();
35 35
             $users = $auth->getUsersByFilter($odata->filter, $odata->select, $odata->top, $odata->skip, 
36
-                                             $odata->orderby);
36
+                                                $odata->orderby);
37 37
         }
38 38
         return $response->withJson($users);
39 39
     }
Please login to merge, or discard this patch.
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -38,6 +38,9 @@  discard block
 block discarded – undo
38 38
         return $response->withJson($users);
39 39
     }
40 40
 
41
+    /**
42
+     * @param boolean $message
43
+     */
41 44
     protected function validateCanCreateUser($proposedUser, $auth, &$message)
42 45
     {
43 46
         $user = $auth->getUsersByFilter(new \Flipside\Data\Filter('mail eq '.$proposedUser['mail']));
@@ -218,6 +221,9 @@  discard block
 block discarded – undo
218 221
         }
219 222
     }
220 223
 
224
+    /**
225
+     * @param Exception $e
226
+     */
221 227
     protected function exceptionCodeToHttpCode($e)
222 228
     {
223 229
         if($e->getCode() === 3)
@@ -369,6 +375,10 @@  discard block
 block discarded – undo
369 375
         return $response->withJson(array('success'=>true));
370 376
     }
371 377
 
378
+    /**
379
+     * @param Flipside\Data\Filter $filter
380
+     * @param boolean $pending
381
+     */
372 382
     protected function getAllUsersByFilter($filter, &$pending)
373 383
     {
374 384
         $auth = \Flipside\AuthProvider::getInstance();
Please login to merge, or discard this patch.
oauth2callback.php 1 patch
Switch Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -52,21 +52,21 @@  discard block
 block discarded – undo
52 52
 
53 53
 switch($src)
54 54
 {
55
-    case 'google':
56
-        doAuthByType('Flipside\Auth\GoogleAuthenticator', $src, $auth, $ref);
57
-        break;
58
-    case 'twitter':
59
-        $twitter = $auth->getMethodByName('Flipside\Auth\TwitterAuthenticator');
60
-        if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier']))
61
-        {
62
-            $twitter->redirect();
63
-            die();
64
-        }
65
-        else
66
-        {
67
-            $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user);
68
-            switch($res)
55
+        case 'google':
56
+            doAuthByType('Flipside\Auth\GoogleAuthenticator', $src, $auth, $ref);
57
+            break;
58
+        case 'twitter':
59
+            $twitter = $auth->getMethodByName('Flipside\Auth\TwitterAuthenticator');
60
+            if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier']))
61
+            {
62
+                $twitter->redirect();
63
+                die();
64
+            }
65
+            else
69 66
             {
67
+                $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user);
68
+                switch($res)
69
+                {
70 70
                 case \Auth\Authenticator::SUCCESS:
71 71
                     header('Location: '.$ref);
72 72
                     die();
@@ -77,15 +77,15 @@  discard block
 block discarded – undo
77 77
                 case \Auth\Authenticator::ALREADY_PRESENT:
78 78
                     header('Location: user_exists.php?src=twitter&uid='.$current_user->uid);
79 79
                     die();
80
-            }
80
+                }
81 81
         }
82 82
         break;
83
-    case 'gitlab':
84
-        doAuthByType('Flipside\Auth\OAuth2\GitLabAuthenticator', $src, $auth, $ref);
85
-        break;
86
-        //Generic OAuth...
87
-    default:
88
-        print_r($_SERVER);
89
-        break;
83
+        case 'gitlab':
84
+            doAuthByType('Flipside\Auth\OAuth2\GitLabAuthenticator', $src, $auth, $ref);
85
+            break;
86
+            //Generic OAuth...
87
+        default:
88
+            print_r($_SERVER);
89
+            break;
90 90
 }
91 91
 /* vim: set tabstop=4 shiftwidth=4 expandtab: */
Please login to merge, or discard this patch.
Autoload.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,26 +8,26 @@  discard block
 block discarded – undo
8 8
 * @copyright Copyright (c) 2015, Austin Artistic Reconstruction
9 9
 * @license http://www.apache.org/licenses/ Apache 2.0 License
10 10
  */
11
-if(file_exists(__DIR__ . '/vendor/autoload.php'))
11
+if(file_exists(__DIR__.'/vendor/autoload.php'))
12 12
 {
13
-    require(__DIR__ . '/vendor/autoload.php');
13
+    require(__DIR__.'/vendor/autoload.php');
14 14
 }
15
-else if(file_exists(__DIR__ . '/../common/Autoload.php'))
15
+else if(file_exists(__DIR__.'/../common/Autoload.php'))
16 16
 {
17
-    require(__DIR__ . '/../common/Autoload.php');
17
+    require(__DIR__.'/../common/Autoload.php');
18 18
 }
19 19
 
20
-spl_autoload_register(function ($class) {
20
+spl_autoload_register(function($class) {
21 21
 
22 22
     // project-specific namespace prefix
23 23
     $prefix = 'Flipside\\Profiles\\';
24 24
 
25 25
     // base directory for the namespace prefix
26
-    $base_dir = __DIR__ . '/';
26
+    $base_dir = __DIR__.'/';
27 27
 
28 28
     // does the class use the namespace prefix?
29 29
     $len = strlen($prefix);
30
-    if (strncmp($prefix, $class, $len) !== 0) {
30
+    if(strncmp($prefix, $class, $len) !== 0) {
31 31
         // no, move to the next registered autoloader
32 32
         return;
33 33
     }
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
     // replace the namespace prefix with the base directory, replace namespace
39 39
     // separators with directory separators in the relative class name, append
40 40
     // with .php
41
-    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
41
+    $file = $base_dir.str_replace('\\', '/', $relative_class).'.php';
42 42
 
43 43
     // if the file exists, require it
44
-    if (file_exists($file)) {
44
+    if(file_exists($file)) {
45 45
         require $file;
46 46
     }
47 47
 });
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,8 @@  discard block
 block discarded – undo
17 17
     require(__DIR__ . '/../common/Autoload.php');
18 18
 }
19 19
 
20
-spl_autoload_register(function ($class) {
20
+spl_autoload_register(function ($class)
21
+{
21 22
 
22 23
     // project-specific namespace prefix
23 24
     $prefix = 'Flipside\\Profiles\\';
@@ -27,7 +28,8 @@  discard block
 block discarded – undo
27 28
 
28 29
     // does the class use the namespace prefix?
29 30
     $len = strlen($prefix);
30
-    if (strncmp($prefix, $class, $len) !== 0) {
31
+    if (strncmp($prefix, $class, $len) !== 0)
32
+    {
31 33
         // no, move to the next registered autoloader
32 34
         return;
33 35
     }
@@ -41,7 +43,8 @@  discard block
 block discarded – undo
41 43
     $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
42 44
 
43 45
     // if the file exists, require it
44
-    if (file_exists($file)) {
46
+    if (file_exists($file))
47
+    {
45 48
         require $file;
46 49
     }
47 50
 });
Please login to merge, or discard this patch.
api/v1/class.FlipsideProfileEmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once(__DIR__ . '/../../Autoload.php');
2
+require_once(__DIR__.'/../../Autoload.php');
3 3
 
4 4
 class FlipsideProfileEmail extends \Flipside\Email\Email
5 5
 {
Please login to merge, or discard this patch.
api/v1/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 ini_set('display_errors', 1);
3 3
 error_reporting(E_ALL);
4 4
 
5
-require(__DIR__ . '/../../Autoload.php');
5
+require(__DIR__.'/../../Autoload.php');
6 6
 require('class.ProfilesAdminAPI.php');
7 7
 require('class.ProfilesAdminDataAPI.php');
8 8
 require('class.AreasAPI.php');
Please login to merge, or discard this patch.