| [ Index ] |
PHP Cross Reference of Joomla 2.5.4 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package Joomla.Administrator 4 * @subpackage mod_logged 5 * @copyright Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved. 6 * @license GNU General Public License version 2 or later; see LICENSE.txt 7 */ 8 9 // No direct access. 10 defined('_JEXEC') or die; 11 12 /** 13 * @package Joomla.Administrator 14 * @subpackage mod_logged 15 */ 16 abstract class modLoggedHelper 17 { 18 /** 19 * Get a list of logged users. 20 * 21 * @param JObject The module parameters. 22 * @return mixed An array of articles, or false on error. 23 */ 24 public static function getList($params) 25 { 26 // Initialise variables 27 $db = JFactory::getDbo(); 28 $user = JFactory::getUser(); 29 $query = $db->getQuery(true); 30 31 $query->select('s.time, s.client_id, u.id, u.name, u.username'); 32 $query->from('#__session AS s'); 33 $query->leftJoin('#__users AS u ON s.userid = u.id'); 34 $query->where('s.guest = 0'); 35 $db->setQuery($query, 0, $params->get('count', 5)); 36 $results = $db->loadObjectList(); 37 38 // Check for database errors 39 if ($error = $db->getErrorMsg()) { 40 JError::raiseError(500, $error); 41 return false; 42 }; 43 44 foreach($results as $k => $result) 45 { 46 $results[$k]->logoutLink = ''; 47 48 if($user->authorise('core.manage', 'com_users')) 49 { 50 $results[$k]->editLink = JRoute::_('index.php?option=com_users&task=user.edit&id='.$result->id); 51 $results[$k]->logoutLink = JRoute::_('index.php?option=com_login&task=logout&uid='.$result->id .'&'. JSession::getFormToken() .'=1'); 52 } 53 if($params->get('name', 1) == 0) { 54 $results[$k]->name = $results[$k]->username; 55 } 56 } 57 58 return $results; 59 } 60 61 /** 62 * Get the alternate title for the module 63 * 64 * @param JObject The module parameters. 65 * @return string The alternate title for the module. 66 */ 67 public static function getTitle($params) 68 { 69 return JText::plural('MOD_LOGGED_TITLE', $params->get('count')); 70 } 71 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Tue Apr 3 11:40:28 2012 | Cross-referenced by PHPXref 0.7.1 |