Just curious, for example owncloud does the same. Why should it be a bad
idea. If you have an application with many users then it is valid to have a
space for every user, or not. Will give the virtual filesystem a try, Just
thought it would be easier to have an own folder for every user. Probably
will come up with more questions soon.... :-)

On Wed, Nov 12, 2014 at 9:39 PM, Evert Pot <[email protected]> wrote:

> Hi Laoneo,
>
> Generally we consider this a bad idea. It goes against the spirit of HTTP
> and sabredav.
> However, your starting point is to create a virtual filesystem:
>
> http://sabre.io/dav/virtual-filesystems/
>
> Read that first and experiment with your own custom collection. Once you
> have a firm grasp on how this works, you should basically inject the
> authentication plugin into the constructor of your new collection, and
> alter the contents of the collection depending on who is currently logged
> in.
>
> Evert
>
>
> On Wednesday, November 12, 2014 6:00:54 AM UTC-5, Laoneo wrote:
>>
>> In my new application I want to have for every user it's own structure on
>> the server filesystem. Where do I start? Do I have to create my own backend
>> tree. And from what point on do I have access to the logged in user? My
>> server code looks as follows (simplified):
>>
>> $authBackend = new \Sabre\DAV\Auth\Backend\My(JFactory::getDbo());
>> $calendarBackend = new \Sabre\CalDAV\Backend\PDO($pdo, $prefix .
>> 'a_calendars', $prefix . 'a_calendarobjects');
>> $principalBackend = new \Sabre\DAVACL\PrincipalBackend\PDO($pdo, $prefix
>> . 'a_principals', $prefix . 'a_groupmembers');
>>
>> $tree = array(
>> new Sabre\DAV\FS\Directory(ROOT . '/media/a/dav/data')
>> // new \Sabre\CalDAV\Principal\Collection($principalBackend),
>> // new \Sabre\CalDAV\CalendarRootNode($principalBackend,
>> // $calendarBackend)
>> );
>>
>> \Sabre\DAV\Server::$exposeVersion = false;
>>
>> $server = new \Sabre\DAV\Server($tree);
>>
>> $lockBackend = new \Sabre\DAV\Locks\Backend\File(ROOT .
>> '/media/a/dav/locks');
>> $lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend);
>> $server->addPlugin($lockPlugin);
>>
>> $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, 'SabreDAV'));
>> $server->addPlugin(new \Sabre\DAVACL\Plugin());
>> $server->addPlugin(new \Sabre\CalDAV\Plugin());
>>
>> $server->addPlugin(new \Sabre\DAV\Browser\Plugin());
>>
>> $server->exec();
>>
>> As you can see, the tree root path is already set here. Can I set it
>> somehow afterwards, that the root is pointing to the users folder (eg. ROOT
>> . '/media/a/dav/data/jake').
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "SabreDAV Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sabredav-discuss/d069b2b3-5cfd-47cc-8f27-51b918b21829%40googlegroups.com
> <https://groups.google.com/d/msgid/sabredav-discuss/d069b2b3-5cfd-47cc-8f27-51b918b21829%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sabredav-discuss/CAAbUApaFp6EBBnmbgq122EhxQd3UsOAqnbL0rRgB3C5z1zatuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to