Horde Preferences Cheatsheet

Reference

https://wiki.horde.org/Doc/Admin/Preferences
https://wiki.horde.org/CustomizingPreferences

Paths

  • Preferences for horde are in /var/www/horde/config
  • Preferences for modules (eg "imp") are in /var/www/horde/imp/config

Config Places and Precedences

  • All available preferences are in prefs.php. They therfore act as reference.
  • Custom global preferences go into prefs.local.php. They overrule pref.php
  • Prefs set by the users are in the database table "horde.horde_prefs". They overrule prefs.local.php
    If you want to enfore global preferences you have to delete the according user database entries!

Format / Syntax

Most prefs are set using the "value" key. Example:

<?php
/* /var/www/horde/config/prefs.local.php */

$_prefs['initial_application']['value'] = 'imp';

Others are given differently. See prefs.php for reference

<?php 
/* /var/www/horde/config/prefs.local.php */

$_prefs['theme']['locked'] = true;

Some use serialized php arrays:

<?php
/* /var/www/horde/imp/config/prefs.local.php */

// list of folders to poll for new mail
$_prefs['nav_poll']['value'] = serialize(array(
  'INBOX' => 1,
  'INBOX.Spam' => true,
));

The can also be given as serialized strings. Use these online services to translate:

https://www.functions-online.com/serialize.html
https://www.functions-online.com/unserialize.html

<?php
/* /var/www/horde/imp/config/prefs.local.php */

// list of folders to poll for new mail
$_prefs['nav_poll']['value'] = 'a:2:{s:5:"INBOX";i:1;s:10:"INBOX.Spam";b:1;}';

User Preferences in Database

Table: "horde_prefs"

  • mysql -D horde
  • DESC horde_prefs;
    • +------------+--------------+------+-----+---------+-------+
      | Field      | Type         | Null | Key | Default | Extra |
      +------------+--------------+------+-----+---------+-------+
      | pref_uid   | varchar(200) | NO   | PRI |         |       |
      | pref_scope | varchar(16)  | NO   | PRI |         |       |
      | pref_name  | varchar(32)  | NO   | PRI |         |       |
      | pref_value | longblob     | YES  |     | NULL    |       |
      +------------+--------------+------+-----+---------+-------+

Check entries for a preference

  • SELECT * from horde_prefs WHERE pref_name="nav_poll"\G;

Check entries for a preference, horde app and a specific user

  • SELECT * from horde_prefs WHERE pref_scope="imp" AND pref_name="nav_poll" and pref_uid="elon@example.com"\G;

Delete all user preferences for a setting to enforce global settings (CAUTION!)

  • DELETE FROM horde_prefs WHERE pref_scope="imp" AND pref_name="nav_poll";

Hint:

The value in "pref_value" is usually corresponding to the "value" key in prefs.php. Example:

  • Database "pref_value" for "nav_poll": a:1:{s:5:"INBOX";i:1;}
  • prefs.local.php: $_prefs['nav_poll']['value'] = 'a:1:{s:5:"INBOX";i:1;}';

Apply Preferences

Global preferences are only applied when the user logs out and again logs in.