diff options
Diffstat (limited to 'examples/consumer/finish_auth.php')
-rw-r--r-- | examples/consumer/finish_auth.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/consumer/finish_auth.php b/examples/consumer/finish_auth.php index d03a87f..83a2939 100644 --- a/examples/consumer/finish_auth.php +++ b/examples/consumer/finish_auth.php @@ -3,7 +3,8 @@ require_once "common.php"; session_start(); -// Retrieve the token from the session. +// Retrieve the token from the session so we can verify the server's +// response. $token = $_SESSION['openid_token']; // Complete the authentication process using the server's response. @@ -14,20 +15,19 @@ $openid = null; // React to the server's response. $info is the OpenID that was // tried. if ($status != Auth_OpenID_SUCCESS) { - print sprintf("Verification of %s failed.", $info); - exit(0); -} - -// The OpenID authentication either succeeded or was cancelled by the -// user. -if ($info) { - // This means the authentication succeeded. - $openid = $info; - print sprintf("You have successfully verified %s as your identity.", - $openid); + $msg = sprintf("Verification of %s failed.", $info); } else { - // Cancelled. - print 'Verification cancelled.'; + if ($info) { + // This means the authentication succeeded. + $openid = $info; + $success = sprintf("You have successfully verified %s as your identity.", + $openid); + } else { + // This means the authentication was ancelled. + $msg = 'Verification cancelled.'; + } } +include 'index.php'; + ?>
\ No newline at end of file |