107 function Auth_Controller(&$auth_obj, $login=
'login.php', $default=
'index.php', $accessList=array())
109 $this->auth =& $auth_obj;
110 $this->_loginPage =
$login;
113 if (!empty(
$_GET[
'return']) &&
$_GET[
'return'] && !strstr(
$_GET[
'return'], $this->_loginPage)) {
114 $this->auth->setAuthData(
'returnUrl',
$_GET[
'return']);
117 if(!empty(
$_GET[
'authstatus']) && $this->auth->status ==
'') {
118 $this->auth->status =
$_GET[
'authstatus'];
134 $this->autoRedirectBack = $flag;
150 $returnUrl = $this->auth->getAuthData(
'returnUrl');
152 $returnUrl = $this->_defaultPage;
157 if(strpos($returnUrl,
'?') ===
false) {
160 $returnUrl .= uniqid(
'');
163 if($this->auth->status !=
'') {
164 $url .=
'&authstatus='.$this->auth->status;
166 header(
'Location:'.$returnUrl);
167 print(
"You could not be redirected to <a href=\"$returnUrl\">$returnUrl</a>");
187 $url = $this->_loginPage;
188 if(strpos($url,
'?') ===
false) {
192 if(!strstr($_SERVER[
'PHP_SELF'], $this->_loginPage)) {
193 $url .=
'return='.urlencode($_SERVER[
'PHP_SELF']);
197 if($this->auth->status !=
'') {
198 $url .=
'&authstatus='.$this->auth->status;
201 header(
'Location:'.$url);
202 print(
"You could not be redirected to <a href=\"$url\">$url</a>");
223 if(!strstr($_SERVER[
'PHP_SELF'], $this->_loginPage) && !$this->auth->checkAuth()) {
226 $this->auth->start();
228 if(strstr($_SERVER[
'PHP_SELF'], $this->_loginPage) && $this->auth->checkAuth()){
229 $this->autoRedirectBack ?
247 return($this->auth->checkAuth());
259 return($this->auth->checkAuth());
271 return($this->auth->logout());
283 return($this->auth->getUsername());
295 return($this->auth->getStatus());
getUsername()
Proxy call to auth.
isAuthorised()
Checks is the user is logged on.
checkAuth()
Proxy call to auth.
start()
Starts the Auth Procedure.
redirectLogin()
Redirects to the login Page if not authorised.
redirectBack()
Redirects Back to the calling page.
getStatus()
Proxy call to auth.
Auth_Controller(&$auth_obj, $login='login.php', $default='index.php', $accessList=array())
Constructor.
logout()
Proxy call to auth.
setAutoRedirectBack($flag=true)
Enables auto redirection when login is done.