@@ -104,7 +104,7 @@ |
||
| 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++) |
@@ -18,7 +18,7 @@ |
||
| 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 | |
@@ -36,21 +36,21 @@ |
||
| 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/> |
@@ -18,17 +18,17 @@ |
||
| 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(); |
@@ -38,6 +38,9 @@ discard block |
||
| 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 |
||
| 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,9 @@ discard block |
||
| 369 | 375 | return $response->withJson(array('success'=>true)); |
| 370 | 376 | } |
| 371 | 377 | |
| 378 | + /** |
|
| 379 | + * @param boolean $pending |
|
| 380 | + */ |
|
| 372 | 381 | protected function getAllUsersByFilter($filter, &$pending) |
| 373 | 382 | { |
| 374 | 383 | $auth = \Flipside\AuthProvider::getInstance(); |
@@ -33,7 +33,7 @@ |
||
| 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 | } |
@@ -32,12 +32,12 @@ |
||
| 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 | { |
@@ -52,21 +52,21 @@ discard block |
||
| 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 |
||
| 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: */ |
@@ -8,26 +8,26 @@ discard block |
||
| 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 |
||
| 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 | }); |
@@ -17,7 +17,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | }); |