]> source.dussan.org Git - nextcloud-server.git/commitdiff
Enable https authentication
authoropensaucesystems <ashley@opensaucesystems.com>
Thu, 23 May 2013 14:57:22 +0000 (16:57 +0200)
committeropensaucesystems <ashley@opensaucesystems.com>
Thu, 23 May 2013 14:57:22 +0000 (16:57 +0200)
apps/user_webdavauth/user_webdavauth.php

index 6417e45434dc4c3f23c1c12438f59a38a8001e76..8f4c11d0f0a480bd62de5ec5a53eeba6b4c3e565 100755 (executable)
@@ -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;
 
                }