[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/inc/ -> lib.auth.php (sommaire)

Authentication levels.

Poids: 235 lignes (8 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

auth:: (6 méthodes):
  checkAuth()
  getFromCookie()
  logout()
  asLevel()
  goToLoginPage()
  login()


Classe: auth  - X-Ref

Authentication class.
Manage the login of a user.

Note: This class is only composed of static methods thus
the "lib" in the filename.
checkAuth($level=PX_AUTH_NORMAL)   X-Ref
Check the authentification level and website.
If the authentication is not ok, the user is sent to the login page
If the authentication is ok, the configuration of the website is loaded,
a cookie to remember the website is set and the execution continues.
The check is only done on the $_SESSION data.

param: int Level of rights (PX_AUTH_NORMAL)
return: void

getFromCookie()   X-Ref
Get the session from the cookie.

return: bool success

logout()   X-Ref
Logout a user


asLevel($level=PX_AUTH_NORMAL, $website=false, $user='')   X-Ref
Check if a user as a given level for a website access.
If no website given, get from the session, if not in the session, use
'default' as it is the id of the first website.

param: int Right level (PX_AUTH_NORMAL)
param: string Website id (false)
param: object User ('') if none given, the current session user is tested
return: bool Success

goToLoginPage()   X-Ref
Send a "Location:" header to redirect the user
to the login page. Abort the script execution.


login($user, $pswd, $website='', $checkpass=true)   X-Ref
Log a user to the system.
If the user has the rights to access the system
user data are saved in the session. Some cookies are also set like the
language, the website. To be used if the session timeout, so the user is
sent back with the right language in the last website.

The login scheme is:

- check if login/password ok, if not return false
- get the authorized websites if no websites return false
- get the default website for the user, if not set to the first of the
authorized websites and return true
- check if the default website is in the list of authorized, if not,
remove it from the user prefs and set the default as the first
authorized website and return true.

param: string Username
param: string Password
param: string Website id ('')
param: bool Password check (true)
return: bool success



Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics