[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/lib/plugins/authldap/ -> auth.php (summary)

(no description)

File Size: 703 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

auth_plugin_authldap:: (14 methods):
  __construct()
  checkPass()
  getUserData()
  fetchUserData()
  modifyUser()
  isCaseSensitive()
  retrieveUsers()
  makeFilter()
  filter()
  constructPattern()
  filterEscape()
  openLDAP()
  ldapSearch()
  debug()


Class: auth_plugin_authldap  - X-Ref

LDAP authentication backend

__construct()   X-Ref
Constructor


checkPass($user, $pass)   X-Ref
Check user+password

Checks if the given user exists and the given
plaintext password is correct by trying to bind
to the LDAP server

author: Andreas Gohr <andi@splitbrain.org>
param: string $user
param: string $pass
return: bool

getUserData($user, $requireGroups = true)   X-Ref
Return user info

Returns info about the given user needs to contain
at least these fields:

name string  full name of the user
mail string  email addres of the user
grps array   list of groups the user is in

This LDAP specific function returns the following
addional fields:

dn     string  distinguished name (DN)
uid    string  Posix User ID
inbind bool    for internal use - avoid loop in binding

author: <evaldas.auryla@pheur.org>
author: Stephane Chazelas <stephane.chazelas@emerson.com>
author: Steffen Schoch <schoch@dsb.net>
author: Andreas Gohr <andi@splitbrain.org>
author: Trouble
author: Dan Allen <dan.j.allen@gmail.com>
param: string $user
param: bool $requireGroups (optional) - ignored, groups are always supplied by this plugin
return: array containing user data or false

fetchUserData($user, $inbind = false)   X-Ref

param: string $user
param: bool $inbind authldap specific, true if in bind phase
return: array containing user data or false

modifyUser($user, $changes)   X-Ref
Definition of the function modifyUser in order to modify the password

param: string $user nick of the user to be changed
param: array $changes array of field/value pairs to be changed (password will be clear text)
return: bool   true on success, false on error

isCaseSensitive()   X-Ref
Most values in LDAP are case-insensitive

return: bool

retrieveUsers($start = 0, $limit = 0, $filter = [])   X-Ref
Bulk retrieval of user data

author: Dominik Eckelmann <dokuwiki@cosmocode.de>
param: int $start index of first user to be returned
param: int $limit max number of users to be returned
param: array $filter array of field/pattern pairs, null for no filter
return: array of userinfo (refer getUserData for internal userinfo details)

makeFilter($filter, $placeholders)   X-Ref
Make LDAP filter strings.

Used by auth_getUserData to make the filter
strings for grouptree and groupfilter

author: Troels Liebe Bentsen <tlb@rapanden.dk>
param: string $filter ldap search filter with placeholders
param: array $placeholders placeholders to fill in
return: string

filter($user, $info)   X-Ref
return true if $user + $info match $filter criteria, false otherwise

author: Chris Smith <chris@jalakai.co.uk>
param: string $user the user's login name
param: array $info the user's userinfo array
return: bool

constructPattern($filter)   X-Ref
Set the filter pattern

author: Chris Smith <chris@jalakai.co.uk>
param: $filter
return: void

filterEscape($string)   X-Ref
Escape a string to be used in a LDAP filter

Ported from Perl's Net::LDAP::Util escape_filter_value

author: Andreas Gohr
param: string $string
return: string

openLDAP()   X-Ref
Opens a connection to the configured LDAP server and sets the wanted
option on the connection

author: Andreas Gohr <andi@splitbrain.org>

ldapSearch($link_identifier,$base_dn,$filter,$scope = 'sub',$attributes = null,$attrsonly = 0,$sizelimit = 0)   X-Ref
Wraps around ldap_search, ldap_list or ldap_read depending on $scope

author: Andreas Gohr <andi@splitbrain.org>
param: resource $link_identifier
param: string $base_dn
param: string $filter
param: string $scope can be 'base', 'one' or 'sub'
param: null|array $attributes
param: int $attrsonly
param: int $sizelimit
return: resource

debug($message, $err, $line, $file)   X-Ref
Wrapper around msg() but outputs only when debug is enabled

param: string $message
param: int $err
param: int $line
param: string $file
return: void