diff options
author | tailor <cygnus@janrain.com> | 2007-03-19 18:17:37 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2007-03-19 18:17:37 +0000 |
commit | 0e7262c6e711b9cf17f84bc75bfbb73b2a1168a9 (patch) | |
tree | 5477fa1f708662a6f132f60199c10c67a38260bf /examples/server/lib/session.php | |
parent | 874031d1e516c1061c0355819205d4ece65c3dd1 (diff) | |
download | php-openid-0e7262c6e711b9cf17f84bc75bfbb73b2a1168a9.zip php-openid-0e7262c6e711b9cf17f84bc75bfbb73b2a1168a9.tar.gz php-openid-0e7262c6e711b9cf17f84bc75bfbb73b2a1168a9.tar.bz2 |
[project @ Update example server to accept arbitrary logins (to make it easier to use and configure)]
Diffstat (limited to 'examples/server/lib/session.php')
-rw-r--r-- | examples/server/lib/session.php | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/examples/server/lib/session.php b/examples/server/lib/session.php index e11fd64..1a51d79 100644 --- a/examples/server/lib/session.php +++ b/examples/server/lib/session.php @@ -82,7 +82,8 @@ function getServer() { static $server = null; if (!isset($server)) { - $server =& new Auth_OpenID_Server(getOpenIDStore()); + $server =& new Auth_OpenID_Server(getOpenIDStore(), + getServerURL()); } return $server; } @@ -116,19 +117,6 @@ function hashPassword($password) } /** - * Check the user's login information - */ -function checkLogin($openid_url, $password) -{ - // from config.php - global $openid_users; - $hash = hashPassword($password); - - return isset($openid_users[$openid_url]) - && $hash == $openid_users[$openid_url]; -} - -/** * Get the openid_url out of the cookie * * @return mixed $openid_url The URL that was stored in the cookie or @@ -202,4 +190,25 @@ function getSreg($identity) } +function idURL($identity) +{ + return buildURL('idpage') . "?user=" . $identity; +} + +function idFromURL($url) +{ + if (strpos($url, 'idpage') === false) { + return null; + } + + $parsed = parse_url($url); + + $q = $parsed['query']; + + $parts = array(); + parse_str($q, $parts); + + return @$parts['user']; +} + ?>
\ No newline at end of file |