[dev] Adding -system- shares to Caldav (Horde_Dav)

Ralf Lang lang at b1-systems.de
Sat Jul 6 05:05:19 UTC 2013


On 05.07.2013 17:32, Jan Schneider wrote:
> 
> Zitat von Ralf Lang <lang at b1-systems.de>:
> 
>> If've been looking around for where to patch in -system- support for Dav
>> shares. (kronolith, nag, turban).
>>
>> The Horde_Dav system expects -system- to be a user existing in
>> Horde_Auth and having an Identity. I'm not sure if I should provide a
>> static fake identity and always have a user -system- in the dav library
>> or if I should promote -system- to a first class special user. I'm more
>> leaning to the former (less invasive).
> 
> Can you point to the code where this is required? Generally the former
> sounds indeed like a better solution.

I did a quick draft yesterday

1) Horde_Dav_Principals::getPrincipalsByPrefix
- $users = array('-system-')
+ $users = array('-system-')

2) Horde_Dav_Principals::getPrincipalsByPath
--        if ($this->_auth->hasCapability('list') &&
--            !$this->_auth->exists($user)) {
++       if ($this->_auth->hasCapability('list') &&
++            !$this->_auth->exists($user) &&
++            $user != '-system-') {


3) Horde_Dav_Principals::_getUserInfo
{
++  if ($user == '-system-') {
++      return array(
++          'uri' => 'principals/-system-',
++          '{DAV:}displayname' => '-systems-',
++          '{http://sabredav.org/ns}email-address' => ''
++	/* Can we leave email empty, set something static or
++           pull something from a fake identity? */
++  }
    $identitiy = $this->_identities->create(user);

This was enough for making system appear and list credentials under it
(together with the kronolith patch from
http://bugs.horde.org/ticket/12325 which was for WebDAV -- may need to
amend callDavFoo too to make it actually crud events from calendars )


-- 
Ralf Lang
Linux Consultant / Developer
Tel.: +49-170-6381563
Mail: lang at b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.horde.org/archives/dev/attachments/20130706/a5db69d4/attachment.bin>


More information about the dev mailing list