summaryrefslogtreecommitdiffstats
path: root/apps/user_webdavauth/user_webdavauth.php
diff options
context:
space:
mode:
authoropensaucesystems <ashley@opensaucesystems.com>2013-05-23 16:57:22 +0200
committeropensaucesystems <ashley@opensaucesystems.com>2013-05-23 16:57:22 +0200
commite866e564c260d72ff9201609107e77e02ba98472 (patch)
tree72212fa67f454b36d1d7e3be415717e4ed42f766 /apps/user_webdavauth/user_webdavauth.php
parent698862519de6b364da6c20a97d8c546204e80f3d (diff)
downloadnextcloud-server-e866e564c260d72ff9201609107e77e02ba98472.tar.gz
nextcloud-server-e866e564c260d72ff9201609107e77e02ba98472.zip
Enable https authentication
Diffstat (limited to 'apps/user_webdavauth/user_webdavauth.php')
-rwxr-xr-xapps/user_webdavauth/user_webdavauth.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/user_webdavauth/user_webdavauth.php b/apps/user_webdavauth/user_webdavauth.php
index 6417e45434d..8f4c11d0f0a 100755
--- a/apps/user_webdavauth/user_webdavauth.php
+++ b/apps/user_webdavauth/user_webdavauth.php
@@ -41,10 +41,16 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
}
public function checkPassword( $uid, $password ) {
- $url= 'http://'.urlencode($uid).':'.urlencode($password).'@'.$this->webdavauth_url;
+ $arr = explode('://', $this->webdavauth_url, 2);
+ if( ! isset($arr) && count($arr) !== 2) {
+ OC_Log::write('OC_USER_WEBDAVAUTH', 'Invalid Url: "'.$this->webdavauth_url.'" ', 3);
+ return false;
+ }
+ list($webdavauth_protocol, $webdavauth_url_path) = $arr;
+ $url= $webdavauth_protocol.'://'.urlencode($uid).':'.urlencode($password).'@'.$webdavauth_url_path;
$headers = get_headers($url);
if($headers==false) {
- OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to connect to WebDAV Url: "'.$this->webdavauth_url.'" ', 3);
+ OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to connect to WebDAV Url: "'.$webdavauth_protocol.'://'.$webdavauth_url_path.'" ', 3);
return false;
}