Source for file debuguser.php
Documentation is available at debuguser.php
* @package Joomla.Administrator
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
require_once JPATH_COMPONENT .
'/helpers/debug.php';
* Methods supporting a list of user records.
* @package Joomla.Administrator
* Get a list of the actions.
$component =
$this->getState('filter.component');
* Override getItems method.
$userId =
$this->getState('filter.user_id');
if (($assets =
parent::getItems()) &&
$userId)
foreach ($assets as &$asset)
$asset->checks =
array();
foreach ($actions as $action)
// Check that we check this action for the level of the asset.
if ($level ===
null ||
$level >=
$asset->level)
// We need to test this action.
$asset->checks[$name] =
JAccess::check($userId, $name, $asset->name);
// We ignore this action.
$asset->checks[$name] =
'skip';
* Method to auto-populate the model state.
* Note. Calling getState in this method will result in recursion.
protected function populateState($ordering =
null, $direction =
null)
// Adjust the context to support modal layouts.
$layout =
$app->input->get('layout', 'default');
// Load the filter state.
$this->setState('filter.search', $search);
$this->setState('filter.user_id', $value);
$this->setState('filter.level_start', $levelStart);
if ($value >
0 &&
$value <
$levelStart)
$this->setState('filter.level_end', $value);
$this->setState('filter.component', $component);
// List state information.
* Method to get a store id based on model configuration state.
* This is necessary because the model is used by the component and
* different modules that might need different sets of data or different
* @param string $id A prefix for the store id.
* @return string A store id.
$id .=
':' .
$this->getState('filter.search');
$id .=
':' .
$this->getState('filter.user_id');
$id .=
':' .
$this->getState('filter.level_start');
$id .=
':' .
$this->getState('filter.level_end');
$id .=
':' .
$this->getState('filter.component');
* Get the user being debugged.
$userId =
$this->getState('filter.user_id');
* Build an SQL query to load the list data.
// Create a new query object.
$query =
$db->getQuery(true);
// Select the required fields from the table.
'a.id, a.name, a.title, a.level, a.lft, a.rgt'
$query->from($db->quoteName('#__assets') .
' AS a');
// Filter the items over the group id if set.
if ($groupId =
$this->getState('filter.group_id'))
$query->join('LEFT', '#__user_usergroup_map AS map2 ON map2.user_id = a.id')
->where('map2.group_id = ' . (int)
$groupId);
// Filter the items over the search string if set.
// Escape the search token.
$token =
$db->quote('%' .
$db->escape($this->getState('filter.search')) .
'%');
// Compile the different search clauses.
$searches[] =
'a.name LIKE ' .
$token;
$searches[] =
'a.title LIKE ' .
$token;
// Add the clauses to the query.
$query->where('(' .
implode(' OR ', $searches) .
')');
// Filter on the start and end levels.
$levelStart = (int)
$this->getState('filter.level_start');
$levelEnd = (int)
$this->getState('filter.level_end');
if ($levelEnd >
0 &&
$levelEnd <
$levelStart)
$query->where('a.level >= ' .
$levelStart);
$query->where('a.level <= ' .
$levelEnd);
// Filter the items over the component if set.
if ($this->getState('filter.component'))
$component =
$this->getState('filter.component');
$query->where('(a.name = ' .
$db->quote($component) .
' OR a.name LIKE ' .
$db->quote($component .
'.%') .
')');
// Add the list ordering clause.
$query->order($db->escape($this->getState('list.ordering', 'a.lft')) .
' ' .
$db->escape($this->getState('list.direction', 'ASC')));
Documentation generated on Tue, 19 Nov 2013 14:58:05 +0100 by phpDocumentor 1.4.3