| Server IP : 195.130.67.5 / Your IP : 216.73.216.231 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/icd/jeventsComp/admin/models/ |
Upload File : |
<?php
/**
* JEvents Component for Joomla 1.5.x
*
* @version $Id: user.php 1678 2010-01-22 03:08:58Z geraint $
* @package JEvents
* @copyright Copyright (C) 2008-2009 GWE Systems Ltd
* @license GNU/GPLv2, see http://www.gnu.org/licenses/gpl-2.0.html
* @link http://www.jevents.net
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
jimport( 'joomla.application.component.model' );
JLoader::import("jevuser",JPATH_COMPONENT_ADMINISTRATOR."/tables/");
/**
* @package Joom!Fish
* @subpackage User
*/
class AdminUserModelUser extends JModel
{
/**
* @var string name of the current model
* @access private
*/
var $_modelName = 'user';
/**
* @var array list of current users
* @access private
*/
var $_users = null;
/**
* Pagination object
*
* @var object
*/
var $_pagination = null;
/**
* default constrcutor
*/
function __construct() {
parent::__construct();
$app = &JFactory::getApplication();
$option = JRequest::getVar('option', '');
// Get the pagination request variables
$limit = $app->getUserStateFromRequest( 'global.list.limit', 'limit', $app->getCfg('list_limit'), 'int' );
$limitstart = $app->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' );
// In case limit has been changed, adjust limitstart accordingly
$limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);
$this->setState('limit', $limit);
$this->setState('limitstart', $limitstart);
}
/**
* return the model name
*/
function getName() {
return $this->_modelName;
}
/**
* Method to get a pagination object for the weblinks
*
* @access public
* @return integer
*/
function getPagination()
{
// Lets load the content if it doesn't already exist
if (empty($this->_pagination))
{
jimport('joomla.html.pagination');
$this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );
}
return $this->_pagination;
}
/**
* generic method to load the user related data
* @return array of users
*/
function getUsers() {
TableUser::checkTable();
if($this->_users == null) {
$this->_loadUsers();
}
return $this->_users;
}
/**
* generic method to load the user related data
* @return array of users
*/
function getUser() {
$cid = JRequest::getVar("cid",array(0));
JArrayHelper::toInteger($cid);
if (count($cid)>0){
$id=$cid[0];
}
else $id=0;
$user = new TableUser();
if ($id>0){
$user->load($id);
}
return $user;
}
/**
* Method to store user information
*/
function store($cid, $data) {
$user = new TableUser();
if ($cid>0){
$user->load($cid);
}
// fix the calendars and categories fields
if ($data['calendars']=='select') $data['calendars']=array();
if ($data['categories']=='select') $data['categories']=array();
return $user->save($data);
}
function gettotal(){
return TableUser::getUserCount();
}
/**
* Method to load the users in the system
*
* @return void
*/
function _loadUsers(){
$this->_users= TableUser::getUsers();
}
}