[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

DokuWiki Plugin authpdo (Auth Component)

Author: Andreas Gohr
License: GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
File Size: 787 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

auth_plugin_authpdo:: (21 methods):
  __construct()
  checkPass()
  getUserData()
  createUser()
  modifyUser()
  deleteUsers()
  retrieveUsers()
  getUserCount()
  addGroup()
  retrieveGroups()
  selectUser()
  deleteUser()
  selectUserGroups()
  selectGroups()
  clearGroupCache()
  joinGroup()
  leaveGroup()
  query()
  debugMsg()
  checkConfig()
  debugSQL()


Class: auth_plugin_authpdo  - X-Ref

Class auth_plugin_authpdo

__construct()   X-Ref
Constructor.


checkPass($user, $pass)   X-Ref
Check user+password

return: bool
param: string $user the user name
param: string $pass the clear text password

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

return: array|bool containing user data or false
param: string $user the user name
param: bool $requireGroups whether or not the returned data must include groups

createUser($user, $clear, $name, $mail, $grps = null)   X-Ref
Create a new User [implement only where required/possible]

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

return: bool|null
param: string $user
param: string $clear
param: string $name
param: string $mail
param: null|array $grps

modifyUser($user, $changes)   X-Ref
Modify user data

return: bool
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)

deleteUsers($users)   X-Ref
Delete one or more users

Set delUser capability when implemented

return: int    number of users deleted
param: array $users

retrieveUsers($start = 0, $limit = -1, $filter = null)   X-Ref
Bulk retrieval of user data [implement only where required/possible]

Set getUsers capability when implemented

return: array list 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

getUserCount($filter = [])   X-Ref
Return a count of the number of user which meet $filter criteria

return: int
param: array $filter array of field/pattern pairs, empty array for no filter

addGroup($group)   X-Ref
Create a new group with the given name

return: bool
param: string $group

retrieveGroups($start = 0, $limit = 0)   X-Ref
Retrieve groups

Set getGroups capability when implemented

return: array
param: int $start
param: int $limit

selectUser($user)   X-Ref
Select data of a specified user

return: bool|array user data, false on error
param: string $user the user name

deleteUser($user)   X-Ref
Delete a user after removing all their group memberships

return: bool true when the user was deleted
param: string $user

selectUserGroups($userdata)   X-Ref
Select all groups of a user

return: array|bool list of group names, false on error
param: array $userdata The userdata as returned by _selectUser()

selectGroups()   X-Ref
Select all available groups

return: array|bool list of all available groups and their properties

clearGroupCache()   X-Ref
Remove all entries from the group cache


joinGroup($userdata, $groupdata)   X-Ref
Adds the user to the group

return: bool
param: array $userdata all the user data
param: array $groupdata all the group data

leaveGroup($userdata, $groupdata)   X-Ref
Removes the user from the group

return: bool
param: array $userdata all the user data
param: array $groupdata all the group data

query($sql, $arguments = [])   X-Ref
Executes a query

return: array|int|bool The result as associative array for SELECTs, affected rows for others, false on error
param: string $sql The SQL statement to execute
param: array $arguments Named parameters to be used in the statement

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

param: string|Exception $message
param: int $err
param: int $line

checkConfig($keys)   X-Ref
Check if the given config strings are set

return: bool
author: Matthias Grimm <matthiasgrimm@users.sourceforge.net>
param: string[] $keys

debugSQL($sql, $params, $htmlescape = true)   X-Ref
create an approximation of the SQL string with parameters replaced

return: string
param: string $sql
param: array $params
param: bool $htmlescape Should the result be escaped for output in HTML?