Source for file Medium.php
Documentation is available at Medium.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* A framework for authentication and authorization in PHP applications
* LiveUser is an authentication/permission framework designed
* to be flexible and easily extendable.
* Since it is impossible to have a
* "one size fits all" it takes a container
* approach which should enable it to
* be versatile enough to meet most needs.
* LICENSE: This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* @category authentication
* @author Markus Wolff <wolff@21st.de>
* @author Helgi Þormar Þorbjörnsson <dufuz@php.net>
* @author Lukas Smith <smith@pooteeweet.org>
* @author Arnaud Limbourg <arnaud@php.net>
* @author Pierre-Alain Joye <pajoye@php.net>
* @author Bjoern Kraus <krausbn@php.net>
* @copyright 2002-2006 Markus Wolff
* @license http://www.gnu.org/licenses/lgpl.txt
* @version CVS: $Id: Medium.php,v 1.27 2006/04/10 14:41:44 lsmith Exp $
* @link http://pear.php.net/LiveUser
* @category authentication
* Require parent class definition.
require_once 'LiveUser/Perm/Simple.php';
* Medium container for permission handling
* Medium permission complexity driver for LiveUser.
* @category authentication
* @author Arnaud Limbourg
* @copyright 2002-2006 Markus Wolff
* @license http://www.gnu.org/licenses/lgpl.txt
* @version Release: @package_version@
* @link http://pear.php.net/LiveUser
* One-dimensional array containing all the groups
* ids for the actual user.
* One-dimensional array containing all the groups
* ids for the actual user without subgroups.
* One-dimensional array containing only the group
* rights for the actual user.
* Format: "RightId" => "Level"
* Reads all rights of current user into an
* Group rights and invididual rights are being merged
* @return bool true on success or false on failure
$result = $this->readGroupRights ($this->group_ids);
// Check if user has individual rights...
// Overwrite values from temporary array with values from userrights
// Revoking rights: A negative value indicates a maximum
$this->right_ids[$right] = min($groupRights[$right], $max_allowed_level);
$this->right_ids[$right] = max($groupRights[$right], $level);
unset ($groupRights[$right]);
* Read all the groups in which the user is a member
* @param int perm user id
* @return array requested data or false on failure
function readGroups ($perm_user_id)
$result = $this->_storage->readGroups ($perm_user_id);
* Reads all rights of the groups into an
* @return array requested data or false on failure
function readGroupRights ($group_ids)
$result = $this->_storage->readGroupRights ($group_ids);
* Checks if the current user is a member of a certain group
* If $this->ondemand and $ondemand is true, the groups will be loaded on
* @param int Id of the group to check for.
function checkGroup ($group_id)
Documentation generated on Mon, 28 Jan 2008 03:30:27 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|