File/wpDirAuth.php

Description

wpDirAuth: WordPress Directory Authentication (LDAP/LDAPS).

Works with most LDAP enabled directory services, such as OpenLDAP, Apache Directory, Microsoft Active Directory, Novell eDirectory, Sun Java System Directory Server, etc.

Please note that wpDirAuth will start in safe mode if it detects that another plugin is in conflict, by detecting if the wp_login and wp_setcookie functions have already been overwritten. It cannot, on the other hand, detect plugins that might want to overwrite these functions after wpDirAuth has been loaded.

Originally forked from a patched version of wpLDAP.

Constants
WPDIRAUTH_ALLOWED_TAGS = '<a><strong><em><p><ul><ol><li>' (line 96)

Allowed HTML (messages)

WPDIRAUTH_DEFAULT_CHANGEPASSMSG = 'To change a %s password, please refer to the official institutional password policy.' (line 91)

Default password change message.

WPDIRAUTH_DEFAULT_FILTER = 'samAccountName' (line 81)

Default LDAP field to search against when locating the user's profile.

WPDIRAUTH_DEFAULT_LOGINSCREENMSG = '%s members can login directly using their institutional password.' (line 86)

Default login screen message.

WPDIRAUTH_SIGNATURE = '<a href="http://tekartist.org/labs/wordpress/plugins/wpdirauth/">wpDirAuth</a> '.WPDIRAUTH_VERSION (line 76)

wpDirAuth signature.

WPDIRAUTH_VERSION = '1.0' (line 71)

wpDirAuth version.

Functions
wpDirAuth_addMenu (line 689)

Adds the `Directory Auth.` menu entry in the Wordpress Admin section.

Also activates the wpDirAuth config panel as a callback function.

void wpDirAuth_addMenu ()
wpDirAuth_auth (line 243)

Custom LDAP authentication module.

The returned keys are in the same format used by WP for the wp_insert_user and wp_update_user functions.

boolean wpDirAuth_auth (string $username, string $password)
  • string $username: LDAP username
  • string $password: LDAP password
wpDirAuth_bindTest (line 221)

LDAP bind test Tries two different documented method of php-based ldap binding.

Note: passing params by reference, no need for copies (unlike in wpDirAuth_auth where it is desirable).

boolean wpDirAuth_bindTest (object &$connection, string &$username, string &$password)
  • object &$connection: LDAP connection
  • string &$username: LDAP username
  • string &$password: LDAP password
wpDirAuth_hidePassFields (line 780)

Extending WP's show_password_fields.

Displays the directory password change message in profile.php and user.php.

boolean wpDirAuth_hidePassFields ()
wpDirAuth_loginFormExtra (line 710)

Extending WP's login_form.

Enforces the admin defined SSL login preferences and adds a directory login related message to the standard WP login screen.

void wpDirAuth_loginFormExtra ()
wpDirAuth_makeCookieMarker (line 198)

Cookie marker.

Generates a random string to be used as salt for the password hash cookie checks in wp_setcookie and wp_login

string wpDirAuth_makeCookieMarker ()
wpDirAuth_optionsPanel (line 428)

wpDirAuth plugin configuration panel.

Processes and outputs the wpDirAuth configuration form.

void wpDirAuth_optionsPanel ()
wpDirAuth_profileUpdate (line 843)

Extending WP's profile_update.

Saves the TOS acceptance if sent.

  • return: Return format as expected by WP's profile_update()
boolean wpDirAuth_profileUpdate (integer $userID)
  • integer $userID: Sent by WP profile_update action
wpDirAuth_safeAddMenu (line 163)

SAFE MODE: Adds the `Directory Auth.` menu entry in the Wordpress Admin section.

Also activates the wpDirAuth config panel, with a conflict message, as a callback function.

void wpDirAuth_safeAddMenu ()
wpDirAuth_safeConflictMessage (line 110)

SAFE MODE: wpDirAuth plugin configuration panel.

Processes and outputs the wpDirAuth configuration form, with a conflict message.

void wpDirAuth_safeConflictMessage ()
wpDirAuth_sanitize (line 408)

Runs stripslashes, html_entity_decode, then strip_tags with allowed html if requested.

No input sashimi for us (hopefully).

string wpDirAuth_sanitize (string $value, [boolean $allowed = false])
  • string $value: Value to `sanitize`
  • boolean $allowed: Set to true for WPDIRAUTH_ALLOWED_TAGS
wp_login (line 865)

WP's wp_login overwrite.

Processes the directory login and creates a new user on first access.

boolean wp_login (string $username, string $password, [boolean $already_md5 = false])
  • string $username: Login form username.
  • string $password: Login form password
  • boolean $already_md5: Has the pswd been double-hashed already?
wp_setcookie (line 1103)

WordPress wp_setcookie overwrite.

Sets the WP session cookies.

void wp_setcookie (string $username, string $password, [boolean $already_md5 = false], [string $home = ''], [string $siteurl = ''], [boolean $remember = false])
  • string $username: Login form username.
  • string $password: Login form password
  • boolean $already_md5: Has the pswd been double-hashed already?
  • string $home
  • string $siteurl
  • boolean $remember

Documentation generated on Fri, 31 Aug 2007 21:41:25 -0400 by phpDocumentor 1.4.0a2