[horde] Reset Portal View button but a little help needed

JP Edwards jpedwardspost at yahoo.co.uk
Tue Jan 10 10:26:57 UTC 2012


Hi,

We recently started making use of horde3 portal view.  At the moment the portal view is defined and locked through the prefs / configuration files.  Ideally though, I would like to unlock it so everyone can tweak their portal view how they would like it but also give everyone a quick and easy way to restore the 'default portal view'.  This way they won't mind experimenting a bit.

Looking at horde pref_values table in mysql, I think this could be done by adding a custom menu item within horde that runs a php script to delete any portal layout preferences a user has set.  Then if they logout and login they should be back to the default portal.

In other words something like:  

<?php
// Connect to MySQL

// Delete horde users custom portal layout tweaks  
mysql_query("delete from horde_prefs where pref_name = 'portal_layout' and pref_uid = hordeuser at email") 
or die(mysql_error());  
?>

My question is: how do I get the user id of the current user (hordeuser at email) into the mysql statement. I could jsut ask them to type it in, but I think they'd be wiping out each others preferences :-)

Thanks in advance for any help received,

JP.

PS
Horde Horde (horde) 3.3.10
Mail Mail (imp) H3 (4.3.9)
User authorisation via imp.



More information about the horde mailing list