| Server IP : 180.180.241.3 / Your IP : 216.73.216.216 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/administrator/components/com_simple_review/classes/ |
Upload File : |
<?php
/**
* $Id $
*
* Copyright (C) 2005-2011 Rowan Youngson
*
* This file is part of Simple Review.
*
* Simple Review is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Simple Review 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 General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Simple Review. If not, see <http://www.gnu.org/licenses/>.
*/
/** ensure this file is being included by a parent file */
defined( '_JEXEC' ) or die('Direct Access to this location is not allowed.');
class SRBridgeUser extends SRBridgeUserBase
{
function SRBridgeUser($userNameOrID=null)
{
$this->Acl =& JFactory::getACL();
//see joomla1.5\libraries\joomla\user\authorization.php
/*
$this->Acl->addACL( 'com_simple_review', 'viewAdmin', 'users', 'super administrator' );
$this->Acl->addACL( 'com_simple_review', 'viewAdmin', 'users', 'administrator' );
$this->Acl->addACL( 'com_simple_review', 'viewAdmin', 'users', 'manager' );
*/
$this->AddPermission('Administration', 'view', 'super administrator' );
$this->AddPermission('Administration', 'view', 'administrator' );
$this->AddPermission('Administration', 'view', 'manager' );
if($userNameOrID == null)
{
$this->_User =& JFactory::getUser();
}
else
{
$this->_User =& JFactory::getUser($userNameOrID);
}
if($this->_User != null)
{
$this->Name = $this->_User->name;
$this->UserName = $this->_User->username;
$this->ID = $this->_User->guest ? 0 : $this->_User->id;
$this->IP = getenv('REMOTE_ADDR');
}
}
function CanViewAdmin()
{
return $this->CanPerformTask('Administration', 'view');
}
function AddPermission($addonName, $task, $userGroup)
{
$this->Acl->addACL( 'com_simple_review', $addonName.'::'.$task , 'users', $userGroup );
}
function CanPerformTask($addonName, $task)
{
return $this->_User->authorize( 'com_simple_review', $addonName.'::'.$task );
}
function GetAllUsers()
{
$query = 'SELECT a.*, g.name AS groupname '
.'FROM #__users AS a '
.'INNER JOIN #__core_acl_aro AS aro ON aro.value = a.id '
.'INNER JOIN #__core_acl_groups_aro_map AS gm ON gm.aro_id = aro.id '
.'INNER JOIN #__core_acl_aro_groups AS g ON g.id = gm.group_id '
.'GROUP BY a.id '
.'ORDER BY a.name ';
return SRBridgeDatabase::Query($query);
//return JHTML::_('list.users', $controlID, $selected);
}
}
?>