[ Index ]

PHP Cross Reference of DokuWiki




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

(no description)

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

Defines 1 class

auth_plugin_authldap:: (14 methods):

Class: auth_plugin_authldap  - X-Ref

LDAP authentication backend

__construct()   X-Ref

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: Andreas Gohr <andi@splitbrain.org>
author: Trouble
author: Dan Allen <dan.j.allen@gmail.com>
author: <evaldas.auryla@pheur.org>
author: Stephane Chazelas <stephane.chazelas@emerson.com>
author: Steffen Schoch <schoch@dsb.net>

_getUserData($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