| 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();
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->_User->authorize('core.manage', 'com_simple_review');
}
function AddPermission($addonName, $task, $userGroup)
{
//N/A for J 1.6
}
function CanPerformTask($addonName, $task)
{
//TODO: Make more flexible http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!1.6_-_Part_14
switch($task)
{
case 'apply':
case 'save':
$task = 'edit';
break;
case 'new':
$task = 'create';
break;
case 'list':
$task = 'manage';
break;
}
$addonName = explode('_', $addonName);
$addonName = strtolower($addonName[0]);
if($addonName == 'configuration')
{
//$task = 'admin';
}
return $this->_User->authorize('core.'.$task, 'com_simple_review.'.$addonName );
}
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);
}
}
?>