cvs: pear /LiveUser LiveUser.php

From: Date: Mon, 15 Aug 2005 11:55:20 +0000
Subject: cvs: pear /LiveUser LiveUser.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33980@lists.php.net to get a copy of this message
lsmith Mon Aug 15 07:55:20 2005 EDT Modified files: /pear/LiveUser LiveUser.php Log: - parse error fix - only assign the perm instance to _perm if the mapping/unfreeze method call was successful http://cvs.php.net/diff.php/pear/LiveUser/LiveUser.php?r1=1.95&r2=1.96&ty=u Index: pear/LiveUser/LiveUser.php diff -u pear/LiveUser/LiveUser.php:1.95 pear/LiveUser/LiveUser.php:1.96 --- pear/LiveUser/LiveUser.php:1.95 Mon Aug 15 06:30:33 2005 +++ pear/LiveUser/LiveUser.php Mon Aug 15 07:55:16 2005 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2005 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: LiveUser.php,v 1.95 2005/08/15 10:30:33 lsmith Exp $ + * @version CVS: $Id: LiveUser.php,v 1.96 2005/08/15 11:55:16 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -1034,7 +1034,7 @@ 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 @@ $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 @@ 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;

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