chwala webdav with nextcloud
Mihai Badici
mihai at badici.ro
Wed Oct 30 20:09:19 UTC 2024
I remember I had this working in the past.
Now Nextcloud made the things complicated because by default it assign
to ldap users some random id's . But in advanced configuration it is
still possible to change the id's to user's uid or mail ( seems to be
distructive if you already use nextcloud but should work for new
installations.
After changing the mapping I still have problems because in this config:
$config['fileapi_sources'] = array(
'private-nextcloud' => array(
'driver' => 'webdav',
'baseuri' => 'http://localhost/cloud/remote.php/dav/files/',
'username' => '%u',
'password' => '%p',
),
the %u is not expanded in baseuri to the user name.
I was able to solve that changing in functioninit()
$this->client = newClient(array(
'baseUri' => rtrim($this->config['baseuri'], '/') .
'/'.$this->config['username'].'/',
but this need to be removed in
functionget_relative_url($url)
{
$url= $this->client->getAbsoluteUrl($url);
// added by me:
$url=trim(str_replace($this->config['username'],'',$url),'/');
returntrim(str_replace($this->config['baseuri'], '', $url), '/');
}
I think this can be useful for accessing private webdav folders so maybe
can be added in the official driver, probably the simplest way is to
allow wildcards in baseuri, this should keep the driver itself unchanged.
Mihai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kolab.org/pipermail/users/attachments/20241030/5b9328dc/attachment-0001.htm>
More information about the users
mailing list