[horde] Set "from_addr" as pre populated "enum" field

lst_hoe02 at kwsoft.de lst_hoe02 at kwsoft.de
Tue Mar 19 21:10:17 UTC 2013


Zitat von Michael M Slusarz <slusarz at horde.org>:

> Quoting lst_hoe02 at kwsoft.de:
>
>> Hello,
>>
>> we are on the way to Horde 5 and try to get the prefs.local.php for  
>> Horde altered so a enum filed is used for the from_addr preference,  
>> so the user is only able to choose the from_addr out of a list of  
>> aliases obtained with a database query.
>>
>> What is the easiest way to use a Database query for standard SQL  
>> source in prefs.local.php?
>
> Are you asking how to populate a preference field with dynamic  
> results obtained from an SQL query?  Use the 'on_init' feature (see,  
> e.g., the 'language' preference).

No, the problem is how to get a Database Connection the "Horde" way.  
The table to query is within the same scope as all the horde stuff,  
but i'm not sure about the horde objects/functions to use. The hooks  
examples are mostly LDAP and i have not yet found a SQL example.

>> Is it correct to use $userId as logged in user?
>
> Not sure where you are getting $userId from?  Authenticated is  
> always $registry->getAuth().

So a simply username = $registry->getAuth() should do the trick? Sorry  
for asking the obvious but i'm not a PHP coder at all.

Regards

Andreas





More information about the horde mailing list