diff options
Diffstat (limited to 'examples/consumer/common.php')
-rw-r--r-- | examples/consumer/common.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/consumer/common.php b/examples/consumer/common.php index c184467..ba287c6 100644 --- a/examples/consumer/common.php +++ b/examples/consumer/common.php @@ -59,4 +59,26 @@ function &getConsumer() { return new Auth_OpenID_Consumer($store); } +function getScheme() { + $scheme = 'http'; + if (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') { + $scheme .= 's'; + } + return $scheme; +} + +function getReturnTo() { + return sprintf("%s://%s:%s%s/finish_auth.php", + getScheme(), $_SERVER['SERVER_NAME'], + $_SERVER['SERVER_PORT'], + dirname($_SERVER['PHP_SELF'])); +} + +function getTrustRoot() { + return sprintf("%s://%s:%s%s/", + getScheme(), $_SERVER['SERVER_NAME'], + $_SERVER['SERVER_PORT'], + dirname($_SERVER['PHP_SELF'])); +} + ?>
\ No newline at end of file |