summaryrefslogtreecommitdiffstats
path: root/apps/user_openid
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-09-09 20:51:53 +0200
committerBart Visscher <bartv@thisnet.nl>2011-09-09 22:19:15 +0200
commit760b47a62fe3a8bcf1f58da74ffdaefe33793f7e (patch)
tree587bacf51807c5a58d7c335cfb7c2644e2bd3615 /apps/user_openid
parent80f5942868d42bd6939c9242eca7213a3dc8c79d (diff)
downloadnextcloud-server-760b47a62fe3a8bcf1f58da74ffdaefe33793f7e.tar.gz
nextcloud-server-760b47a62fe3a8bcf1f58da74ffdaefe33793f7e.zip
Use OC_Helper::linkTo also for absolute urls.
One central place to check for https.
Diffstat (limited to 'apps/user_openid')
-rw-r--r--apps/user_openid/appinfo/app.php6
-rw-r--r--apps/user_openid/user.php2
2 files changed, 3 insertions, 5 deletions
diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php
index 3cdf2664e81..886265cd312 100644
--- a/apps/user_openid/appinfo/app.php
+++ b/apps/user_openid/appinfo/app.php
@@ -5,8 +5,6 @@ if (!in_array ('curl', get_loaded_extensions())){
return;
}
-$urlBase=((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'];
-
$userName='';
if(strpos($_SERVER["REQUEST_URI"],'?') and !strpos($_SERVER["REQUEST_URI"],'=')){
if(strpos($_SERVER["REQUEST_URI"],'/?')){
@@ -16,8 +14,8 @@ if(strpos($_SERVER["REQUEST_URI"],'?') and !strpos($_SERVER["REQUEST_URI"],'='))
}
}
-OC_Util::addHeader('link',array('rel'=>'openid.server', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'.$userName));
-OC_Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'.$userName));
+OC_Util::addHeader('link',array('rel'=>'openid.server', 'href'=>OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$userName));
+OC_Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$userName));
OC_APP::registerPersonal('user_openid','settings');
diff --git a/apps/user_openid/user.php b/apps/user_openid/user.php
index 3743d232b6d..52fa1047344 100644
--- a/apps/user_openid/user.php
+++ b/apps/user_openid/user.php
@@ -43,7 +43,7 @@ if(!OC_User::userExists($USERNAME)){
$USERNAME='';
}
global $WEBROOT;
-$IDENTITY=((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$WEBROOT.'/apps/user_openid/user.php/'.$USERNAME;
+$IDENTITY=OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$USERNAME;
require_once 'phpmyid.php';