From f187aa6c93ecc7538875e38629f4efb2c25c3155 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 4 Nov 2012 20:48:38 +0100 Subject: [PATCH 1/5] some more code reuse for fileactions also fixes an issue where some fileactions always worked on the last file in the list --- apps/files/js/fileactions.js | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 82d990bf78..0b547502bc 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -70,6 +70,16 @@ var FileActions = { } parent.children('a.name').append(''); var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); + var actionHandler = function (parent, action, event) { + event.stopPropagation(); + event.preventDefault(); + if(action) + FileActions.currentFile = parent; + file = FileActions.getCurrentFile(); + console.log(file); + console.log(file); + 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 +97,7 @@ var FileActions = { html += t('files', name) + ''; 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 +116,8 @@ var FileActions = { if (img) { element.append($('')); } - 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); } }, From 4f32f49fb1d4a247558bc44733ed8443974c1701 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 4 Nov 2012 21:00:36 +0100 Subject: [PATCH 2/5] this line shouldn't be here --- apps/files/js/fileactions.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 0b547502bc..d09979fc76 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -73,7 +73,6 @@ var FileActions = { var actionHandler = function (parent, action, event) { event.stopPropagation(); event.preventDefault(); - if(action) FileActions.currentFile = parent; file = FileActions.getCurrentFile(); console.log(file); From 01b0e9b133279ec6c68e7fca6c8ae35c35f82941 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Mon, 5 Nov 2012 10:46:28 +0100 Subject: [PATCH 3/5] fix the webdav user backend. still not completel working but a frist step --- apps/user_webdavauth/templates/settings.php | 2 +- apps/user_webdavauth/user_webdavauth.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/user_webdavauth/templates/settings.php b/apps/user_webdavauth/templates/settings.php index c00c199632..e6ca5d97d3 100755 --- a/apps/user_webdavauth/templates/settings.php +++ b/apps/user_webdavauth/templates/settings.php @@ -1,7 +1,7 @@
WebDAV Authentication -

+

diff --git a/apps/user_webdavauth/user_webdavauth.php b/apps/user_webdavauth/user_webdavauth.php index 5a16a4c992..2af8e9f103 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); } } @@ -75,7 +74,7 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend { /* * 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; From 34fee8afaa9161fbc9c608ae87bb19b770110a5c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 5 Nov 2012 13:52:02 +0100 Subject: [PATCH 4/5] remove debug statements --- apps/files/js/fileactions.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index d09979fc76..40dd9f14a6 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -75,8 +75,6 @@ var FileActions = { event.preventDefault(); FileActions.currentFile = parent; file = FileActions.getCurrentFile(); - console.log(file); - console.log(file); action(file); }; for (name in actions) { From 6fba4ba87d5a16eb61337062cd7a6b9fa51f7682 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Mon, 5 Nov 2012 14:22:16 +0100 Subject: [PATCH 5/5] fix the webdavauth app --- apps/user_webdavauth/appinfo/info.xml | 6 ++++-- apps/user_webdavauth/appinfo/version | 1 + apps/user_webdavauth/user_webdavauth.php | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 apps/user_webdavauth/appinfo/version diff --git a/apps/user_webdavauth/appinfo/info.xml b/apps/user_webdavauth/appinfo/info.xml index 9a8027daee..0d9f529ed1 100755 --- a/apps/user_webdavauth/appinfo/info.xml +++ b/apps/user_webdavauth/appinfo/info.xml @@ -2,10 +2,12 @@ user_webdavauth WebDAV user backend - Authenticate Users by a WebDAV call - 1.0 + 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. AGPL Frank Karlitschek 4.9 true + + + diff --git a/apps/user_webdavauth/appinfo/version b/apps/user_webdavauth/appinfo/version new file mode 100644 index 0000000000..a6bbdb5ff4 --- /dev/null +++ b/apps/user_webdavauth/appinfo/version @@ -0,0 +1 @@ +1.1.0.0 diff --git a/apps/user_webdavauth/user_webdavauth.php b/apps/user_webdavauth/user_webdavauth.php index 2af8e9f103..0b0be7c2fa 100755 --- a/apps/user_webdavauth/user_webdavauth.php +++ b/apps/user_webdavauth/user_webdavauth.php @@ -67,10 +67,11 @@ 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 */