/ecdLogin.inc.php

Description

Authentification functions.

Classes
Class Description
TimeAuth PEAR Auth customization
Includes
require_once ("Auth.php") (line 34)

we derive PEAR Auth

require_once ("User.php") (line 35)
Functions
login (line 239)

Login the user using PEAR Auth module

This can be used to login someone, and/or to check if he is logged in. It also includes the code to logout someone since the procedure is very similar. However, it is advised to use logout() to logout the user instead.

To check if a valid auth is there, use the following piece of code:

  1. if (login(false)) { print "logged in!"; }

To do the actual login and refuse access, with a login screen, if there's no login already:

  1. login();

login() will not returned if the user is not logged in, and will prompt the user with a password prompt.

void login ([boolean $show_login = true], [boolean $logout = false])
  • boolean $show_login: if we want to deny the user access with a login prompt
  • boolean $logout: wether to log off the user (in any case)
logout (line 261)

logout the current user

This removes the user any credentials he might have

This is actually implemented using login() since a lot of code is common.

void logout ()
print_login_screen (line 174)
void print_login_screen (mixed $username, [mixed $error = null])
user_obj (line 190)

get a ecdUsager object out of a Auth sesssion

example:

  1. require_once('ecdBlueAuth.inc.php');
  2. $user = user_obj();
  3. $role = $user->get('role');

void user_obj ([mixed $use_cache = true])

Documentation generated on Tue, 11 Jan 2005 01:38:23 -0500 by phpDocumentor 1.3.0RC3