[horde] Does username hooks apply to calendars, tasks etc?

Luis Felipe Marzagao/Andamentos lfbm.andamentos at gmail.com
Sat Sep 6 04:39:43 UTC 2008


Apparently, the bug has no relation to my problem.

Here's a strange behaviour, that could lead to something:

If I equally set *both* tobackend and frombackend hooks to remove the 
vdomain, like:

...
         $vdomain = '+azevedomarques.adv.br';

         if (substr($userID, -strlen($vdomain)) == $vdomain) {
             $userID = substr($userID, 0, -strlen($vdomain));
         }

         return $userID;
...

then it works perfectly, both the username exhibition and 
permission/share setting when managing calendars and stuff works like a 
charm, just by using the first part of my imap users name, like "felipe" 
(instead of seeing and having to type "felipe+azevedomarques.adv.br").

Also, my backend (MySQL) is saving the usersids just as "felipe", 
instead of "felipe+azevedomarques.adv.br".

I could leave it that way, since it's working pretty fine, but it 
appears to me that's not what the opposite hooks (from/to) should be 
doing, since they are defined the same way...

Any help is welcomed.

Thanks


Jan Schneider escreveu:
> Maybe: http://bugs.horde.org/ticket/6371
>
> Zitat von Luis Felipe Marzagao/Andamentos <lfbm.andamentos at gmail.com>:
>
>> In the portal view the name is correctly displayed:
>> http://img217.imageshack.us/my.php?image=00backendviewfl4.jpg
>>
>>
>> It is correctly inserted in the backend also (MySQL):
>> http://img152.imageshack.us/my.php?image=01portalviewsm7.jpg
>>
>>
>> But in the contacts, calendars, tasks and mnemo it appears with the 
>> appended domain:
>> http://img221.imageshack.us/my.php?image=02contactsviewsd4.jpg
>> http://img209.imageshack.us/my.php?image=03calendarviewsw1.jpg
>> http://img73.imageshack.us/my.php?image=04tasksviewko5.jpg
>> http://img50.imageshack.us/my.php?image=05notesviewsa9.jpg
>>
>>
>> Here are the hook functions:
>>
>> *horde/imp/config/hooks.php:*
>>
>> if (!function_exists('_imp_hook_vinfo')) {
>>     function _imp_hook_vinfo($type = 'username')
>>     {
>>
>>         $vdomain = 'azevedomarques.adv.br';
>>           if ($type == 'username') {
>>
>>             return $_SESSION['imp']['user'] . '+' . $vdomain;
>>                    } elseif ($type == 'vdomain') {
>>             return $vdomain;
>>         } else {
>>             return PEAR::raiseError('invalid type: ' . $type);
>>         }
>>     }
>> }
>>
>>
>> *horde/config/hooks.php:*
>>
>> if (!function_exists('_username_hook_frombackend')) {
>>     function _username_hook_frombackend($userID) {
>>
>>         $vdomain = '+azevedomarques.adv.br';
>>
>>         $userID = substr($userID, 0, -strlen($vdomain));
>>
>>         return $userID;
>>
>>     }
>> }
>>
>>
>> if (!function_exists('_username_hook_tobackend')) {
>>     function _username_hook_tobackend($userID) {
>>
>>         $vdomain = 'azevedomarques.adv.br';
>>
>>         return $userID . '+' . $vdomain;
>>          }
>> }
>>
>>
>> Thanks,
>> Luis Felipe (duli)
>>
>>
>> Jan Schneider escreveu:
>>> Zitat von Luis Felipe Marzagao/Andamentos <lfbm.andamentos at gmail.com>:
>>>
>>>> I have successfully set up username hooks in order to add or strip 
>>>> the domain name from/to the userid, so my users see "john" instead 
>>>> of "john at example.com". But it only works on the horde portal view. 
>>>> When the user clicks on calendars, task or mnemo, the sidebar shows 
>>>> "john at example.com" instead of just "john". So I wonder if the 
>>>> username hooks are globally applied to all horde modules (in which 
>>>> case I´m doing something wrong) and in case it´s not meant to be 
>>>> global, how could manage to do it?
>>>
>>> Where does it show those user names?
>>>
>>> Jan.
>>>
>>
>
>
>
> Jan.
>



More information about the horde mailing list