@@ -49,6 +49,9 @@ |
||
| 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)) |
@@ -45,7 +45,7 @@ |
||
| 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 | |
@@ -52,6 +52,9 @@ discard block |
||
| 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 |
||
| 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(); |
@@ -47,7 +47,7 @@ |
||
| 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 | } |
@@ -43,7 +43,7 @@ |
||
| 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); |
@@ -24,18 +24,18 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |