Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. /**
  3. * @TODO
  4. * This is an example code.
  5. * Please write similar code using your mvc framework (if you are using any) and implement your own logic
  6. */
  7. require __DIR__ . "/../../lib/vendor/autoload.php";
  8. use Genetsis\Identity;
  9. try {
  10. Identity::init();
  11. } catch (Exception $e) {
  12. echo $e->getMessage() . "\n" . $e->getTraceAsString() ;
  13. die();
  14. }
  15. $error = $_GET['error'];
  16. $uid = $_GET['uid']; // this parameter is only provided in specific DruID flows
  17. $gohome = true;
  18. if (!$error) {
  19. $code = $_GET['code'];
  20. if (!Identity::isConnected() && (isset($code) || (trim($code) != ''))) {
  21. Identity::authorizeUser($code);
  22. }
  23. } else {
  24. if ('user_cancel' != $error) {
  25. $error_description = $_GET['error_description'];
  26. echo $error . " -> " . $error_description;
  27. $gohome = false;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement