@@ -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++) |
@@ -51,21 +51,21 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | switch($src) |
| 53 | 53 | { |
| 54 | - case 'google': |
|
| 55 | - doAuthByType('Auth\GoogleAuthenticator', $src); |
|
| 56 | - break; |
|
| 57 | - case 'twitter': |
|
| 58 | - $twitter = $auth->getMethodByName('Auth\TwitterAuthenticator'); |
|
| 59 | - if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier'])) |
|
| 60 | - { |
|
| 61 | - $twitter->redirect(); |
|
| 62 | - die(); |
|
| 63 | - } |
|
| 64 | - else |
|
| 65 | - { |
|
| 66 | - $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user); |
|
| 67 | - switch($res) |
|
| 54 | + case 'google': |
|
| 55 | + doAuthByType('Auth\GoogleAuthenticator', $src); |
|
| 56 | + break; |
|
| 57 | + case 'twitter': |
|
| 58 | + $twitter = $auth->getMethodByName('Auth\TwitterAuthenticator'); |
|
| 59 | + if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier'])) |
|
| 60 | + { |
|
| 61 | + $twitter->redirect(); |
|
| 62 | + die(); |
|
| 63 | + } |
|
| 64 | + else |
|
| 68 | 65 | { |
| 66 | + $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user); |
|
| 67 | + switch($res) |
|
| 68 | + { |
|
| 69 | 69 | case \Auth\Authenticator::SUCCESS: |
| 70 | 70 | header('Location: '.$ref); |
| 71 | 71 | die(); |
@@ -76,15 +76,15 @@ discard block |
||
| 76 | 76 | case \Auth\Authenticator::ALREADY_PRESENT: |
| 77 | 77 | header('Location: user_exists.php?src=twitter&uid='.$current_user->uid); |
| 78 | 78 | die(); |
| 79 | - } |
|
| 79 | + } |
|
| 80 | 80 | } |
| 81 | 81 | break; |
| 82 | - case 'gitlab': |
|
| 83 | - doAuthByType('Auth\OAuth2\GitLabAuthenticator', $src); |
|
| 84 | - break; |
|
| 85 | - //Generic OAuth... |
|
| 86 | - default: |
|
| 87 | - print_r($_SERVER); |
|
| 88 | - break; |
|
| 82 | + case 'gitlab': |
|
| 83 | + doAuthByType('Auth\OAuth2\GitLabAuthenticator', $src); |
|
| 84 | + break; |
|
| 85 | + //Generic OAuth... |
|
| 86 | + default: |
|
| 87 | + print_r($_SERVER); |
|
| 88 | + break; |
|
| 89 | 89 | } |
| 90 | 90 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |