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

Class: Auth_Controller

Source Location: /Auth-1.3.0r2/Auth/Controller.php

Class Overview


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


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 30]
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_obj =  null

[line 33]

var Auth An auth instance

Type:   mixed


[ Top ]

$autoRedirectBack =  false

[line 39]

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

Type:   mixed


[ Top ]

$default =  null

[line 37]

var string The default index page, used when login redirects and the caller page in not set or is the login page it's self

Type:   mixed


[ Top ]

$login =  null

[line 35]

var string The login url

Type:   mixed


[ Top ]



Method Detail

Auth_Controller (Constructor)   [line 51]

Auth_Controller 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 165]

void checkAuth( )

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

[ Top ]

getStatus   [line 189]

void getStatus( )

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

[ Top ]

getUsername   [line 181]

void getUsername( )

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

[ Top ]

isAuthorised   [line 157]

void isAuthorised( )

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

[ Top ]

logout   [line 173]

void logout( )

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

[ Top ]

redirectBack   [line 79]

void redirectBack( )

Redirects Back to the calling page

[ Top ]

redirectLogin   [line 105]

void redirectLogin( )

Redirects to the login Page if not authorised

put return page on the query or in auth


[ Top ]

setAutoRedirectBack   [line 72]

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 132]

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 13:52:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.