PHP Класс auth_plugin_authldap, dokuwiki

Автор: Andreas Gohr ([email protected])
Автор: Chris Smith ([email protected])
Автор: Jan Schumann ([email protected])
Наследование: extends DokuWiki_Auth_Plugin
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_pattern * @var array $_pattern User filter pattern
$bound * @var int $bound What type of connection does already exist?
$con * @var resource $con holds the LDAP connection
$users * @var array $users User data cache

Открытые методы

Метод Описание
__construct ( ) Constructor
checkPass ( string $user, string $pass ) : boolean Check user+password
getUserData ( string $user, boolean $requireGroups = true ) : array Return user info
isCaseSensitive ( ) : boolean Most values in LDAP are case-insensitive
modifyUser ( string $user, array $changes ) : boolean Definition of the function modifyUser in order to modify the password
retrieveUsers ( integer $start, integer $limit, array $filter = [] ) : array Bulk retrieval of user data

Защищенные методы

Метод Описание
_constructPattern ( $filter ) : void Set the filter pattern
_debug ( string $message, integer $err, integer $line, string $file ) : void Wrapper around msg() but outputs only when debug is enabled
_filter ( string $user, array $info ) : boolean return true if $user + $info match $filter criteria, false otherwise
_filterEscape ( string $string ) : string Escape a string to be used in a LDAP filter
_getUserData ( string $user, boolean $inbind = false ) : array
_ldapsearch ( resource $link_identifier, string $base_dn, string $filter, string $scope = 'sub', null | array $attributes = null, integer $attrsonly, integer $sizelimit ) : resource Wraps around ldap_search, ldap_list or ldap_read depending on $scope
_makeFilter ( string $filter, array $placeholders ) : string Make LDAP filter strings.
_openLDAP ( ) Opens a connection to the configured LDAP server and sets the wanted option on the connection

Описание методов

__construct() публичный Метод

Constructor
public __construct ( )

_constructPattern() защищенный Метод

Set the filter pattern
Автор: Chris Smith ([email protected])
protected _constructPattern ( $filter ) : void
$filter
Результат void

_debug() защищенный Метод

Wrapper around msg() but outputs only when debug is enabled
protected _debug ( string $message, integer $err, integer $line, string $file ) : void
$message string
$err integer
$line integer
$file string
Результат void

_filter() защищенный Метод

return true if $user + $info match $filter criteria, false otherwise
Автор: Chris Smith ([email protected])
protected _filter ( string $user, array $info ) : boolean
$user string the user's login name
$info array the user's userinfo array
Результат boolean

_filterEscape() защищенный Метод

Ported from Perl's Net::LDAP::Util escape_filter_value
Автор: Andreas Gohr
protected _filterEscape ( string $string ) : string
$string string
Результат string

_getUserData() защищенный Метод

protected _getUserData ( string $user, boolean $inbind = false ) : array
$user string
$inbind boolean authldap specific, true if in bind phase
Результат array containing user data or false

_ldapsearch() защищенный Метод

Wraps around ldap_search, ldap_list or ldap_read depending on $scope
Автор: Andreas Gohr ([email protected])
protected _ldapsearch ( resource $link_identifier, string $base_dn, string $filter, string $scope = 'sub', null | array $attributes = null, integer $attrsonly, integer $sizelimit ) : resource
$link_identifier resource
$base_dn string
$filter string
$scope string can be 'base', 'one' or 'sub'
$attributes null | array
$attrsonly integer
$sizelimit integer
Результат resource

_makeFilter() защищенный Метод

Used by auth_getUserData to make the filter strings for grouptree and groupfilter
Автор: Troels Liebe Bentsen ([email protected])
protected _makeFilter ( string $filter, array $placeholders ) : string
$filter string ldap search filter with placeholders
$placeholders array placeholders to fill in
Результат string

_openLDAP() защищенный Метод

Opens a connection to the configured LDAP server and sets the wanted option on the connection
Автор: Andreas Gohr ([email protected])
protected _openLDAP ( )

checkPass() публичный Метод

Checks if the given user exists and the given plaintext password is correct by trying to bind to the LDAP server
Автор: Andreas Gohr ([email protected])
public checkPass ( string $user, string $pass ) : boolean
$user string
$pass string
Результат boolean

getUserData() публичный Метод

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
Автор: Andreas Gohr ([email protected])
Автор: Trouble
Автор: Dan Allen ([email protected])
Автор: ([email protected])
Автор: Stephane Chazelas ([email protected])
Автор: Steffen Schoch ([email protected])
public getUserData ( string $user, boolean $requireGroups = true ) : array
$user string
$requireGroups boolean (optional) - ignored, groups are always supplied by this plugin
Результат array containing user data or false

isCaseSensitive() публичный Метод

Most values in LDAP are case-insensitive
public isCaseSensitive ( ) : boolean
Результат boolean

modifyUser() публичный Метод

Definition of the function modifyUser in order to modify the password
public modifyUser ( string $user, array $changes ) : boolean
$user string nick of the user to be changed
$changes array array of field/value pairs to be changed (password will be clear text)
Результат boolean true on success, false on error

retrieveUsers() публичный Метод

Bulk retrieval of user data
Автор: Dominik Eckelmann ([email protected])
public retrieveUsers ( integer $start, integer $limit, array $filter = [] ) : array
$start integer index of first user to be returned
$limit integer max number of users to be returned
$filter array array of field/pattern pairs, null for no filter
Результат array of userinfo (refer getUserData for internal userinfo details)

Описание свойств

$_pattern защищенное свойство

* @var array $_pattern User filter pattern
protected $_pattern

$bound защищенное свойство

* @var int $bound What type of connection does already exist?
protected $bound

$con защищенное свойство

* @var resource $con holds the LDAP connection
protected $con

$users защищенное свойство

* @var array $users User data cache
protected $users