- md5
- dea7ed48778b9149774d23f6a6104320
- sha1
- 51d8d97a5f063a8f860b9cc65b5c43db2660dbfb
- sha256
- 1714300def476fa6a4fefc3f08746882804fc55d85db25d677b89c1ceda4afeb
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
<?php
/**
* @version $Id: level.php 22355 2011-11-07 05:11:58Z github_bot $
* @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();
}
elseif (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 3 releases, Joomla 1.7.3 to 1.7.5. See them all, or every version of this file.