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

Jan Schneider jan at horde.org
Thu Jan 26 10:27:32 UTC 2012


Zitat von JP Edwards <jpedwardspost at yahoo.co.uk>:

> 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  
> :-)

Auth::getAuth()

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the horde mailing list