From e866e564c260d72ff9201609107e77e02ba98472 Mon Sep 17 00:00:00 2001 From: opensaucesystems Date: Thu, 23 May 2013 16:57:22 +0200 Subject: [PATCH 1/4] Enable https authentication --- apps/user_webdavauth/user_webdavauth.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/user_webdavauth/user_webdavauth.php b/apps/user_webdavauth/user_webdavauth.php index 6417e45434..8f4c11d0f0 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; } From 169eb100301269e96a5c0d0f4d1e0e966ab3ed52 Mon Sep 17 00:00:00 2001 From: opensaucesystems Date: Thu, 23 May 2013 17:22:05 +0200 Subject: [PATCH 2/4] Enable https authentication Allow authentication using https:// as well as http:// --- apps/user_webdavauth/user_webdavauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/user_webdavauth/user_webdavauth.php b/apps/user_webdavauth/user_webdavauth.php index 8f4c11d0f0..146034a5d4 100755 --- a/apps/user_webdavauth/user_webdavauth.php +++ b/apps/user_webdavauth/user_webdavauth.php @@ -42,7 +42,7 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend { public function checkPassword( $uid, $password ) { $arr = explode('://', $this->webdavauth_url, 2); - if( ! isset($arr) && count($arr) !== 2) { + if( ! isset($arr) OR count($arr) !== 2) { OC_Log::write('OC_USER_WEBDAVAUTH', 'Invalid Url: "'.$this->webdavauth_url.'" ', 3); return false; } From b23ce9ed404bd47b09636dad843843cb2d10b79c Mon Sep 17 00:00:00 2001 From: opensaucesystems Date: Thu, 23 May 2013 17:24:48 +0200 Subject: [PATCH 3/4] Remove http:// from label and add placeholder --- apps/user_webdavauth/templates/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/user_webdavauth/templates/settings.php b/apps/user_webdavauth/templates/settings.php index ec6524ee4f..e3a84a2119 100755 --- a/apps/user_webdavauth/templates/settings.php +++ b/apps/user_webdavauth/templates/settings.php @@ -1,7 +1,7 @@
t('WebDAV Authentication'));?> -

+


t('ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials.')); ?> From acba7d7b13be102031717f9fa06ced918c916301 Mon Sep 17 00:00:00 2001 From: opensaucesystems Date: Thu, 23 May 2013 17:27:22 +0200 Subject: [PATCH 4/4] Update settings.php --- apps/user_webdavauth/templates/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/user_webdavauth/templates/settings.php b/apps/user_webdavauth/templates/settings.php index e3a84a2119..e199c32675 100755 --- a/apps/user_webdavauth/templates/settings.php +++ b/apps/user_webdavauth/templates/settings.php @@ -1,7 +1,7 @@

t('WebDAV Authentication'));?> -

+


t('ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials.')); ?>