cvs: pear /LiveUser_Admin Admin.php
| From: | Lukas Smith | Date: | Sun, 20 Feb 2005 22:53:26 +0000 |
| Subject: | cvs: pear /LiveUser_Admin Admin.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-29576@lists.php.net to get a copy of this message | ||
lsmith Sun Feb 20 17:53:26 2005 EDT
Modified files:
/pear/LiveUser_Admin Admin.php
Log:
- added error stack calls that were missing
http://cvs.php.net/diff.php/pear/LiveUser_Admin/Admin.php?r1=1.28&r2=1.29&ty=u
Index: pear/LiveUser_Admin/Admin.php
diff -u pear/LiveUser_Admin/Admin.php:1.28 pear/LiveUser_Admin/Admin.php:1.29
--- pear/LiveUser_Admin/Admin.php:1.28 Sun Feb 20 09:50:03 2005
+++ pear/LiveUser_Admin/Admin.php Sun Feb 20 17:53:25 2005
@@ -57,7 +57,7 @@
* @author Bjoern Kraus <krausbn@php.net>
* @copyright 2002-2005 Markus Wolff
* @license http://www.gnu.org/licenses/lgpl.txt
- * @version CVS: $Id: Admin.php,v 1.28 2005/02/20 14:50:03 dufuz Exp $
+ * @version CVS: $Id: Admin.php,v 1.29 2005/02/20 22:53:25 lsmith Exp $
* @link http://pear.php.net/LiveUser_Admin
*/
@@ -285,6 +285,8 @@
function setConfArray($conf)
{
if (!is_array($conf)) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Missing configuration array'));
return false;
}
@@ -312,6 +314,8 @@
|| !is_object($this->_authContainers[$authName])
) {
if (!isset($this->_conf['authContainers'][$authName])) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Could not create auth container
instance'));
return false;
}
$auth = &LiveUser::authFactory(
@@ -347,6 +351,8 @@
function setAdminPermContainer()
{
if (!isset($this->_conf['permContainer'])) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Could not create perm container instance'));
return false;
}
@@ -376,6 +382,8 @@
function setAdminContainers($authId = null, $authName = null)
{
if (!is_array($this->_conf)) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Missing configuration array'));
return false;
}
@@ -408,15 +416,23 @@
}
}
- if (isset($authName)) {
- if (!isset($this->perm) || !is_object($this->perm)) {
- $perm_res = $this->setAdminPermContainer();
+ if (!isset($authName)) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Could not determine what auth container to
use'));
+ return false;
+ }
+
+ if (!$this->setAdminAuthContainer($authName)) {
+ return false;
+ }
+
+ if (!isset($this->perm) || !is_object($this->perm)) {
+ if (!$this->setAdminPermContainer()) {
+ return false;
}
- $auth_res = $this->setAdminAuthContainer($authName);
- return (!$perm_res || !$auth_res) ? false : true;
}
- return false;
+ return true;
}
/**
@@ -516,6 +532,8 @@
);
if (!$permData) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Could not find user in the permission
backend'));
return false;
}
@@ -559,6 +577,8 @@
);
if (!$permData) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Could not find user in the permission
backend'));
return false;
}
@@ -609,7 +629,9 @@
$permFilter = array('filters' => $permFilter);
$permFilter['select'] = $first ? 'row' : 'all';
$permUsers = $this->perm->getUsers($permFilter);
- if ($permUsers === false) {
+ if (!$permUsers) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Could not find user in the permission
backend'));
return false;
}
@@ -665,7 +687,9 @@
}
$authUsers = $this->auth->getUsers($authFilter);
- if ($authUsers === false) {
+ if (!$authUsers) {
+ $this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
+ array('msg' => 'Could not find user in the authentication
backend'));
return false;
}