Class Prefs_ldap

Description

Preferences storage implementation for PHP's LDAP extention.

Required parameters:

  • 'basedn' The base DN for the LDAP server.
  • 'hostspec' The hostname of the LDAP server.
  • 'uid' The username search key.
  • 'writedn' One of "user", "admin", or "searchdn"
Optional parameters:
  • 'searchdn' The DN of a user with search permissions on the directory
  • 'searchpw' 'searchdn's password for binding
  • 'admindn' The DN of the administrative account to bind for
  • write operations.
  • 'adminpw' 'admindn's password for bind authentication.
  • 'port' The port of the LDAP server.
  • DEFAULT: 389
  • 'version' The version of the LDAP protocol to use.
  • DEFAULT: NONE (system default will be used)
  • 'tls' Whether to use TLS connections. DEFAULT: false
If setting up as the Horde preference handler in conf.php, the following is an example configuration. The schemas needed for ldap are in horde/scripts/ldap.

  1.  $conf['prefs']['driver''ldap';
  2.  $conf['prefs']['params']['hostspec''localhost';
  3.  $conf['prefs']['params']['port''389';
  4.  $conf['prefs']['params']['basedn''dc=example,dc=org';
  5.  $conf['prefs']['params']['uid''mail';

The following is valid but would only be necessary if users do NOT have permission to modify their own LDAP accounts.

  1.  $conf['prefs']['params']['admindn''cn=Manager,dc=example,dc=org';
  2.  $conf['prefs']['params']['adminpw''password';

Copyright 1999-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Prefs/Prefs/ldap.php (line 62)

Prefs
   |
   --Prefs_ldap
Direct descendents
Class Description
 class Prefs_kolab Kolab implementation of the Horde preference system. Derives from the Prefs_ldap LDAP authentication object, and simply provides parameters to it based on the global Kolab configuration.
Variable Summary
 boolean $_connected
 resource $_connection
 string $_dn
 array $_params
 string $_password
Method Summary
 Prefs_ldap Prefs_ldap (string $user, string $password, [string $scope = ''], [array $params = array()], [boolean $caching = false])
 void clear ()
 void store ()
 mixed _retrieve ($scope $scope)
Variables
boolean $_connected = false (line 83)

Boolean indicating whether or not we're connected to the LDAP server.

resource $_connection (line 76)

Handle for the current LDAP connection.

string $_dn = '' (line 90)

String holding the user's DN.

array $_params = array() (line 69)

Hash containing connection parameters.

string $_password = '' (line 97)

String holding the user's password.

Inherited Variables

Inherited from Prefs

Prefs::$_cache
Prefs::$_caching
Prefs::$_hooks
Prefs::$_prefs
Prefs::$_scope
Prefs::$_scopes
Prefs::$_user
Methods
Constructor Prefs_ldap (line 108)

Constructs a new LDAP preferences object.

Prefs_ldap Prefs_ldap (string $user, string $password, [string $scope = ''], [array $params = array()], [boolean $caching = false])
  • string $user: The user who owns these preferences.
  • string $password: The password associated with $user.
  • string $scope: The current application scope.
  • array $params: A hash containing connection parameters.
  • boolean $caching: Should caching be used?
clear (line 514)

Clears all preferences from the LDAP backend.

void clear ()

Redefinition of:
Prefs::clear()
Clears all preferences from the backend.
store (line 411)

Stores preferences to the LDAP server.

void store ()

Redefinition of:
Prefs::store()
This function will be run at the end of every request as a shutdown
_retrieve (line 341)

Retrieves the requested set of preferences from the user's LDAP entry.

  • return: True on success or a PEAR_Error object on failure.
mixed _retrieve ($scope $scope)
  • $scope $scope: Scope specifier.

Inherited Methods

Inherited From Prefs

 Prefs::Prefs()
 Prefs::cleanup()
 Prefs::clear()
 Prefs::convertFromDriver()
 Prefs::convertToDriver()
 Prefs::factory()
 Prefs::getCharset()
 Prefs::getDefault()
 Prefs::getScope()
 Prefs::getUser()
 Prefs::getValue()
 Prefs::isDefault()
 Prefs::isDirty()
 Prefs::isLocked()
 Prefs::isShared()
 Prefs::remove()
 Prefs::retrieve()
 Prefs::setDefault()
 Prefs::setDirty()
 Prefs::setLocked()
 Prefs::setScope()
 Prefs::setShared()
 Prefs::setValue()
 Prefs::singleton()
 Prefs::store()
 Prefs::_cacheLookup()
 Prefs::_cacheUpdate()
 Prefs::_dirtyPrefs()
 Prefs::_getPreferenceScope()
 Prefs::_loadScope()
 Prefs::_setValue()
 Prefs::__get()
 Prefs::__set()

Documentation generated on Sun, 30 Jan 2011 05:19:03 +0000 by phpDocumentor 1.4.3