cvs: pear /LiveUser_Admin/Perm Complex.php

From: Date: Wed, 08 Dec 2004 01:29:06 +0000
Subject: cvs: pear /LiveUser_Admin/Perm Complex.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-27063@lists.php.net to get a copy of this message
dufuz Tue Dec 7 20:29:06 2004 EDT Modified files: /pear/LiveUser_Admin/Perm Complex.php Log: Some untested functions added. http://cvs.php.net/diff.php/pear/LiveUser_Admin/Perm/Complex.php?r1=1.3&r2=1.4&ty=u Index: pear/LiveUser_Admin/Perm/Complex.php diff -u pear/LiveUser_Admin/Perm/Complex.php:1.3 pear/LiveUser_Admin/Perm/Complex.php:1.4 --- pear/LiveUser_Admin/Perm/Complex.php:1.3 Tue Dec 7 18:07:15 2004 +++ pear/LiveUser_Admin/Perm/Complex.php Tue Dec 7 20:29:06 2004 @@ -36,7 +36,7 @@ * @author Christian Dickmann <dickmann@php.net> * @author Markus Wolff <wolff@21st.de> * @author Matt Scifo <mscifo@php.net> - * @version $Id: Complex.php,v 1.3 2004/12/07 23:07:15 lsmith Exp $ + * @version $Id: Complex.php,v 1.4 2004/12/08 01:29:06 dufuz Exp $ * @package LiveUser */ class LiveUser_Admin_Perm_Complex extends LiveUser_Admin_Perm_Medium @@ -55,77 +55,135 @@ function removeArea($filters) { + // sanity checks + if (!isset($filters['area_id']) || !is_numeric($filters['area_id'])) { + $this->_stack->push( + LIVEUSER_ADMIN_ERROR_FILTER, 'exception', + array('key' => 'area_id') + ); + return false; + } + // remove admin areas stuff $this->_storage->delete('area_admin_areas', $filters); - parent::removeArea(); + parent::removeArea($filters); } - function assignSubGroup() + function assignSubGroup($data, $filters) { } - function unassignSubGroup() + function unassignSubGroup($filters) { } - function removeGroup() + function removeGroup($filters) { } - function getParentGroup() + function _updateImpliedStatus($filters) { + // sanity checks + if (!isset($filters['right_id']) || !is_numeric($filters['right_id'])) { + $this->_stack->push( + LIVEUSER_ADMIN_ERROR_FILTER, 'exception', + array('key' => 'right_id') + ); + return false; + } + + $count = $this->_storage->selectOne('rights_implied', 'right_id', $filters, true); + if (!$count) { + return false; + } + $data = array(); + $data['implied'] = (int)$count == '0' ? 'Y' : 'N'; + + $this->updateRight($data, $filters); + if (!$result) { + return false; + } + // notify observer + return true; } - function _updateImpliedStatus() + function implyRight($data, $filters) { } - function implyRight() + function unimplyRight($filters) { } - function unimplyRight() + function removeRight($filters) { + // sanity checks + if (!isset($filters['right_id']) || !is_numeric($filters['right_id'])) { + $this->_stack->push( + LIVEUSER_ADMIN_ERROR_FILTER, 'exception', + array('key' => 'right_id') + ); + return false; + } + $this->_storage->delete('rights_implied', $filters); + parent::removeRight($filters); + + return $this->_updateImpliedStatus($filters); } - function removeRight() + function removeUser($filters) { - parent::removeRight(); + // sanity checks + if (!isset($filters['perm_user_id']) || !is_numeric($filters['perm_user_id'])) { + $this->_stack->push( + LIVEUSER_ADMIN_ERROR_FILTER, 'exception', + array('key' => 'perm_user_id') + ); + return false; + } + + $data = array('owner_user_id' => 'NULL'); + $result = $this->_storage->update('groups', $data, $filters); + if (!$result) { + return false; + } + + parent::removeUser($filters); } - function getGroups() + function _updateLevelStatus() { } - function getRights() + function getParentGroup() { } - function getImpliedRights() + function getGroups() { } - function getInheritedRights() + function getRights() { } - function removeUser() + function getImpliedRights() { - parent::removeUser(); + } - function _updateLevelStatus() + function getInheritedRights() { }

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