PHP Класс auth_plugin_authpdo, dokuwiki

Наследование: extends DokuWiki_Auth_Plugin
Показать файл Открыть проект

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

Свойство Тип Описание
$groupcache The list of all groups
$pdo PDO

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

Метод Описание
__construct ( ) Constructor.
addGroup ( string $group ) : boolean Create a new group with the given name
checkPass ( string $user, string $pass ) : boolean Check user+password
createUser ( string $user, string $clear, string $name, string $mail, null | array $grps = null ) : boolean | null Create a new User [implement only where required/possible]
deleteUsers ( array $users ) : integer Delete one or more users
getUserCount ( array $filter = [] ) : integer Return a count of the number of user which meet $filter criteria
getUserData ( string $user, boolean $requireGroups = true ) : array | boolean Return user info
modifyUser ( string $user, array $changes ) : boolean Modify user data
retrieveGroups ( integer $start, integer $limit ) : array Retrieve groups
retrieveUsers ( integer $start, integer $limit, array $filter = null ) : array Bulk retrieval of user data [implement only where required/possible]

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

Метод Описание
_chkcnf ( string[] $keys ) : boolean Check if the given config strings are set
_clearGroupCache ( ) Remove all entries from the group cache
_debug ( string | Exception $message, integer $err, integer $line ) Wrapper around msg() but outputs only when debug is enabled
_debugSQL ( string $sql, array $params, boolean $htmlescape = true ) : string create an approximation of the SQL string with parameters replaced
_deleteUser ( string $user ) : boolean Delete a user after removing all their group memberships
_joinGroup ( array $userdata, array $groupdata ) : boolean Adds the user to the group
_leaveGroup ( array $userdata, array $groupdata ) : boolean Removes the user from the group
_query ( string $sql, array $arguments = [] ) : array | integer | boolean Executes a query
_selectGroups ( ) : array | boolean Select all available groups
_selectUser ( string $user ) : boolean | array Select data of a specified user
_selectUserGroups ( array $userdata ) : array | boolean Select all groups of a user

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

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

Constructor.
public __construct ( )

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

Check if the given config strings are set
Автор: Matthias Grimm ([email protected])
protected _chkcnf ( string[] $keys ) : boolean
$keys string[]
Результат boolean

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

Remove all entries from the group cache
protected _clearGroupCache ( )

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

Wrapper around msg() but outputs only when debug is enabled
protected _debug ( string | Exception $message, integer $err, integer $line )
$message string | Exception
$err integer
$line integer

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

create an approximation of the SQL string with parameters replaced
protected _debugSQL ( string $sql, array $params, boolean $htmlescape = true ) : string
$sql string
$params array
$htmlescape boolean Should the result be escaped for output in HTML?
Результат string

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

Delete a user after removing all their group memberships
protected _deleteUser ( string $user ) : boolean
$user string
Результат boolean true when the user was deleted

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

Adds the user to the group
protected _joinGroup ( array $userdata, array $groupdata ) : boolean
$userdata array all the user data
$groupdata array all the group data
Результат boolean

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

Removes the user from the group
protected _leaveGroup ( array $userdata, array $groupdata ) : boolean
$userdata array all the user data
$groupdata array all the group data
Результат boolean

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

Executes a query
protected _query ( string $sql, array $arguments = [] ) : array | integer | boolean
$sql string The SQL statement to execute
$arguments array Named parameters to be used in the statement
Результат array | integer | boolean The result as associative array for SELECTs, affected rows for others, false on error

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

Select all available groups
protected _selectGroups ( ) : array | boolean
Результат array | boolean list of all available groups and their properties

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

Select data of a specified user
protected _selectUser ( string $user ) : boolean | array
$user string the user name
Результат boolean | array user data, false on error

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

Select all groups of a user
protected _selectUserGroups ( array $userdata ) : array | boolean
$userdata array The userdata as returned by _selectUser()
Результат array | boolean list of group names, false on error

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

Create a new group with the given name
public addGroup ( string $group ) : boolean
$group string
Результат boolean

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

Check user+password
public checkPass ( string $user, string $pass ) : boolean
$user string the user name
$pass string the clear text password
Результат boolean

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

Returns false if the user already exists, null when an error occurred and true if everything went well. The new user HAS TO be added to the default group by this function! Set addUser capability when implemented
public createUser ( string $user, string $clear, string $name, string $mail, null | array $grps = null ) : boolean | null
$user string
$clear string
$name string
$mail string
$grps null | array
Результат boolean | null

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

Set delUser capability when implemented
public deleteUsers ( array $users ) : integer
$users array
Результат integer number of users deleted

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

Return a count of the number of user which meet $filter criteria
public getUserCount ( array $filter = [] ) : integer
$filter array array of field/pattern pairs, empty array for no filter
Результат integer

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
public getUserData ( string $user, boolean $requireGroups = true ) : array | boolean
$user string the user name
$requireGroups boolean whether or not the returned data must include groups
Результат array | boolean containing user data or false

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

Modify user data
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

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

Set getGroups capability when implemented
public retrieveGroups ( integer $start, integer $limit ) : array
$start integer
$limit integer
Результат array

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

Set getUsers capability when implemented
public retrieveUsers ( integer $start, integer $limit, array $filter = null ) : 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 list of userinfo (refer getUserData for internal userinfo details)

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

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

The list of all groups
protected $groupcache

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

protected PDO $pdo
Результат PDO