cvs: pear /LiveUser_Admin/Perm Complex.php
| From: | Lukas Smith | Date: | Fri, 11 Mar 2005 11:36:48 +0000 |
| Subject: | cvs: pear /LiveUser_Admin/Perm Complex.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-30200@lists.php.net to get a copy of this message | ||
lsmith Fri Mar 11 06:36:48 2005 EDT
Modified files:
/pear/LiveUser_Admin/Perm Complex.php
Log:
- _updateImpliedStatus() couldnt handle arbitrary filters
http://cvs.php.net/diff.php/pear/LiveUser_Admin/Perm/Complex.php?r1=1.53&r2=1.54&ty=u
Index: pear/LiveUser_Admin/Perm/Complex.php
diff -u pear/LiveUser_Admin/Perm/Complex.php:1.53 pear/LiveUser_Admin/Perm/Complex.php:1.54
--- pear/LiveUser_Admin/Perm/Complex.php:1.53 Fri Mar 11 06:10:21 2005
+++ pear/LiveUser_Admin/Perm/Complex.php Fri Mar 11 06:36:48 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: Complex.php,v 1.53 2005/03/11 11:10:21 lsmith Exp $
+ * @version CVS: $Id: Complex.php,v 1.54 2005/03/11 11:36:48 lsmith Exp $
* @link http://pear.php.net/LiveUser_Admin
*/
@@ -541,50 +541,27 @@
*/
function _updateImpliedStatus($filters)
{
- $count = $this->_storage->selectCount('right_implied',
'right_id', $filters);
- if ($count === false) {
+ $params = array(
+ 'fields' => array('right_id'),
+ 'filters' => $filters,
+ 'select' => 'col',
+ );
+
+ $rights = $this->getRights($params);
+ if ($rights === false) {
return false;
}
- if (isset($filters['right_id'])) {
- $rightId = $filters['right_id'];
- } elseif (isset($filters['implied_right_id'])) {
- $params = array(
- 'fields' => array(
- 'right_id'
- ),
- 'filters' => array(
- 'implied_right_id' => $filters['implied_right_id']
- )
- );
+ $filters = array('right_id' => $rights);
- $result = $this->getRights($params);
- if ($result === false) {
- return false;
- }
-
- if (empty($result)) {
- $this->_stack->push(
- LIVEUSER_ADMIN_ERROR, 'exception',
- array('msg' => 'No right implies right id ' .
$filters['implied_right_id'])
- );
- return false;
- }
-
- $rightId = $result['right_id'];
- } else {
- $this->_stack->push(
- LIVEUSER_ADMIN_ERROR, 'exception',
- array('msg' => 'Neither right_id nor implied_right_id were set
- in the filter.')
- );
+ $count = $this->_storage->selectCount('right_implied',
'right_id', $filters);
+ if ($count === false) {
return false;
}
$data = array('has_implied' => (bool)$count);
- $filter = array('right_id' => $rightId);
- $result = $this->updateRight($data, $filter);
+ $result = $this->updateRight($data, $filters);
if ($result === false) {
return false;
}