diff --git a/plugins/nextcloud/index.php b/plugins/nextcloud/index.php index b67397a66..cb351e1e4 100644 --- a/plugins/nextcloud/index.php +++ b/plugins/nextcloud/index.php @@ -39,10 +39,6 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin } /* - $sUID = \OC::$server->getUserSession()->getUser()->getUID(); - WebDAV /nextcloud/remote.php/dav/files/$sUID/ - \OCP\Util::linkToRemote('files'); - \OC::$server->getCalendarManager(); \OC::$server->getLDAPProvider(); \OC::$server->getAppDataDir('snappymail'); ?? @@ -106,6 +102,14 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin if (false !== $key) { unset($aResult['Capa'][$key]); } + $sUID = \OC::$server->getUserSession()->getUser()->getUID(); + $sWebDAV = \OC::$server->getURLGenerator()->linkTo('', 'remote.php') . '/dav/'; +// $sWebDAV = \OCP\Util::linkToRemote('dav'); + $aResult['Nextcloud'] = [ + 'UID' => $sUID, + 'WebDAV' => $sWebDAV +// 'WebDAV_files' => $sWebDAV . '/files/' . $sUID + ]; } } diff --git a/plugins/nextcloud/js/attachments.js b/plugins/nextcloud/js/attachments.js index 2a3cf448c..1b438324e 100644 --- a/plugins/nextcloud/js/attachments.js +++ b/plugins/nextcloud/js/attachments.js @@ -42,4 +42,33 @@ + 'Save Nextcloud' + '')); } + + + /** TODO: File browser to attach files in composer */ +/* + let cfg = rl.settings.get('Nextcloud'); + fetch(cfg.WebDAV . '/files/' . cfg.UID, { + method: 'PROPFIND', + mode: 'same-origin', + cache: 'no-cache', + redirect: 'error', + credentials: 'same-origin', + headers: { + 'Content-Type': 'application/xml; charset=utf-8', + }, + body: '' + + '' + + '' + + '' + }) + .then(response => response.text()) + .then(text => { + console.dir({response:text}); + parser = new DOMParser(); + xmlDoc = parser.parseFromString(text, "text/xml"); + }) + .catch(error => console.error(error)); +*/ + + })(window.rl);