More fixes related to password reset

This commit is contained in:
Deon George
2013-04-21 23:10:38 +10:00
parent 79c76995b9
commit 3ce74636f7
4 changed files with 6 additions and 15 deletions

View File

@@ -21,11 +21,6 @@ class Auth_OSB extends Auth_ORM {
* @return boolean
*/
public function logged_in($role=NULL,$debug=NULL) {
static $status = NULL;
if (! is_null($status))
return $status;
$status = FALSE;
// Get the user from the session
@@ -109,11 +104,6 @@ class Auth_OSB extends Auth_ORM {
$status = TRUE;
}
// Check and see if we have a token to login and run the method
} elseif ((! empty($_REQUEST['token']) AND $token = $_REQUEST['token']) OR $token=Session::instance()->get('token')) {
if (! is_null($this->_get_token_user($token)))
$status = TRUE;
} else {
if (Config::sitemode() == Kohana::DEVELOPMENT)
SystemMessage::add(array('title'=>'Debug','type'=>'debug','body'=>'No user logged in'));
@@ -130,10 +120,11 @@ class Auth_OSB extends Auth_ORM {
* @return mixed
*/
public function get_user($default=NULL,$tokenuser=TRUE) {
// Get the current user
$uo = parent::get_user($default);
// If we are not logged in, see if there is token for the user
if (is_null($uo) AND $tokenuser AND $token=Session::instance()->get('token'))
if (is_null($uo) AND $tokenuser AND ($token=Session::instance()->get('token')) OR (! empty($_REQUEST['token']) AND $token=$_REQUEST['token']))
$uo = $this->_get_token_user($token);
return $uo;