apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Auth_Controller

Source Location: /Auth-1.6.4/Auth/Controller.php

Class Overview


Controlls access to a group of php access and redirects to a predefined login page as needed


Author(s):

Version:

  • Release: @package_version@ File: $Revision: 237449 $

Copyright:

  • 2001-2006 The PHP Group

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 61]
Controlls access to a group of php access and redirects to a predefined login page as needed

In all pages

  1.  include_once('Auth.php');
  2.  include_once('Auth/Controller.php');
  3.  $_auth = new Auth('File''passwd');
  4.  $authController = new Auth_Controller($_auth'login.php''index.php');
  5.  $authController->start();

In login.php

  1.  include_once('Auth.php');
  2.  include_once('Auth/Controller.php');
  3.  $_auth = new Auth('File''passwd');
  4.  $authController = new Auth_Controller($_auth'login.php''index.php');
  5.  $authController->start();
  6.  if$authController->isAuthorised() ){
  7.    $authController->redirectBack();
  8.  }



[ Top ]


Class Variables

$auth =  null

[line 71]

The Auth instance this controller is managing

Type:   object Auth


[ Top ]

$autoRedirectBack =  false

[line 92]

If this is set to true after a succesfull login the Auth_Controller::redirectBack() is invoked automatically

Type:   boolean


[ Top ]

$default =  null

[line 84]

The default index page to use when the caller page is not set

Type:   string


[ Top ]

$login =  null

[line 77]

The login URL

Type:   string


[ Top ]



Method Detail

Auth_Controller (Constructor)   [line 107]

void Auth_Controller( Auth &$auth_obj, [string $login = 'login.php'], [string $default = 'index.php'], [array $accessList = array()])

Constructor
  • Todo: Add a list of urls which need redirection

Parameters:

Auth   &$auth_obj   —  An auth instance
string   $login   —  The login page
string   $default   —  The default page to go to if return page is not set
array   $accessList   —  Some rules about which urls need to be sent to the login page

[ Top ]

checkAuth   [line 257]

void checkAuth( )

Proxy call to auth
  • See: Auth::checkAuth()

[ Top ]

getStatus   [line 293]

void getStatus( )

Proxy call to auth
  • See: Auth::getStatus()

[ Top ]

getUsername   [line 281]

void getUsername( )

Proxy call to auth
  • See: Auth::getUsername()

[ Top ]

isAuthorised   [line 245]

void isAuthorised( )

Checks is the user is logged on
  • See: Auth::checkAuth()

[ Top ]

logout   [line 269]

void logout( )

Proxy call to auth
  • See: Auth::logout()

[ Top ]

redirectBack   [line 145]

void redirectBack( )

Redirects Back to the calling page

[ Top ]

redirectLogin   [line 180]

void redirectLogin( )

Redirects to the login Page if not authorised

put return page on the query or in auth


[ Top ]

setAutoRedirectBack   [line 132]

void setAutoRedirectBack( [bool $flag = true])

Enables auto redirection when login is done
  • See: Auth_Controller::autoRedirectBack

Parameters:

bool   $flag   —  Sets the autoRedirectBack flag to this

[ Top ]

start   [line 217]

void start( )

Starts the Auth Procedure

If the page requires login the user is redirected to the login page otherwise the Auth::start is called to initialize Auth

  • Todo: Implement an access list which specifies which urls/pages need login and which do not

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:41:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.