diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-11-05 16:17:57 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-11-05 16:17:57 +0100 |
commit | 7a29137e2b5b0fb6e931822f015c86014b2be55f (patch) | |
tree | 874801c86d38424a01404bf591305cc1b2e9d9a8 | |
parent | 1147dc977422e827a201fa081abd07721231d072 (diff) | |
parent | 5c72d28ffdcb3290e722bd91bef3f5a5f8130f3f (diff) | |
download | nextcloud-server-7a29137e2b5b0fb6e931822f015c86014b2be55f.tar.gz nextcloud-server-7a29137e2b5b0fb6e931822f015c86014b2be55f.zip |
Merge branch 'master' of github.com:owncloud/core into vcategories_db
-rw-r--r-- | apps/files/js/fileactions.js | 26 | ||||
-rwxr-xr-x | apps/user_webdavauth/appinfo/info.xml | 6 | ||||
-rw-r--r-- | apps/user_webdavauth/appinfo/version | 1 | ||||
-rwxr-xr-x | apps/user_webdavauth/templates/settings.php | 2 | ||||
-rwxr-xr-x | apps/user_webdavauth/user_webdavauth.php | 14 |
5 files changed, 23 insertions, 26 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 82d990bf780..40dd9f14a69 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -70,6 +70,13 @@ var FileActions = { } parent.children('a.name').append('<span class="fileactions" />'); var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); + var actionHandler = function (parent, action, event) { + event.stopPropagation(); + event.preventDefault(); + FileActions.currentFile = parent; + file = FileActions.getCurrentFile(); + action(file); + }; for (name in actions) { // NOTE: Temporary fix to prevent rename action in root of Shared directory if (name === 'Rename' && $('#dir').val() === '/Shared') { @@ -87,14 +94,7 @@ var FileActions = { html += t('files', name) + '</a>'; var element = $(html); element.data('action', name); - element.click(function (event) { - FileActions.currentFile = $(this).parent().parent().parent(); - event.stopPropagation(); - event.preventDefault(); - var action = actions[$(this).data('action')]; - var currentFile = FileActions.getCurrentFile(); - action(currentFile); - }); + element.click(actionHandler.bind(null, parent, actions[name])); parent.find('a.name>span.fileactions').append(element); } } @@ -113,14 +113,8 @@ var FileActions = { if (img) { element.append($('<img class ="svg" src="' + img + '"/>')); } - element.data('action', 'Delete'); - element.click(function (event) { - event.stopPropagation(); - event.preventDefault(); - var action = actions[$(this).data('action')]; - var currentFile = FileActions.getCurrentFile(); - action(currentFile); - }); + element.data('action', actions['Delete']); + element.click(actionHandler.bind(null, parent, actions['Delete'])); parent.parent().children().last().append(element); } }, diff --git a/apps/user_webdavauth/appinfo/info.xml b/apps/user_webdavauth/appinfo/info.xml index 9a8027daee6..0d9f529ed1b 100755 --- a/apps/user_webdavauth/appinfo/info.xml +++ b/apps/user_webdavauth/appinfo/info.xml @@ -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> diff --git a/apps/user_webdavauth/appinfo/version b/apps/user_webdavauth/appinfo/version new file mode 100644 index 00000000000..a6bbdb5ff48 --- /dev/null +++ b/apps/user_webdavauth/appinfo/version @@ -0,0 +1 @@ +1.1.0.0 diff --git a/apps/user_webdavauth/templates/settings.php b/apps/user_webdavauth/templates/settings.php index c00c199632a..e6ca5d97d3c 100755 --- a/apps/user_webdavauth/templates/settings.php +++ b/apps/user_webdavauth/templates/settings.php @@ -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> diff --git a/apps/user_webdavauth/user_webdavauth.php b/apps/user_webdavauth/user_webdavauth.php index 5a16a4c992a..0b0be7c2fa1 100755 --- a/apps/user_webdavauth/user_webdavauth.php +++ b/apps/user_webdavauth/user_webdavauth.php @@ -34,7 +34,7 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend { 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); return false; @@ -47,7 +47,6 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend { } public function checkPassword( $uid, $password ) { - $url= 'http://'.urlencode($uid).':'.urlencode($password).'@'.$this->webdavauth_url; $headers = get_headers($url); if($headers==false) { @@ -58,9 +57,9 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend { $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; |