diff options
author | tailor <cygnus@janrain.com> | 2006-12-01 20:08:53 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-12-01 20:08:53 +0000 |
commit | 73d8f848914c49f6c0013a0e2286e08fe8badce9 (patch) | |
tree | 189a28673cd627ed9fc55a97cba9ef5bc75d5701 /examples/consumer/try_auth.php | |
parent | d840af3155774de712cdd259618aefe2904cb0d4 (diff) | |
download | php-openid-73d8f848914c49f6c0013a0e2286e08fe8badce9.zip php-openid-73d8f848914c49f6c0013a0e2286e08fe8badce9.tar.gz php-openid-73d8f848914c49f6c0013a0e2286e08fe8badce9.tar.bz2 |
[project @ Fix example consumer so it works in https mode, too]
Diffstat (limited to 'examples/consumer/try_auth.php')
-rw-r--r-- | examples/consumer/try_auth.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/consumer/try_auth.php b/examples/consumer/try_auth.php index c5f7ef5..464dd1f 100644 --- a/examples/consumer/try_auth.php +++ b/examples/consumer/try_auth.php @@ -11,12 +11,17 @@ if (empty($_GET['openid_url'])) { exit(0); } +$scheme = 'http'; +if (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') { + $scheme .= 's'; +} + $openid = $_GET['openid_url']; -$process_url = sprintf("http://%s:%s%s/finish_auth.php", +$process_url = sprintf("$scheme://%s:%s%s/finish_auth.php", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], dirname($_SERVER['PHP_SELF'])); -$trust_root = sprintf("http://%s:%s%s", +$trust_root = sprintf("$scheme://%s:%s%s", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], dirname($_SERVER['PHP_SELF'])); |