aboutsummaryrefslogtreecommitdiff
path: root/models/openid-php-openid-782224d/examples/server/lib/common.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-12-15 20:07:48 -0500
committerCash Costello <cash.costello@gmail.com>2011-12-15 20:07:48 -0500
commit580cd62f0a4fac5dba37a8a152afaecd99e8c767 (patch)
treead71f414174ffe91536ecb9875377ce2682b53fc /models/openid-php-openid-782224d/examples/server/lib/common.php
parentd9bf22a0e29c2a70049443a0ae8521a2c0492c8b (diff)
downloadelgg-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/common.php')
-rw-r--r--models/openid-php-openid-782224d/examples/server/lib/common.php95
1 files changed, 0 insertions, 95 deletions
diff --git a/models/openid-php-openid-782224d/examples/server/lib/common.php b/models/openid-php-openid-782224d/examples/server/lib/common.php
deleted file mode 100644
index 80d05f51a..000000000
--- a/models/openid-php-openid-782224d/examples/server/lib/common.php
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-
-require_once "lib/render.php";
-require_once "lib/session.php";
-
-require_once "lib/render/login.php";
-require_once "lib/render/about.php";
-require_once "lib/render/trust.php";
-
-require_once "Auth/OpenID/Server.php";
-require_once "Auth/OpenID/SReg.php";
-
-function authCancel($info)
-{
- if ($info) {
- setRequestInfo();
- $url = $info->getCancelURL();
- } else {
- $url = getServerURL();
- }
- return redirect_render($url);
-}
-
-function doAuth($info, $trusted=null, $fail_cancels=false,
- $idpSelect=null)
-{
- if (!$info) {
- // There is no authentication information, so bail
- return authCancel(null);
- }
-
- if ($info->idSelect()) {
- if ($idpSelect) {
- $req_url = idURL($idpSelect);
- } else {
- $trusted = false;
- }
- } else {
- $req_url = $info->identity;
- }
-
- $user = getLoggedInUser();
- setRequestInfo($info);
-
- if ((!$info->idSelect()) && ($req_url != idURL($user))) {
- return login_render(array(), $req_url, $req_url);
- }
-
- $trust_root = $info->trust_root;
-
- if ($trusted) {
- setRequestInfo();
- $server =& getServer();
- $response =& $info->answer(true, null, $req_url);
-
- // Answer with some sample Simple Registration data.
- $sreg_data = array(
- 'fullname' => 'Example User',
- 'nickname' => 'example',
- 'dob' => '1970-01-01',
- 'email' => 'invalid@example.com',
- 'gender' => 'F',
- 'postcode' => '12345',
- 'country' => 'ES',
- 'language' => 'eu',
- 'timezone' => 'America/New_York');
-
- // Add the simple registration response values to the OpenID
- // response message.
- $sreg_request = Auth_OpenID_SRegRequest::fromOpenIDRequest(
- $info);
-
- $sreg_response = Auth_OpenID_SRegResponse::extractResponse(
- $sreg_request, $sreg_data);
-
- $sreg_response->toMessage($response->fields);
-
- // Generate a response to send to the user agent.
- $webresponse =& $server->encodeResponse($response);
-
- $new_headers = array();
-
- foreach ($webresponse->headers as $k => $v) {
- $new_headers[] = $k.": ".$v;
- }
-
- return array($new_headers, $webresponse->body);
- } elseif ($fail_cancels) {
- return authCancel($info);
- } else {
- return trust_render($info);
- }
-}
-
-?> \ No newline at end of file