]> source.dussan.org Git - nextcloud-server.git/commitdiff
backport fix for the user_webdavauth fix to stable45. approved master fix here: 6fba4...
authorFrank Karlitschek <frank@owncloud.org>
Thu, 8 Nov 2012 12:53:12 +0000 (13:53 +0100)
committerFrank Karlitschek <frank@owncloud.org>
Thu, 8 Nov 2012 12:53:12 +0000 (13:53 +0100)
apps/user_webdavauth/appinfo/app.php
apps/user_webdavauth/appinfo/info.xml
apps/user_webdavauth/templates/settings.php
apps/user_webdavauth/user_webdavauth.php

index 3ab323becce5360372cfd026f2c34255ad2e6603..c4c131b7ef0205001588f76ffd6046bf13c21034 100755 (executable)
@@ -23,7 +23,7 @@
 
 require_once 'apps/user_webdavauth/user_webdavauth.php';
 
-OC_APP::registerAdmin('user_webdavauth','settings');
+OC_APP::registerAdmin('user_webdavauth', 'settings');
 
 OC_User::registerBackend("WEBDAVAUTH");
 OC_User::useBackend( "WEBDAVAUTH" );
index 9a8027daee68748ce35375775b9cfa81d1c53691..0d9f529ed1b63ef62e5d2ae3122891af7022c2fd 100755 (executable)
@@ -2,10 +2,12 @@
 <info>
        <id>user_webdavauth</id>
        <name>WebDAV user backend</name>
-       <description>Authenticate Users by a WebDAV call</description>
-       <version>1.0</version>
+       <description>Authenticate users by a WebDAV call. You can use any WebDAV server, ownCloud server or other webserver to authenticate. It should return http 200 for right credentials and http 401 for wrong ones.</description>
        <licence>AGPL</licence>
        <author>Frank Karlitschek</author>
        <require>4.9</require>
        <shipped>true</shipped>
+       <types>
+               <authentication/>
+       </types>
 </info>
index c00c199632af5c8979017f28ef3c5db92c7baf75..e6ca5d97d3c29d15987bf8e3da90426890174016 100755 (executable)
@@ -1,7 +1,7 @@
 <form id="webdavauth" action="#" method="post">
        <fieldset class="personalblock">
                <legend><strong>WebDAV Authentication</strong></legend>
-               <p><label for="webdav_url"><?php echo $l->t('webdav_url');?><input type="text" id="webdav_url" name="webdav_url" value="<?php echo $_['webdav_url']; ?>"></label>
+               <p><label for="webdav_url"><?php echo $l->t('WebDAV URL: http://');?><input type="text" id="webdav_url" name="webdav_url" value="<?php echo $_['webdav_url']; ?>"></label>
                <input type="submit" value="Save" />
        </fieldset>
 </form>
index c36d37c1fa2ef892aa77e82f8a7513e04add3703..0b0be7c2fa1a9b42d31193094b984cba9fb9e937 100755 (executable)
@@ -30,37 +30,36 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
 
        public function createUser() {
                // Can't create user
-               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend',3);
+               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend', 3);
                return false;
        }
 
-       public function deleteUser() {
+       public function deleteUser($uid) {
                // Can't delete user
-               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend',3);
+               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend', 3);
                return false;
        }
 
        public function setPassword ( $uid, $password ) {
                // We can't change user password
-               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend',3);
+               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend', 3);
                return false;
        }
 
        public function checkPassword( $uid, $password ) {
-
                $url= 'http://'.urlencode($uid).':'.urlencode($password).'@'.$this->webdavauth_url;
                $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: "'.$this->webdavauth_url.'" '3);
                        return false;
 
                }
                $returncode= substr($headers[0], 9, 3);
 
                if($returncode=='401') {
-                       return false;
+                       return(false);
                }else{
-                       return true;
+                       return($uid);
                }
 
        }
@@ -68,14 +67,15 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
        /*
        * we don´t know if a user exists without the password. so we have to return false all the time
        */
-       public function userExists( $uid ) {
-               return false;
+       public function userExists( $uid ){
+               return true;
        }
 
+
        /*
        * we don´t know the users so all we can do it return an empty array here
        */
-       public function getUsers() {
+       public function getUsers($search = '', $limit = 10, $offset = 0) {
                $returnArray = array();
 
                return $returnArray;