liveuser_admin _getUsersByPerm
| From: | Jeroen Houben | Date: | Fri, 14 Oct 2005 10:30:25 +0000 |
| Subject: | liveuser_admin _getUsersByPerm | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-40178@lists.php.net to get a copy of this message | ||
Hi,
I'm wondering why this method throws an exception when no users are found? It's just normal behaviour that when I specify a set of filters I may not get any results.
It's like PEAR::DB would raise an exception if I did something like
$db->getOne('SELECT email FROM table WHERE email='somecrazyemailthatdontexisst@example.com');
Or am I misinterpreting things here? I pasted the relevant code below.
Jeroen
LiverUser/Admin.php
function _getUsersByPerm($permFilter = array(), $first = false)
{
if (!is_object($this->perm)) {
$this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
array('msg' => 'Perm container not set.'));
return false;
}
$permFilter = array('filters' => $permFilter);
$permFilter['select'] = $first ? 'row' : 'all';
$permUsers = $this->perm->getUsers($permFilter);
if (!$permUsers) {
$this->_stack->push(LIVEUSER_ADMIN_ERROR, 'exception',
array('msg' => 'Could not find user in the permission backend'));
return false;
}