[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

(no description)

File Size: 698 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

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

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

return: array containing user data or false
param: string $user
param: bool $requireGroups (optional) - ignored, groups are always supplied by this plugin
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>

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

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

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

return: bool   true on success, false on error
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)

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

return: bool

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

return: array of userinfo (refer getUserData for internal userinfo details)
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
author: Dominik Eckelmann <dokuwiki@cosmocode.de>

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

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

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

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

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

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

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

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

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

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

openLDAP()   X-Ref
No description

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

return: resource
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
author: Andreas Gohr <andi@splitbrain.org>

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

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