diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-12-15 20:07:48 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-12-15 20:07:48 -0500 |
commit | 580cd62f0a4fac5dba37a8a152afaecd99e8c767 (patch) | |
tree | ad71f414174ffe91536ecb9875377ce2682b53fc /models/openid-php-openid-782224d/examples/server/lib/render | |
parent | d9bf22a0e29c2a70049443a0ae8521a2c0492c8b (diff) | |
download | elgg-580cd62f0a4fac5dba37a8a152afaecd99e8c767.tar.gz elgg-580cd62f0a4fac5dba37a8a152afaecd99e8c767.tar.bz2 |
removed old libraries - depends on openid_api now
Diffstat (limited to 'models/openid-php-openid-782224d/examples/server/lib/render')
6 files changed, 0 insertions, 265 deletions
diff --git a/models/openid-php-openid-782224d/examples/server/lib/render/about.php b/models/openid-php-openid-782224d/examples/server/lib/render/about.php deleted file mode 100644 index 53e3694e9..000000000 --- a/models/openid-php-openid-782224d/examples/server/lib/render/about.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -require_once "lib/session.php"; -require_once "lib/render.php"; - -define('about_error_template', - '<div class="error"> -An error occurred when processing your request: -<br /> -%s -</div>'); - -define('about_body', - '<p> - This is an <a href="http://www.openid.net/">OpenID</a> server - endpoint. This server is built on the <a - href="http://github.com/openid/php-openid">JanRain PHP OpenID - library</a>. Since OpenID consumer sites will need to directly contact this - server, it must be accessible over the Internet (not behind a firewall). -</p> -<p> - To use this server, you will have to set up a URL to use as an identifier. - Insert the following markup into the <code><head></code> of the HTML - document at that URL: -</p> -<pre><link rel="openid.server" href="%s" /></pre> -<p> - Then configure this server so that you can log in with that URL. -</p> -'); - -/** - * Render the about page, potentially with an error message - */ -function about_render($error=false, $internal=true) -{ - $headers = array(); - $body = sprintf(about_body, buildURL()); - if ($error) { - $headers[] = $internal ? http_internal_error : http_bad_request; - $body .= sprintf(about_error_template, htmlspecialchars($error)); - } - $current_user = getLoggedInUser(); - return page_render($body, $current_user, 'OpenID Server Endpoint'); -} - -?>
\ No newline at end of file diff --git a/models/openid-php-openid-782224d/examples/server/lib/render/idpXrds.php b/models/openid-php-openid-782224d/examples/server/lib/render/idpXrds.php deleted file mode 100644 index 6e4ae1ce7..000000000 --- a/models/openid-php-openid-782224d/examples/server/lib/render/idpXrds.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -require_once "lib/session.php"; -require_once "lib/render.php"; - -require_once "Auth/OpenID/Discover.php"; - -define('idp_xrds_pat', '<?xml version="1.0" encoding="UTF-8"?> -<xrds:XRDS - xmlns:xrds="xri://$xrds" - xmlns="xri://$xrd*($v*2.0)"> - <XRD> - <Service priority="0"> - <Type>%s</Type> - <URI>%s</URI> - </Service> - </XRD> -</xrds:XRDS> -'); - -function idpXrds_render() -{ - $headers = array('Content-type: application/xrds+xml'); - - $body = sprintf(idp_xrds_pat, - Auth_OpenID_TYPE_2_0_IDP, - buildURL()); - - return array($headers, $body); -} - -?>
\ No newline at end of file diff --git a/models/openid-php-openid-782224d/examples/server/lib/render/idpage.php b/models/openid-php-openid-782224d/examples/server/lib/render/idpage.php deleted file mode 100644 index 48c2486df..000000000 --- a/models/openid-php-openid-782224d/examples/server/lib/render/idpage.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -require_once "lib/session.php"; -require_once "lib/render.php"; - -define('idpage_pat', - '<html> -<head> - <link rel="openid2.provider openid.server" href="%s"/> - <meta http-equiv="X-XRDS-Location" content="%s" /> -</head> -<body> - This is the identity page for users of this server. -</body> -</html>'); - -function idpage_render($identity) -{ - $xrdsurl = buildURL('userXrds')."?user=".urlencode($identity); - - $headers = array( - 'X-XRDS-Location: '.$xrdsurl); - - - $body = sprintf(idpage_pat, - buildURL(), - $xrdsurl); - return array($headers, $body); -} - -?> diff --git a/models/openid-php-openid-782224d/examples/server/lib/render/login.php b/models/openid-php-openid-782224d/examples/server/lib/render/login.php deleted file mode 100644 index 986a88545..000000000 --- a/models/openid-php-openid-782224d/examples/server/lib/render/login.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -require_once "lib/session.php"; -require_once "lib/render.php"; - -define('login_form_pat', - '<div class="form"> - <p> - - Enter your username into this form to log in to this server. It - can be anything; this is just for demonstration purposes. For - example, entering USERNAME will give you the identity URL - - <pre>%s</pre> - </p> - - <form method="post" action="%s"> - <table> - <tr> - <th><label for="openid_url">Name:</label></th> - <td><input type="text" name="openid_url" - value="%s" id="openid_url" /></td> - </tr> - <tr> - <td colspan="2"> - <input type="submit" value="Log in" /> - <input type="submit" name="cancel" value="Cancel" /> - </td> - </tr> - </table> - </form> -</div> -'); - -define('login_needed_pat', - 'You must be logged in as %s to approve this request.'); - -function login_render($errors=null, $input=null, $needed=null) -{ - $current_user = getLoggedInUser(); - if ($input === null) { - $input = $current_user; - } - if ($needed) { - $errors[] = sprintf(login_needed_pat, link_render($needed)); - } - - $esc_input = htmlspecialchars($input, ENT_QUOTES); - $login_url = buildURL('login', true); - $body = sprintf(login_form_pat, idURL('USERNAME'), $login_url, $esc_input); - if ($errors) { - $body = loginError_render($errors) . $body; - } - return page_render($body, $current_user, 'Log In', null, true); -} - -function loginError_render($errors) -{ - $text = ''; - foreach ($errors as $error) { - $text .= sprintf("<li>%s</li>\n", $error); - } - return sprintf("<ul class=\"error\">\n%s</ul>\n", $text); -} -?>
\ No newline at end of file diff --git a/models/openid-php-openid-782224d/examples/server/lib/render/trust.php b/models/openid-php-openid-782224d/examples/server/lib/render/trust.php deleted file mode 100644 index 681d4560a..000000000 --- a/models/openid-php-openid-782224d/examples/server/lib/render/trust.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -require_once "lib/session.php"; -require_once "lib/render.php"; - -define('trust_form_pat', - '<div class="form"> - <form method="post" action="%s"> - %s - <input type="submit" name="trust" value="Confirm" /> - <input type="submit" value="Do not confirm" /> - </form> -</div> -'); - -define('normal_pat', - '<p>Do you wish to confirm your identity ' . - '(<code>%s</code>) with <code>%s</code>?</p>'); - -define('id_select_pat', - '<p>You entered the server URL at the RP. -Please choose the name you wish to use. If you enter nothing, the request will be cancelled.<br/> -<input type="text" name="idSelect" /></p> -'); - -define('no_id_pat', -' -You did not send an identifier with the request, -and it was not an identifier selection request. -Please return to the relying party and try again. -'); - -function trust_render($info) -{ - $current_user = getLoggedInUser(); - $lnk = link_render(idURL($current_user)); - $trust_root = htmlspecialchars($info->trust_root); - $trust_url = buildURL('trust', true); - - if ($info->idSelect()) { - $prompt = id_select_pat; - } else { - $prompt = sprintf(normal_pat, $lnk, $trust_root); - } - - $form = sprintf(trust_form_pat, $trust_url, $prompt); - - return page_render($form, $current_user, 'Trust This Site'); -} - -function noIdentifier_render() -{ - return page_render(no_id_pat, null, 'No Identifier Sent'); -} - -?>
\ No newline at end of file diff --git a/models/openid-php-openid-782224d/examples/server/lib/render/userXrds.php b/models/openid-php-openid-782224d/examples/server/lib/render/userXrds.php deleted file mode 100644 index a9ea95ea3..000000000 --- a/models/openid-php-openid-782224d/examples/server/lib/render/userXrds.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -require_once "lib/session.php"; -require_once "lib/render.php"; - -require_once "Auth/OpenID/Discover.php"; - -define('user_xrds_pat', '<?xml version="1.0" encoding="UTF-8"?> -<xrds:XRDS - xmlns:xrds="xri://$xrds" - xmlns="xri://$xrd*($v*2.0)"> - <XRD> - <Service priority="0"> - <Type>%s</Type> - <Type>%s</Type> - <URI>%s</URI> - </Service> - </XRD> -</xrds:XRDS> -'); - -function userXrds_render($identity) -{ - $headers = array('Content-type: application/xrds+xml'); - - $body = sprintf(user_xrds_pat, - Auth_OpenID_TYPE_2_0, - Auth_OpenID_TYPE_1_1, - buildURL()); - - return array($headers, $body); -} - -?>
\ No newline at end of file |