PHP Class auth_plugin_authpdo, dokuwiki

Inheritance: extends DokuWiki_Auth_Plugin
Afficher le fichier Open project: splitbrain/dokuwiki

Protected Properties

Свойство Type Description
$groupcache The list of all groups
$pdo PDO

Méthodes publiques

Méthode Description
__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]

Méthodes protégées

Méthode Description
_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

Method Details

__construct() public méthode

Constructor.
public __construct ( )

_chkcnf() protected méthode

Check if the given config strings are set
Author: Matthias Grimm ([email protected])
protected _chkcnf ( string[] $keys ) : boolean
$keys string[]
Résultat boolean

_clearGroupCache() protected méthode

Remove all entries from the group cache
protected _clearGroupCache ( )

_debug() protected méthode

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() protected méthode

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?
Résultat string

_deleteUser() protected méthode

Delete a user after removing all their group memberships
protected _deleteUser ( string $user ) : boolean
$user string
Résultat boolean true when the user was deleted

_joinGroup() protected méthode

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
Résultat boolean

_leaveGroup() protected méthode

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
Résultat boolean

_query() protected méthode

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
Résultat array | integer | boolean The result as associative array for SELECTs, affected rows for others, false on error

_selectGroups() protected méthode

Select all available groups
protected _selectGroups ( ) : array | boolean
Résultat array | boolean list of all available groups and their properties

_selectUser() protected méthode

Select data of a specified user
protected _selectUser ( string $user ) : boolean | array
$user string the user name
Résultat boolean | array user data, false on error

_selectUserGroups() protected méthode

Select all groups of a user
protected _selectUserGroups ( array $userdata ) : array | boolean
$userdata array The userdata as returned by _selectUser()
Résultat array | boolean list of group names, false on error

addGroup() public méthode

Create a new group with the given name
public addGroup ( string $group ) : boolean
$group string
Résultat boolean

checkPass() public méthode

Check user+password
public checkPass ( string $user, string $pass ) : boolean
$user string the user name
$pass string the clear text password
Résultat boolean

createUser() public méthode

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
Résultat boolean | null

deleteUsers() public méthode

Set delUser capability when implemented
public deleteUsers ( array $users ) : integer
$users array
Résultat integer number of users deleted

getUserCount() public méthode

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
Résultat integer

getUserData() public méthode

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
Résultat array | boolean containing user data or false

modifyUser() public méthode

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)
Résultat boolean

retrieveGroups() public méthode

Set getGroups capability when implemented
public retrieveGroups ( integer $start, integer $limit ) : array
$start integer
$limit integer
Résultat array

retrieveUsers() public méthode

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
Résultat array list of userinfo (refer getUserData for internal userinfo details)

Property Details

$groupcache protected_oe property

The list of all groups
protected $groupcache

$pdo protected_oe property

protected PDO $pdo
Résultat PDO