[horde] Hooks and application permissions

Patrick Boutilier boutilpj at ednet.ns.ca
Fri Jun 19 15:39:43 UTC 2009


On 06/16/2009 11:42 AM, Jan Schneider wrote:
> Zitat von Patrick Boutilier <boutilpj at ednet.ns.ca>:
>
>> Is there a way to set permissions on a Horde app via a hook?
>>
>>
>> Reason I ask is that in Horde 3.1.x we used to have a hook that would
>> disable an application completely based on the result on an SQL query.
>> But in Horde 3.3.x the application only gets disabled during initial
>> login. Afterwards the application is active again.
>>
>> This is what works in 3.1.x to disable the passwd app.
>>
>> if(!$passwd) {
>>
>> $GLOBALS['registry']->applications['passwd']['status']='inactive';
>> }
>>
>
> No, there is no such hook. You could try adding the code directly to
> config/registry.php, but I'm not sure if the registry is reloaded after
> logging in.

Good point. I added some simple code to config/registry.php to make a 
MySQL query based on the userid and use that data to determine the 
active/inactive state of certain applications.

This way is actually more efficient as only one call gets made to the 
database on login where I was seeing four with a preauthenticate hook. 
As well, with a preauthenticate hook it appears that everytime the Inbox 
was refreshed the hook would make another call to the database.


>
> Jan.
>
>
> ------------------------------------------------------------------------
>
> --
> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org



More information about the horde mailing list