Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- parse error fix

- only assign the perm instance to _perm if the mapping/unfreeze method call was successful


git-svn-id: http://svn.php.net/repository/pear/packages/LiveUser/trunk@193502 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 329199f6ac55b65e46f9a1475cc267f6a2bcdf41 1 parent ab83491
Lukas Smith authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 LiveUser.php
View
15 LiveUser.php
@@ -1034,7 +1034,7 @@ function login($handle = '', $passwd = '', $remember = false)
continue;
}
$auth =& LiveUser::authFactory($this->authContainers[$index], $index);
- if ($auth === false || $auth->login($handle, $passwd)) === false) {
+ if ($auth === false || $auth->login($handle, $passwd) === false) {
$this->status = LIVEUSER_STATUS_AUTHINITERROR;
return false;
}
@@ -1046,9 +1046,10 @@ function login($handle = '', $passwd = '', $remember = false)
$this->status = LIVEUSER_STATUS_PERMINITERROR;
return false;
}
- $this->_perm =& $perm;
- if (!$this->_perm->mapUser($auth->getProperty('auth_user_id'), $index)) {
+ if (!$perm->mapUser($auth->getProperty('auth_user_id'), $index)) {
$this->dispatcher->post($this, 'onFailedMapping');
+ } else {
+ $this->_perm =& $perm;
}
}
$this->_auth = $auth;
@@ -1118,11 +1119,13 @@ function unfreeze()
if ($perm === false) {
return $perm;
}
- $this->_perm = &$perm;
if ($this->_options['cache_perm']) {
- $this->_perm->unfreeze($this->_options['session']['varname']);
+ $result = $perm->unfreeze($this->_options['session']['varname']);
} else {
- $this->_perm->mapUser($auth->getProperty('auth_user_id'), $auth->backendArrayIndex);
+ $result = $perm->mapUser($auth->getProperty('auth_user_id'), $auth->backendArrayIndex);
+ }
+ if ($result) {
+ $this->_perm = &$perm;
}
}
$this->status = LIVEUSER_STATUS_UNFROZEN;
Please sign in to comment.
Something went wrong with that request. Please try again.