cvs: pear /Auth/Auth Controller.php

From: Date: Sun, 04 Jul 2004 17:59:36 +0000
Subject: cvs: pear /Auth/Auth Controller.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-21498@lists.php.net to get a copy of this message
yavo Sun Jul 4 13:59:36 2004 EDT Modified files: /pear/Auth/Auth Controller.php Log: Try to preserve the auth status when redirects are performed http://cvs.php.net/diff.php/pear/Auth/Auth/Controller.php?r1=1.5&r2=1.6&ty=u Index: pear/Auth/Auth/Controller.php diff -u pear/Auth/Auth/Controller.php:1.5 pear/Auth/Auth/Controller.php:1.6 --- pear/Auth/Auth/Controller.php:1.5 Thu Jun 10 03:16:59 2004 +++ pear/Auth/Auth/Controller.php Sun Jul 4 13:59:36 2004 @@ -30,7 +30,7 @@ class Auth_Controller { /** var Auth An auth instance */ - var $auth_obj = null; + var $auth = null; /** var string The login url */ var $login = null; /** 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 */ @@ -58,8 +58,10 @@ #print "Return: {$_GET['return']} <br/>"; $this->auth->setAuthData('returnUrl', $_GET['return']); } - - //if() + + if(!empty($_GET['authstatus']) && $this->auth->status == '') { + $this->auth->status = $_GET['authstatus']; + } } /** @@ -91,7 +93,11 @@ $returnUrl .= '?'; } $returnUrl .= uniqid(''); - + + // Track the auth status + if($this->auth->status != '') { + $url .= '&authstatus='.$this->auth->status; + } header('Location:'.$returnUrl); print("You could not be redirected to <a href=\"$returnUrl\">$returnUrl</a>"); } @@ -117,6 +123,10 @@ if(!strstr($_SERVER['PHP_SELF'], $this->_loginPage)) { $url .= 'return='.urlencode($_SERVER['PHP_SELF']); } + // Track the auth status + if($this->auth->status != '') { + $url .= '&authstatus='.$this->auth->status; + } header('Location:'.$url); print("You could not be redirected to <a href=\"$url\">$url</a>"); } @@ -193,4 +203,4 @@ } -?> \ No newline at end of file +?>

« previous php.pear.cvs (#21498) next »