summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-04 18:49:29 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-04 18:49:29 +0200
commit60a7a9d6f0c65f81edd7d1bf54a55a48538e6f77 (patch)
tree33001b048805cf660c0582b5437358797f9718b6 /apps
parent12cc7c77bae8fdd5b15c2cb2fa13f5e09fbf87a1 (diff)
downloadnextcloud-server-60a7a9d6f0c65f81edd7d1bf54a55a48538e6f77.tar.gz
nextcloud-server-60a7a9d6f0c65f81edd7d1bf54a55a48538e6f77.zip
allow users to use myhost/owncloud/?myusername as openid identity
Diffstat (limited to 'apps')
-rw-r--r--apps/user_openid/appinfo/app.php14
-rw-r--r--apps/user_openid/phpmyid.php10
2 files changed, 17 insertions, 7 deletions
diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php
index 74c13402caf..f2d5313c7e0 100644
--- a/apps/user_openid/appinfo/app.php
+++ b/apps/user_openid/appinfo/app.php
@@ -6,8 +6,18 @@ if (!in_array ('curl', get_loaded_extensions())){
}
$urlBase=((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'];
-OC_Util::addHeader('link',array('rel'=>'openid.server', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'));
-OC_Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'));
+
+$userName='';
+if(strpos($_SERVER["REQUEST_URI"],'?') and !strpos($_SERVER["REQUEST_URI"],'=')){
+ if(strpos($_SERVER["REQUEST_URI"],'/?')){
+ $userName=substr($_SERVER["REQUEST_URI"],strpos($_SERVER["REQUEST_URI"],'/?')+2);
+ }elseif(strpos($_SERVER["REQUEST_URI"],'.php?')){
+ $userName=substr($_SERVER["REQUEST_URI"],strpos($_SERVER["REQUEST_URI"],'.php?')+5);
+ }
+}
+
+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));
require_once 'apps/user_openid/user_openid.php';
diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php
index bcab9e55cbb..24fab44ca7a 100644
--- a/apps/user_openid/phpmyid.php
+++ b/apps/user_openid/phpmyid.php
@@ -1646,12 +1646,12 @@ $profile['req_url'] = sprintf("%s://%s%s",
// $port,//host already includes the path
$_SERVER["REQUEST_URI"]);
-$fullId='user.php/'.$USERNAME.'/';
-$incompleteId='user.php/';
+// $fullId='user.php/'.$USERNAME.'/';
+// $incompleteId='user.php/';
-if(!strpos($profile['req_url'],$fullId)){
- $profile['req_url']=str_replace($incompleteId,$fullId,$profile['req_url']);
-}
+// if(!strpos($profile['req_url'],$fullId)){
+// $profile['req_url']=str_replace($incompleteId,$fullId,$profile['req_url']);
+// }
// error_log('inc id: '.$fullId);
// error_log('req url: '.$profile['req_url']);