From 580cd62f0a4fac5dba37a8a152afaecd99e8c767 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 15 Dec 2011 20:07:48 -0500 Subject: removed old libraries - depends on openid_api now --- .../examples/consumer/common.php | 97 --------------------- .../examples/consumer/finish_auth.php | 98 ---------------------- .../examples/consumer/index.php | 73 ---------------- .../examples/consumer/try_auth.php | 83 ------------------ 4 files changed, 351 deletions(-) delete mode 100644 models/openid-php-openid-782224d/examples/consumer/common.php delete mode 100644 models/openid-php-openid-782224d/examples/consumer/finish_auth.php delete mode 100644 models/openid-php-openid-782224d/examples/consumer/index.php delete mode 100644 models/openid-php-openid-782224d/examples/consumer/try_auth.php (limited to 'models/openid-php-openid-782224d/examples/consumer') diff --git a/models/openid-php-openid-782224d/examples/consumer/common.php b/models/openid-php-openid-782224d/examples/consumer/common.php deleted file mode 100644 index 2f01ba0a6..000000000 --- a/models/openid-php-openid-782224d/examples/consumer/common.php +++ /dev/null @@ -1,97 +0,0 @@ - \ No newline at end of file diff --git a/models/openid-php-openid-782224d/examples/consumer/finish_auth.php b/models/openid-php-openid-782224d/examples/consumer/finish_auth.php deleted file mode 100644 index b19a665cf..000000000 --- a/models/openid-php-openid-782224d/examples/consumer/finish_auth.php +++ /dev/null @@ -1,98 +0,0 @@ -complete($return_to); - - // Check the response status. - if ($response->status == Auth_OpenID_CANCEL) { - // This means the authentication was cancelled. - $msg = 'Verification cancelled.'; - } else if ($response->status == Auth_OpenID_FAILURE) { - // Authentication failed; display the error message. - $msg = "OpenID authentication failed: " . $response->message; - } else if ($response->status == Auth_OpenID_SUCCESS) { - // This means the authentication succeeded; extract the - // identity URL and Simple Registration data (if it was - // returned). - $openid = $response->getDisplayIdentifier(); - $esc_identity = escape($openid); - - $success = sprintf('You have successfully verified ' . - '%s as your identity.', - $esc_identity, $esc_identity); - - if ($response->endpoint->canonicalID) { - $escaped_canonicalID = escape($response->endpoint->canonicalID); - $success .= ' (XRI CanonicalID: '.$escaped_canonicalID.') '; - } - - $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response); - - $sreg = $sreg_resp->contents(); - - if (@$sreg['email']) { - $success .= " You also returned '".escape($sreg['email']). - "' as your email."; - } - - if (@$sreg['nickname']) { - $success .= " Your nickname is '".escape($sreg['nickname']). - "'."; - } - - if (@$sreg['fullname']) { - $success .= " Your fullname is '".escape($sreg['fullname']). - "'."; - } - - $pape_resp = Auth_OpenID_PAPE_Response::fromSuccessResponse($response); - - if ($pape_resp) { - if ($pape_resp->auth_policies) { - $success .= "

The following PAPE policies affected the authentication:

"; - } else { - $success .= "

No PAPE policies affected the authentication.

"; - } - - if ($pape_resp->auth_age) { - $age = escape($pape_resp->auth_age); - $success .= "

The authentication age returned by the " . - "server is: ".$age."

"; - } - - if ($pape_resp->nist_auth_level) { - $auth_level = escape($pape_resp->nist_auth_level); - $success .= "

The NIST auth level returned by the " . - "server is: ".$auth_level."

"; - } - - } else { - $success .= "

No PAPE response was sent by the provider.

"; - } - } - - include 'index.php'; -} - -run(); - -?> \ No newline at end of file diff --git a/models/openid-php-openid-782224d/examples/consumer/index.php b/models/openid-php-openid-782224d/examples/consumer/index.php deleted file mode 100644 index 1ff091125..000000000 --- a/models/openid-php-openid-782224d/examples/consumer/index.php +++ /dev/null @@ -1,73 +0,0 @@ - - - PHP OpenID Authentication Example - - -

PHP OpenID Authentication Example

-

- This example consumer uses the PHP - OpenID library. It just verifies that the URL that you enter - is your identity URL. -

- - $msg"; } ?> - $error"; } ?> - $success"; } ?> - -
-
- Identity URL: - - - -

Optionally, request these PAPE policies:

-

- $uri) { - print ""; - print "$uri
"; - } ?> -

- - -
-
- - diff --git a/models/openid-php-openid-782224d/examples/consumer/try_auth.php b/models/openid-php-openid-782224d/examples/consumer/try_auth.php deleted file mode 100644 index 7efec7657..000000000 --- a/models/openid-php-openid-782224d/examples/consumer/try_auth.php +++ /dev/null @@ -1,83 +0,0 @@ -begin($openid); - - // No auth request means we can't begin OpenID. - if (!$auth_request) { - displayError("Authentication error; not a valid OpenID."); - } - - $sreg_request = Auth_OpenID_SRegRequest::build( - // Required - array('nickname'), - // Optional - array('fullname', 'email')); - - if ($sreg_request) { - $auth_request->addExtension($sreg_request); - } - - $policy_uris = $_GET['policies']; - - $pape_request = new Auth_OpenID_PAPE_Request($policy_uris); - if ($pape_request) { - $auth_request->addExtension($pape_request); - } - - // Redirect the user to the OpenID server for authentication. - // Store the token for this authentication so we can verify the - // response. - - // For OpenID 1, send a redirect. For OpenID 2, use a Javascript - // form to send a POST request to the server. - if ($auth_request->shouldSendRedirect()) { - $redirect_url = $auth_request->redirectURL(getTrustRoot(), - getReturnTo()); - - // If the redirect URL can't be built, display an error - // message. - if (Auth_OpenID::isFailure($redirect_url)) { - displayError("Could not redirect to server: " . $redirect_url->message); - } else { - // Send redirect. - header("Location: ".$redirect_url); - } - } else { - // Generate form markup and render it. - $form_id = 'openid_message'; - $form_html = $auth_request->htmlMarkup(getTrustRoot(), getReturnTo(), - false, array('id' => $form_id)); - - // Display an error if the form markup couldn't be generated; - // otherwise, render the HTML. - if (Auth_OpenID::isFailure($form_html)) { - displayError("Could not redirect to server: " . $form_html->message); - } else { - print $form_html; - } - } -} - -run(); - -?> \ No newline at end of file -- cgit v1.2.3