[kronolith] Calendar entries in wrong calendar

Arjen de Korte arjen+horde at de-korte.org
Tue Mar 20 13:43:27 UTC 2018


Citeren Jens Grüntjes <jens.gruentjes at ebira.de>:

> Zitat von Arjen de Korte <arjen+horde at de-korte.org>:
>
>> Citeren Jens Grüntjes <jens.gruentjes at ebira.de>:
>>
>>> Hi folks,
>>>
>>> I have a strange problem with some user's calendars. The strange  
>>> thing is that, if user a accepts an invitation from a mail sent to  
>>> him, the calendar entry is generated in user b's calendar.
>>>
>>> We investigated this a bit and found out the following: user a  
>>> logged in into Horde sometimes with uppercase username "A" and  
>>> sometimes with lowercase username "a". There were two calendars  
>>> for the user, one of which could be accessed by "a" and the other  
>>> one accessible by "A".
>>
>> Not a solution to this problem, but if your authentication backend  
>> is not case sensitive, it makes sense to convert every username  
>> upon login to lower case to prevent situations like this from the  
>> start (Horde is case sensitive as you've already noticed). See the  
>> example in 'horde/config/hooks.php.dist' (the USERNAME HOOK).
>
> Thanks for your advice. I removed almost everything from the file  
> hooks.php.dist so there is only this function left:
>
> // USERNAME HOOK: See above for description of format.
>     public function authusername($userId, $toHorde)
>     {
>         // Example #2: Convert username to all lowercase. This might be
>         // necessary if an authentication backend is case insensitive to
>         // take into account that Horde's preference system is case
>         // sensitive.
>         // ex. $userId = 'MyName' returns: 'myname'
>         return $toHorde
>             ? Horde_String::lower($userId)
>             : $userId;
>     }
>
> I called the file hooks.php, is that okay?

Provided the first line is

<?php

that would be OK.

> Or is it removed during upgrades and has to be named hooks.local.php?

No, this file will not be removed during upgrades.

> Do I have to "activate" the hooks.php-file or does Horde read it  
> when it is present?

It will be used if present and readable.

>>> We looked into the database and found the two different calendars.  
>>> We then modified the database entries (in table kronolith_events)  
>>> so that every event for calendar "A" was moved to calendar "a".  
>>> After logging in as "a" every event from calendar "A" appeared in  
>>> calendar "a". When the user creates a new event this is correctly  
>>> created in his calendar. But when the user accepts invitatiobs  
>>> sent by mail then these events are created inside the calendar  
>>> from user b. User a doesn't even have permissions to write in user  
>>> b's calendar.
>>>
>>> BTW: User b has almost the same problem when accepting invitations  
>>> by mail. His entries are generated in user c's calendar. But I  
>>> guess this is closelay related to my first problem.
>>>
>>> Did I misconfigure something in Horde or did I break something by  
>>> updating the database entries mannually?
>>>
>>>
>>> Thanks for your help
>>> Jens





More information about the kronolith mailing list