Inside the Horde

Jan Schneider

The Horde Project

Administrator GUI tools

Let's start with something easy to get warm. A quick run through the administration tools.


  • Setup
  • Users
  • Groups
  • Permissions
  • Alarms
  • Sessions
  • PHP Shell
  • SQL Shell
  • CLI

7 Ways of Customization

  • Themes
  • Configuration
  • Preferences
  • Permissions
  • Hooks
  • APIs
  • Drivers


  • Easy way to change look, to create a CI
  • Consist of CSS rules and an optional icon set
  • "Traditional" applications more or less colors and fonts
  • "Modern" applications like DIMP completely CSS rendered
  • Real cascading through hierarchical CSS file loading


  • All configuration files go into the application's config/ directory: conf.php, prefs.php, mime_drivers.php, application specific files
  • Note: all configuration files are PHP code
  • Virtual host specific configuration
    • Set $conf['vhosts'] = true
    • Go to
    • Horde loads config/conf.php, config/, etc

Advanced Configuration Examples

Custom login or logout pages

  • Not that advanced actually
  • Redirect on unauthorized access
  • Redirect on logging out
  • Enabled in Horde or IMP configuration, depdending on authentication
  • $conf['auth']['alternate_login'] = '';
  • Example script for IMP in imp/scripts/cutom_login.php

Advanced Configuration Examples

Custom email headers, signatures, trailers

  • Track users (spammers)
  • Identify machines (in a cluster)
  • Add company signature, disclaimer
  • Keep user signatures flexible (changing offices, positions, numbers)

Advanced Configuration Examples

Composite authentication

  • Different authentication drivers for different purposes (authentication, user management/listing)
  • Example:
    • Want to have view switch on login screen → IMP authentication
    • Want to have signups → SQL authentication
  • See for detailed instructions


  • Defined in config/prefs.php
  • Individual preferences in $_prefs, grouping in $prefGroups
  • Grouping just cosmetical


  • Actual preference
  • Preference types: checkbox, number, text, password, etc.
  • More preference stuff later with hooks


  • Who?
    • Guests, anyone
    • Authenticated users
    • Individual users
    • Groups
    • Object owners
  • What?
    • Show
    • Read
    • Write
    • Delete
    • (Delegate)


  • Where?
    • Application access
    • Application-level limits
      • Maximum number of resources (folders, events, contacts, etc)
      • Access to resources (address books)
      • Feature limitiation (creating folders)
  • How?
    • Go to the permissions screen in the administration area
    • Add permissions for an application
    • Remember to set permissions, default is no access for anyone
    • Add sub-permissions, that's where the cool stuff is


The swiss army knife of Horde manipulation

  • Preference hooks
    1. Reading default preference values (lock them?)
    2. Called when saving preferences
  • Pre-authentication/post-authentication hooks
  • and more...
  • Application-specific hooks

Preference Hook Examples

Classics: email address, full name

Preference Hook Examples

Real world example: custom preferences through web service

Authentication Hook Example

Real world example: force users to accept a TOS and change passwords on login


Signup Hook Example

Real world example: request preference defaults, enforce TOS, normalize user names


More Hooks

More hooks and possible use cases

  • User name hooks (_username_hook_frombackend, _username_hook_tobackend, _imp_hook_vinfo)
    • Normalize user names (all lower-case)
    • Strip and add domains
    • Conversion between user IDs and user names
  • Group hooks (_group_hook)
    • Dynamically determine group membership

Application Hooks

  • IMP
    • Mailbox listing (show attachment icons, parse X-Priority headers)
    • Filter fetchmail messages
    • Add/change trailers and signatures
    • Display special mailbox icons
    • Quota driver
  • DIMP
    • Mailbox listing (show attachment icons, parse X-Priority headers)
    • Modify message view/preview

Application Hooks

  • Turba
    • Encode/decode contact attributes (massage values for output/storage, hashing/hiding passwords)
  • Nag/Mnemo
    • Description formatting


  • All inter-application communication through APIs
  • Replace one application with another, just implement the API
  • Examples:
    • Have your own blacklist/whitelist solution? Implement API methods mail/blacklistFrom, mail/showBlacklist, etc.
    • Have your own address book application? Implement the contacts API.
    • Want to integrate a different ticket system than Whups? Write a wrapper around Bugzilla/OTRS implementing the tickets API.


Registering an application at the Horde registry config/registry.php:


Create an API definition in lib/api.php:


Using APIs to use Horde functionality in your own applications

  • RSS feeds
  • Embeddable widgets


Using APIs to use Horde functionality in your own applications

  • Direct PHP API calls through registry More documentation on the wiki:
  • Use as an endpoint for
    • SOAP
    • XML-RPC
    • JSON-RPC
    • WebDAV


  • Your favorite backend for a library or application is not supported?
  • Create a driver!
  • Take an existing driver as a blueprint
  • Start hacking
  • Examples:
    • New authentication driver: lib/Auth/mydriver.php
    • New address book driver. turba/lib/Driver/mydriver.php