| Conditions | 5 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | function oauthCallback($request, $response, $args) |
||
|
|
|||
| 14 | { |
||
| 15 | $host = $args['host']; |
||
| 16 | $auth = AuthProvider::getInstance(); |
||
| 17 | $provider = $auth->getSuplementalProviderByHost($host); |
||
| 18 | if($provider === false) |
||
| 19 | { |
||
| 20 | return $response->withStatus(404); |
||
| 21 | } |
||
| 22 | $res = $provider->authenticate($app->request->get(), $currentUser); |
||
| 23 | switch($res) |
||
| 24 | { |
||
| 25 | case \Auth\Authenticator::SUCCESS: |
||
| 26 | $response = $response->withHeader('Location', '/'); |
||
| 27 | break; |
||
| 28 | default: |
||
| 29 | case \Auth\Authenticator::LOGIN_FAILED: |
||
| 30 | $response = $response->withHeader('Location', '/login.php?failed=1'); |
||
| 31 | break; |
||
| 32 | case \Auth\Authenticator::ALREADY_PRESENT: |
||
| 33 | $response = $response->withHeader('Location', '/user_exists.php?src='.$host.'&uid='.$currentUser->getUID()); |
||
| 34 | break; |
||
| 35 | } |
||
| 36 | return $response->withStatus(302); |
||
| 37 | } |
||
| 38 | |||
| 41 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.