[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

(no description)

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

Defines 1 class

auth_plugin_authplain:: (17 methods):
  __construct()
  checkPass()
  getUserData()
  createUserLine()
  createUser()
  modifyUser()
  deleteUsers()
  getUserCount()
  retrieveUsers()
  retrieveGroups()
  cleanUser()
  cleanGroup()
  loadUserData()
  readUserFile()
  splitUserData()
  filter()
  constructPattern()


Class: auth_plugin_authplain  - X-Ref

Plaintext authentication backend

__construct()   X-Ref
Constructor

Carry out sanity checks to ensure the object is
able to operate. Set capabilities.

author: Christopher Smith <chris@jalakai.co.uk>

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

Checks if the given user exists and the given
plaintext password is correct

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

return: array|false
param: string $user
param: bool $requireGroups  (optional) ignored by this plugin, grps info always supplied
author: Andreas Gohr <andi@splitbrain.org>

createUserLine($user, $pass, $name, $mail, $grps)   X-Ref
Creates a string suitable for saving as a line
in the file database
(delimiters escaped, etc.)

return: string
param: string $user
param: string $pass
param: string $name
param: string $mail
param: array  $grps list of groups the user is in

createUser($user, $pwd, $name, $mail, $grps = null)   X-Ref
Create a new User

Returns false if the user already exists, null when an error
occurred and true if everything went well.

The new user will be added to the default group by this
function if grps are not specified (default behaviour).

return: bool|null|string
param: string $user
param: string $pwd
param: string $name
param: string $mail
param: array  $grps
author: Andreas Gohr <andi@splitbrain.org>
author: Chris Smith <chris@jalakai.co.uk>

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)
author: Chris Smith <chris@jalakai.co.uk>

deleteUsers($users)   X-Ref
Remove one or more users from the list of registered users

return: int             the number of users deleted
param: array  $users   array of users to be deleted
author: Christopher Smith <chris@jalakai.co.uk>

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

return: int
param: array $filter
author: Chris Smith <chris@jalakai.co.uk>

retrieveUsers($start = 0, $limit = 0, $filter = [])   X-Ref
Bulk retrieval of user data

return: array 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
author: Chris Smith <chris@jalakai.co.uk>

retrieveGroups($start = 0, $limit = 0)   X-Ref
Retrieves groups.
Loads complete user data into memory before searching for groups.

return: array
param: int   $start index of first group to be returned
param: int   $limit max number of groups to be returned

cleanUser($user)   X-Ref
Only valid pageid's (no namespaces) for usernames

return: string
param: string $user

cleanGroup($group)   X-Ref
Only valid pageid's (no namespaces) for groupnames

return: string
param: string $group

loadUserData()   X-Ref
Load all user data

loads the user file into a datastructure

author: Andreas Gohr <andi@splitbrain.org>

readUserFile($file)   X-Ref
Read user data from given file

ignores non existing files

return: array
param: string $file the file to load data from

splitUserData($line)   X-Ref
Get the user line split into it's parts

return: string[]
param: string $line

filter($user, $info)   X-Ref
return true if $user + $info match $filter criteria, false otherwise

return: bool
param: string $user User login
param: array  $info User's userinfo array
author: Chris Smith <chris@jalakai.co.uk>

constructPattern($filter)   X-Ref
construct a filter pattern

param: array $filter