[kronolith] Default external calendar
gerard breiner
gerard.breiner at ias.u-psud.fr
Sat Mar 17 19:19:43 UTC 2012
Jan Schneider <jan at horde.org> a écrit :
> Zitat von gerard breiner <gerard.breiner at ias.u-psud.fr>:
>
>> Jan Schneider <jan at horde.org> a écrit :
>>
>>> Zitat von Gerard Breiner <gerard.breiner at ias.u-psud.fr>:
>>>
>>>> Le 14/02/2012 15:37, Jan Schneider a écrit :
>>>>>
>>>>> Zitat von Martin Hochreiter <linuxbox at wavenet.at>:
>>>>>
>>>>>>> You cannot simply replace strings in the value copied from the
>>>>>>> database, because it is a serialized hash. Using $registry in
>>>>>>> prefs.local.php is not a good idea either.
>>>>>>> Instead you should create a preference hook that builds the
>>>>>>> hash, and return it serialized.
>>>>>>>
>>>>>> what a pitty :) ... ok, thank you I will create a hook for
>>>>>> that (new world for me...)
>>>>>> What should I use instead of the $registry variable to get the
>>>>>> credentials - or is it ok
>>>>>> to use it in the hooks?
>>>>>
>>>>> The prefs_init hook already gets the user name passed.
>>>>>
>>>> Hello ,
>>>>
>>>> I'm working on this too... So I followed the above Jan's advice
>>>> and as well as read the very good doc
>>>> /horde/config/hooks.php.dist (many thanks for all the work). The
>>>> result is that I managed to create the remote calendar by working
>>>> with prefs and hooks.local.php.
>>>>
>>>> Here is what I've done :
>>>> kronolit/config/prefs.local.php
>>>>
>>>> [CODE]
>>>> // remote calendars
>>>> $_prefs['remote_cals'] = array(
>>>> 'value' => '',
>>>> 'hook' => 'true',
>>>> 'locked' => 'false'
>>>> );
>>>> [/CODE]
>>>>
>>>> [CODE]
>>>> kronolith/config/hooks.local.phpclass Kronolith_Hooks
>>>> {
>>>> public function prefs_init($prefs, $value, $username, $scope_ob)
>>>> {
>>>> switch ($prefs) {
>>>> case 'remote_cals':
>>>> $no_serialize = array(array('name'=>'Calendar',
>>>>
>>>> 'url'=>'https://myurl/caldav.php/' .$username. '/agenda',
>>>> 'user'=> $username
>>>> // 'password' => $password
>>>> )
>>>> );
>>>> $value = serialize($no_serialize);
>>>> return $value;
>>>> }
>>>> }
>>>> }
>>>> [/CODE]
>>>>
>>>> Nevertheless at this time I don't know how to catch the
>>>> password... If Jan look at this again I would appreciate a little
>>>> more hints about this last issue.
>>>
>>> Try $GLOBALS['registry']->getAuthCredential('password')
>>>
>>> Jan.
>>>
>>> --
>>> The Horde Project
>>> http://www.horde.org/
>>>
>>>
>>> --
>>> Kronolith mailing list
>>> Frequently Asked Questions: http://horde.org/faq/
>>> To unsubscribe, mail: kronolith-unsubscribe at lists.horde.org
>>
>> Many thanks Jan for this advice... This command give the password
>> without encodage (I tried it in admin/phpshell.php ). Nevertheless
>> it seems that username and password are expecting as something like
>> :
>> s:4:"user";s:12:"PYnhqb8tbok=";s:8:"password";s:15:"PQ7F+FGnp7t="; .
>
> Sorry?
>
> --
> The Horde Project
> http://www.horde.org/
>
>
> --
> Kronolith mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: kronolith-unsubscribe at lists.horde.org
Probably misunderstanding from me... So followed your idea for
catching the password, here is what is my code now :
kronolith/config/hooks.local.php
[CODE]
class Kronolith_Hooks
{
public function prefs_init($prefs, $value, $username, $scope_ob)
{
switch ($prefs) {
case 'remote_cals':
$no_serialize = array(array('name'=>'Calendar',
'url'=>'https://calendar.ias.u-psud.fr/caldav.php/' .$username.
'/calendar',
'user'=> $username,
'password' =>
$GLOBALS['registry']->getAuthCredential('password')
)
);
$value = serialize($no_serialize);
return $value;
}
}
}
[/CODE]
The remote calendar show up in the kronolith's interface but
credentials are still requested despite the user and password in
hooks.local.php.
Best regards
Gerard Breiner
More information about the kronolith
mailing list