- md5
- 5ec751202bfac513f93b844f09dcd5be
- sha1
- ed5a8e70b0455f6be2f5e1b0e7de82565ed1cc04
- sha256
- 78cbd254de39ec37dd95855d952a58f121633527f7324644ceb5621aed30c100
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
<?php
/**
* @version $Id: level.php 20232 2011-01-10 01:52:10Z eddieajau $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
jimport('joomla.application.component.controllerform');
/**
* User view level controller class.
*
* @package Joomla.Administrator
* @subpackage com_users
* @since 1.6
*/
class UsersControllerLevel extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_LEVEL';
/**
* Method to check if you can save a new or existing record.
*
* Overrides JControllerForm::allowSave to check the core.admin permission.
*
* @param array An array of input data.
* @param string The name of the key for the primary key.
*
* @return boolean
* @since 1.6
*/
protected function allowSave($data, $key = 'id')
{
return (JFactory::getUser()->authorise('core.admin', $this->option) && parent::allowSave($data, $key));
}
/**
* Method to remove a record.
*/
public function delete()
{
// Check for request forgeries.
JRequest::checkToken() or jexit(JText::_('JInvalid_Token'));
// Initialise variables.
$user = JFactory::getUser();
$ids = JRequest::getVar('cid', array(), '', 'array');
if (!JFactory::getUser()->authorise('core.admin', $this->option)) {
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
else if (empty($ids)) {
JError::raiseWarning(500, JText::_('COM_USERS_NO_LEVELS_SELECTED'));
}
else {
// Get the model.
$model = $this->getModel();
JArrayHelper::toInteger($ids);
// Remove the items.
if (!$model->delete($ids)) {
JError::raiseWarning(500, $model->getError());
}
else {
$this->setMessage(JText::plural('COM_USERS_N_LEVELS_DELETED', count($ids)));
}
}
$this->setRedirect('index.php?option=com_users&view=levels');
}
}
The same content is in 10 releases, Joomla 1.6.0 to 1.7.2. See them all, or every version of this file.