[ Index ]
 

Code source de DokuWiki 2006-11-06

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/inc/auth/ -> basic.class.php (sommaire)

(pas de description)

Poids: 291 lignes (9 kb)
Inclus ou requis: 3 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

auth_basic:: (13 méthodes):
  auth_basic()
  canDo()
  logOff()
  trustExternal()
  checkPass()
  getUserData()
  createUser()
  modifyUser()
  deleteUsers()
  getUserCount()
  retrieveUsers()
  addGroup()
  retrieveGroups()


Classe: auth_basic  - X-Ref

auth/basic.class.php

foundation authorisation class
all auth classes should inherit from this class

auth_basic()   X-Ref
Constructor.

Carry out sanity checks to ensure the object is
able to operate. Set capabilities in $this->cando
array here

Set $this->success to false if checks fail

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

canDo($cap)   X-Ref
Capability check. [ DO NOT OVERRIDE ]

Checks the capabilities set in the $this->cando array and
some pseudo capabilities (shortcutting access to multiple
ones)

ususal capabilities start with lowercase letter
shortcut capabilities start with uppercase letter

author: Andreas Gohr <andi@splitbrain.org>
return: bool

logOff()   X-Ref
Log off the current user [ OPTIONAL ]

Is run in addition to the ususal logoff method. Should
only be needed when trustExternal is implemented.

author: Andreas Gohr

trustExternal($user,$pass,$sticky=false)   X-Ref
Do all authentication [ OPTIONAL ]

Set $this->cando['external'] = true when implemented

If this function is implemented it will be used to
authenticate a user - all other DokuWiki internals
will not be used for authenticating, thus
implementing the functions below becomes optional.

The function can be used to authenticate against third
party cookies or Apache auth mechanisms and replaces
the auth_login() function

The function will be called with or without a set
username. If the Username is given it was called
from the login form and the given credentials might
need to be checked. If no username was given it
the function needs to check if the user is logged in
by other means (cookie, environment).

The function needs to set some globals needed by
DokuWiki like auth_login() does.

author: Andreas Gohr <andi@splitbrain.org>
param: string  $user    Username
param: string  $pass    Cleartext Password
param: bool    $sticky  Cookie should not expire
return: bool             true on successful auth

checkPass($user,$pass)   X-Ref
Check user+password [ MUST BE OVERRIDDEN ]

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

author: Andreas Gohr <andi@splitbrain.org>
return: bool

getUserData($user)   X-Ref
Return user info [ MUST BE OVERRIDDEN ]

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

author: Andreas Gohr <andi@splitbrain.org>
return: array containing user data or false

createUser($user,$pass,$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
occured 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

author: Andreas Gohr <andi@splitbrain.org>

modifyUser($user, $changes)   X-Ref
Modify user data [implement only where required/possible]

Set the mod* capabilities according to the implemented features

author: Chris Smith <chris@jalakai.co.uk>
param: $user      nick of the user to be changed
param: $changes   array of field/value pairs to be changed (password will be clear text)
return: bool

deleteUsers($users)   X-Ref
Delete one or more users [implement only where required/possible]

Set delUser capability when implemented

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

getUserCount($filter=array()   X-Ref
Return a count of the number of user which meet $filter criteria
[should be implemented whenever retrieveUsers is implemented]

Set getUserCount capability when implemented

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

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

Set getUsers capability when implemented

author: Chris Smith <chris@jalakai.co.uk>
param: start     index of first user to be returned
param: limit     max number of users to be returned
param: filter    array of field/pattern pairs, null for no filter
return: array of userinfo (refer getUserData for internal userinfo details)

addGroup($group)   X-Ref
Define a group [implement only where required/possible]

Set addGroup capability when implemented

author: Chris Smith <chris@jalakai.co.uk>
return: bool

retrieveGroups($start=0,$limit=0)   X-Ref
Retrieve groups [implement only where required/possible]

Set getGroups capability when implemented

author: Chris Smith <chris@jalakai.co.uk>
return: array



Généré le : Tue Apr 3 20:47:31 2007 par Balluche grâce à PHPXref 0.7