[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/modules/mod_logged/ -> mod_logged.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: mod_logged.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla
   5  * @copyright        Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   6  * @license        GNU/GPL, see LICENSE.php
   7  * Joomla! is free software. This version may have been modified pursuant
   8  * to the GNU General Public License, and as distributed it includes or
   9  * is derivative of works licensed under the GNU General Public License or
  10  * other free or open source software licenses.
  11  * See COPYRIGHT.php for copyright notices and details.
  12  */
  13  
  14  // no direct access
  15  defined( '_JEXEC' ) or die( 'Restricted access' );
  16  
  17  jimport('joomla.html.pagination');
  18  
  19  $db                =& JFactory::getDBO();
  20  $user            =& JFactory::getUser();
  21  
  22  // TODO -  pagination needs to be completed in module
  23  $limit         = $mainframe->getUserStateFromRequest('limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
  24  $limitstart = $mainframe->getUserStateFromRequest('mod_logged.limitstart', 'limitstart', 0, 'int');
  25  
  26  // hides Administrator or Super Administrator from list depending on usertype
  27  $and = '';
  28  // administrator check
  29  if ( $user->get('gid') == 24 ) {
  30      $and = ' AND gid != "25"';
  31  }
  32  // manager check
  33  if ( $user->get('gid') == 23 ) {
  34      $and = ' AND gid != "25"';
  35      $and .= ' AND gid != "24"';
  36  }
  37  
  38  // get the total number of records
  39  $query = 'SELECT COUNT(*)'
  40      . ' FROM #__session'
  41      . ' WHERE userid != 0'
  42      . $and
  43      . ' ORDER BY usertype, username'
  44      ;
  45  $db->setQuery( $query );
  46  $total = $db->loadResult();
  47  
  48  // page navigation
  49  $pageNav = new JPagination( $total, $limitstart, $limit );
  50  
  51  $query = 'SELECT username, time, userid, usertype, client_id'
  52  . ' FROM #__session'
  53  . ' WHERE userid != 0'
  54  . $and
  55  . ' ORDER BY usertype, username'
  56  ;
  57  $db->setQuery( $query );
  58  $rows = $db->loadObjectList();
  59  
  60  require( dirname( __FILE__ ).DS.'tmpl'.DS.'default.php' );


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1