cvs: pear /LiveUser LiveUser.php
| From: | Lukas Smith | Date: | Thu, 20 Jan 2005 22:47:05 +0000 |
| Subject: | cvs: pear /LiveUser LiveUser.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-28711@lists.php.net to get a copy of this message | ||
lsmith Thu Jan 20 17:47:05 2005 EDT
Modified files:
/pear/LiveUser LiveUser.php
Log:
- ensure that backend init errors are returned to the user
http://cvs.php.net/diff.php/pear/LiveUser/LiveUser.php?r1=1.32&r2=1.33&ty=u
Index: pear/LiveUser/LiveUser.php
diff -u pear/LiveUser/LiveUser.php:1.32 pear/LiveUser/LiveUser.php:1.33
--- pear/LiveUser/LiveUser.php:1.32 Fri Jan 14 18:44:38 2005
+++ pear/LiveUser/LiveUser.php Thu Jan 20 17:47:04 2005
@@ -156,7 +156,7 @@
* @author Lukas Smith <smith@backendmedia.com>
* @author Pierre-Alain Joye <pajoye@php.net>
* @author Arnaud Limbourg <arnaud@php.net>
- * @version $Id: LiveUser.php,v 1.32 2005/01/14 23:44:38 lsmith Exp $
+ * @version $Id: LiveUser.php,v 1.33 2005/01/20 22:47:04 lsmith Exp $
* @package LiveUser
*/
class LiveUser
@@ -957,13 +957,20 @@
//loop into auth containers
while ($backend_cnt > $counter) {
$auth = &$this->authFactory($this->authContainers[$backends[$counter]],
$backends[$counter]);
+ if ($auth === false) {
+ return false;
+ }
$auth->login($handle, $passwd, true);
if ($auth->loggedIn) {
$this->_auth = $auth;
$this->_auth->backendArrayIndex = $backends[$counter];
// Create permission object
if (is_array($this->permContainer)) {
- $this->_perm =& $this->permFactory($this->permContainer);
+ $perm =& $this->permFactory($this->permContainer);
+ if ($perm === false) {
+ return false;
+ }
+ $this->_perm =& $perm;
$this->_perm->mapUser($this->_auth->authUserId,
$this->_auth->backendArrayIndex);
}
$this->freeze();
@@ -1004,13 +1011,20 @@
{
$containerName =
$_SESSION[$this->_options['session']['varname']]['auth_name'];
$auth = &$this->authFactory($this->authContainers[$containerName],
$containerName);
+ if ($auth === false) {
+ return false;
+ }
if
($auth->unfreeze($_SESSION[$this->_options['session']['varname']]['auth']))
{
$auth->backendArrayIndex =
$_SESSION[$this->_options['session']['varname']]['auth_name'];
$this->_auth = &$auth;
if
(isset($_SESSION[$this->_options['session']['varname']]['perm'])
&&
$_SESSION[$this->_options['session']['varname']]['perm']
) {
- $this->_perm = &$this->permFactory($this->permContainer);
+ $perm = &$this->permFactory($this->permContainer);
+ if ($perm === false) {
+ return $perm:
+ }
+ $this->_perm = &$perm;
if ($this->_options['cache_perm']) {
$this->_perm->unfreeze($this->_options['session']['varname']);
} else {