mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-28 02:21:06 +08:00
Added some WebDAV draft code for Nextcloud plugin #96
This commit is contained in:
parent
211600135d
commit
063ed7d844
2 changed files with 37 additions and 4 deletions
|
@ -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
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,4 +42,33 @@
|
|||
+ '<span class="g-ui-link" data-bind="click: saveNextcloud" data-i18n="NEXTCLOUD/SAVE_ATTACHMENTS">Save Nextcloud</span>'
|
||||
+ '</span>'));
|
||||
}
|
||||
|
||||
|
||||
/** 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: '<?xml version="1.0"?>'
|
||||
+ '<d:propfind xmlns:d="DAV:">'
|
||||
+ '<d:prop><d:resourcetype/></d:prop>'
|
||||
+ '</d:propfind>'
|
||||
})
|
||||
.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);
|
||||
|
|
Loading…
Reference in a new issue