| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/controllers.zip |
PK �#]��� � suggestions.json.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Suggestions JSON controller for Finder.
*
* @since 2.5
*/
class FinderControllerSuggestions extends JControllerLegacy
{
/**
* Method to find search query suggestions. Uses jQuery and autocompleter.js
*
* @return void
*
* @since 3.4
*/
public function suggest()
{
/** @var \Joomla\CMS\Application\CMSApplication $app */
$app = JFactory::getApplication();
$app->mimeType = 'application/json';
// Ensure caching is disabled as it depends on the query param in the model
$app->allowCache(false);
$suggestions = $this->getSuggestions();
// Send the response.
$app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet);
$app->sendHeaders();
echo '{ "suggestions": ' . json_encode($suggestions) . ' }';
$app->close();
}
/**
* Method to find search query suggestions. Uses Mootools and autocompleter.js
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return void
*
* @since 2.5
* @deprecated 3.4
*/
public function display($cachable = false, $urlparams = false)
{
/** @var \Joomla\CMS\Application\CMSApplication $app */
$app = JFactory::getApplication();
$app->mimeType = 'application/json';
// Ensure caching is disabled as it depends on the query param in the model
$app->allowCache(false);
$suggestions = $this->getSuggestions();
// Send the response.
$app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet);
$app->sendHeaders();
echo json_encode($suggestions);
$app->close();
}
/**
* Method to retrieve the data from the database
*
* @return array The suggested words
*
* @since 3.4
*/
protected function getSuggestions()
{
$return = array();
$params = JComponentHelper::getParams('com_finder');
if ($params->get('show_autosuggest', 1))
{
// Get the suggestions.
$model = $this->getModel('Suggestions', 'FinderModel');
$return = $model->getItems();
}
// Check the data.
if (empty($return))
{
$return = array();
}
return $return;
}
}
PK �;#]���� � application.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_config
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Controller for global configuration
*
* @since 1.5
* @deprecated 4.0
*/
class ConfigControllerApplication extends JControllerLegacy
{
/**
* Class Constructor
*
* @param array $config An optional associative array of configuration settings.
*
* @since 1.5
* @deprecated 4.0
*/
public function __construct($config = array())
{
parent::__construct($config);
// Map the apply task to the save method.
$this->registerTask('apply', 'save');
}
/**
* Method to save the configuration.
*
* @return boolean True on success, false on failure.
*
* @since 1.5
* @deprecated 4.0 Use ConfigControllerApplicationSave instead.
*/
public function save()
{
try
{
JLog::add(
sprintf('%s() is deprecated. Use ConfigControllerApplicationSave instead.', __METHOD__),
JLog::WARNING,
'deprecated'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
$controller = new ConfigControllerApplicationSave;
return $controller->execute();
}
/**
* Cancel operation.
*
* @return boolean True if successful; false otherwise.
*
* @deprecated 4.0 Use ConfigControllerApplicationCancel instead.
*/
public function cancel()
{
try
{
JLog::add(
sprintf('%s() is deprecated. Use ConfigControllerApplicationCancel instead.', __METHOD__),
JLog::WARNING,
'deprecated'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
$controller = new ConfigControllerApplicationCancel;
return $controller->execute();
}
/**
* Method to remove the root property from the configuration.
*
* @return boolean True on success, false on failure.
*
* @since 1.5
* @deprecated 4.0 Use ConfigControllerApplicationRemoveroot instead.
*/
public function removeroot()
{
try
{
JLog::add(
sprintf('%s() is deprecated. Use ConfigControllerApplicationRemoveroot instead.', __METHOD__),
JLog::WARNING,
'deprecated'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
$controller = new ConfigControllerApplicationRemoveroot;
return $controller->execute();
}
}
PK �;#]���-� �
component.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_config
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Note: this view is intended only to be opened in a popup
*
* @since 1.5
* @deprecated 4.0
*/
class ConfigControllerComponent extends JControllerLegacy
{
/**
* Class Constructor
*
* @param array $config An optional associative array of configuration settings.
*
* @since 1.5
* @deprecated 4.0
*/
public function __construct($config = array())
{
parent::__construct($config);
// Map the apply task to the save method.
$this->registerTask('apply', 'save');
}
/**
* Cancel operation
*
* @return void
*
* @since 3.0
* @deprecated 4.0 Use ConfigControllerComponentCancel instead.
*/
public function cancel()
{
try
{
JLog::add(
sprintf('%s() is deprecated. Use ConfigControllerComponentCancel instead.', __METHOD__),
JLog::WARNING,
'deprecated'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
$controller = new ConfigControllerComponentCancel;
$controller->execute();
}
/**
* Save the configuration.
*
* @return boolean True if successful; false otherwise.
*
* @deprecated 4.0 Use ConfigControllerComponentSave instead.
*/
public function save()
{
try
{
JLog::add(
sprintf('%s() is deprecated. Use ConfigControllerComponentSave instead.', __METHOD__),
JLog::WARNING,
'deprecated'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
$controller = new ConfigControllerComponentSave;
return $controller->execute();
}
}
PK C>#]��(H H sitemaps.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2007 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// no direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.controlleradmin');
/**
* @package Xmap
* @subpackage com_xmap
* @since 2.0
*/
class XmapControllerSitemaps extends JControllerAdmin
{
protected $text_prefix = 'COM_XMAP_SITEMAPS';
/**
* Constructor
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('unpublish', 'publish');
$this->registerTask('trash', 'publish');
$this->registerTask('unfeatured', 'featured');
}
/**
* Method to toggle the default sitemap.
*
* @return void
* @since 2.0
*/
function setDefault()
{
// Check for request forgeries
JRequest::checkToken() or die('Invalid Token');
// Get items to publish from the request.
$cid = JRequest::getVar('cid', 0, '', 'array');
$id = @$cid[0];
if (!$id) {
JError::raiseWarning(500, JText::_('Select an item to set as default'));
}
else
{
// Get the model.
$model = $this->getModel();
// Publish the items.
if (!$model->setDefault($id)) {
JError::raiseWarning(500, $model->getError());
}
}
$this->setRedirect('index.php?option=com_xmap&view=sitemaps');
}
/**
* Proxy for getModel.
*
* @param string $name The name of the model.
* @param string $prefix The prefix for the PHP class name.
*
* @return JModel
* @since 2.0
*/
public function getModel($name = 'Sitemap', $prefix = 'XmapModel', $config = array('ignore_request' => true))
{
$model = parent::getModel($name, $prefix, $config);
return $model;
}
}PK C>#]=I�M+ + sitemap.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2007 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.controllerform');
/**
* @package Xmap
* @subpackage com_xmap
* @since 2.0
*/
class XmapControllerSitemap extends JControllerForm
{
/**
* Method override to check if the user can edit an existing record.
*
* @param array An array of input data.
* @param string The name of the key for the primary key.
*
* @return boolean
*/
protected function _allowEdit($data = array(), $key = 'id')
{
// Initialise variables.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Assets are being tracked, so no need to look into the category.
return JFactory::getUser()->authorise('core.edit', 'com_xmap.sitemap.'.$recordId);
}
}PK C>#]�6�
index.htmlnu &1i� <!DOCTYPE html><title></title>PK UM#]�t��5 5 level.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User view level controller class.
*
* @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 $data An array of input data.
* @param string $key 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));
}
/**
* Overrides JControllerForm::allowEdit
*
* Checks that non-Super Admins are not editing Super Admins.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 3.8.8
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Get user instance
$user = JFactory::getUser();
// Check for if Super Admin can edit
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('*')
->from($db->quoteName('#__viewlevels'))
->where($db->quoteName('id') . ' = ' . (int) $data['id']);
$db->setQuery($query);
$viewlevel = $db->loadAssoc();
// Decode level groups
$groups = json_decode($viewlevel['rules']);
// If this group is super admin and this user is not super admin, canEdit is false
if (!$user->authorise('core.admin') && JAccess::checkGroup($groups[0], 'core.admin'))
{
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'));
return false;
}
return parent::allowEdit($data, $key);
}
/**
* Removes an item.
*
* Overrides JControllerAdmin::delete to check the core.admin permission.
*
* @return boolean Returns true on success, false on failure.
*
* @since 1.6
*/
public function delete()
{
// Check for request forgeries.
$this->checkToken();
$ids = (array) $this->input->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$ids = array_filter($ids);
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();
// 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');
}
}
PK UM#]ed��� � user.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User controller class.
*
* @since 1.6
*/
class UsersControllerUser extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_USER';
/**
* Overrides JControllerForm::allowEdit
*
* Checks that non-Super Admins are not editing Super Admins.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean True if allowed, false otherwise.
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check if this person is a Super Admin
if (JAccess::check($data[$key], 'core.admin'))
{
// If I'm not a Super Admin, then disallow the edit.
if (!JFactory::getUser()->authorise('core.admin'))
{
return false;
}
}
return parent::allowEdit($data, $key);
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True on success, false on failure
*
* @since 2.5
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('User', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_users&view=users' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Function that allows child controller access to model data after the data has been saved.
*
* @param JModelLegacy $model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 3.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
return;
}
}
PK UM#]�X� mail.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Users mail controller.
*
* @since 1.6
*/
class UsersControllerMail extends JControllerLegacy
{
/**
* Send the mail
*
* @return void
*
* @since 1.6
*/
public function send()
{
// Redirect to admin index if mass mailer disabled in conf
if (JFactory::getApplication()->get('massmailoff', 0) == 1)
{
JFactory::getApplication()->redirect(JRoute::_('index.php', false));
}
// Check for request forgeries.
$this->checkToken('request');
$model = $this->getModel('Mail');
if ($model->send())
{
$type = 'message';
}
else
{
$type = 'error';
}
$msg = $model->getError();
$this->setRedirect('index.php?option=com_users&view=mail', $msg, $type);
}
/**
* Cancel the mail
*
* @return void
*
* @since 1.6
*/
public function cancel()
{
// Check for request forgeries.
$this->checkToken('request');
// Clear data from session.
\JFactory::getApplication()->setUserState('com_users.display.mail.data', null);
$this->setRedirect('index.php');
}
}
PK UM#]bQ�ԧ � users.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Users list controller class.
*
* @since 1.6
*/
class UsersControllerUsers extends JControllerAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_USERS';
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @since 1.6
* @see JController
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('block', 'changeBlock');
$this->registerTask('unblock', 'changeBlock');
}
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'User', $prefix = 'UsersModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to change the block status on a record.
*
* @return void
*
* @since 1.6
*/
public function changeBlock()
{
// Check for request forgeries.
$this->checkToken();
$ids = (array) $this->input->get('cid', array(), 'int');
$values = array('block' => 1, 'unblock' => 0);
$task = $this->getTask();
$value = ArrayHelper::getValue($values, $task, 0, 'int');
// Remove zero values resulting from input filter
$ids = array_filter($ids);
if (empty($ids))
{
JError::raiseWarning(500, JText::_('COM_USERS_USERS_NO_ITEM_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Change the state of the records.
if (!$model->block($ids, $value))
{
JError::raiseWarning(500, $model->getError());
}
else
{
if ($value == 1)
{
$this->setMessage(JText::plural('COM_USERS_N_USERS_BLOCKED', count($ids)));
}
elseif ($value == 0)
{
$this->setMessage(JText::plural('COM_USERS_N_USERS_UNBLOCKED', count($ids)));
}
}
}
$this->setRedirect('index.php?option=com_users&view=users');
}
/**
* Method to activate a record.
*
* @return void
*
* @since 1.6
*/
public function activate()
{
// Check for request forgeries.
$this->checkToken();
$ids = (array) $this->input->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$ids = array_filter($ids);
if (empty($ids))
{
JError::raiseWarning(500, JText::_('COM_USERS_USERS_NO_ITEM_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Change the state of the records.
if (!$model->activate($ids))
{
JError::raiseWarning(500, $model->getError());
}
else
{
$this->setMessage(JText::plural('COM_USERS_N_USERS_ACTIVATED', count($ids)));
}
}
$this->setRedirect('index.php?option=com_users&view=users');
}
}
PK UM#]�h+�� �
levels.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User view levels list controller class.
*
* @since 1.6
*/
class UsersControllerLevels extends JControllerAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_LEVELS';
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'Level', $prefix = 'UsersModel', $config = array())
{
return parent::getModel($name, $prefix, array('ignore_request' => true));
}
}
PK UM#]T�U�� � notes.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User notes controller class.
*
* @since 2.5
*/
class UsersControllerNotes extends JControllerAdmin
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 2.5
*/
protected $text_prefix = 'COM_USERS_NOTES';
/**
* Method to get a model object, loading it if required.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 2.5
*/
public function getModel($name = 'Note', $prefix = 'UsersModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK UM#]=�-�m m group.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User view level controller class.
*
* @since 1.6
*/
class UsersControllerGroup extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_GROUP';
/**
* Method to check if you can save a new or existing record.
*
* Overrides JControllerForm::allowSave to check the core.admin permission.
*
* @param array $data An array of input data.
* @param string $key 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));
}
/**
* Overrides JControllerForm::allowEdit
*
* Checks that non-Super Admins are not editing Super Admins.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check if this group is a Super Admin
if (JAccess::checkGroup($data[$key], 'core.admin'))
{
// If I'm not a Super Admin, then disallow the edit.
if (!JFactory::getUser()->authorise('core.admin'))
{
return false;
}
}
return parent::allowEdit($data, $key);
}
}
PK UM#]�U� �
groups.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User groups list controller class.
*
* @since 1.6
*/
class UsersControllerGroups extends JControllerAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_GROUPS';
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'Group', $prefix = 'UsersModel', $config = array())
{
return parent::getModel($name, $prefix, array('ignore_request' => true));
}
/**
* Removes an item.
*
* Overrides JControllerAdmin::delete to check the core.admin permission.
*
* @return boolean Returns true on success, false on failure.
*
* @since 1.6
*/
public function delete()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::delete();
}
/**
* Method to publish a list of records.
*
* Overrides JControllerAdmin::publish to check the core.admin permission.
*
* @return void
*
* @since 1.6
*/
public function publish()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::publish();
}
/**
* Changes the order of one or more records.
*
* Overrides JControllerAdmin::reorder to check the core.admin permission.
*
* @return boolean True on success
*
* @since 1.6
*/
public function reorder()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::reorder();
}
/**
* Method to save the submitted ordering values for records.
*
* Overrides JControllerAdmin::saveorder to check the core.admin permission.
*
* @return boolean True on success
*
* @since 1.6
*/
public function saveorder()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::saveorder();
}
/**
* Check in of one or more records.
*
* Overrides JControllerAdmin::checkin to check the core.admin permission.
*
* @return boolean True on success
*
* @since 1.6
*/
public function checkin()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::checkin();
}
}
PK UM#]ҋ��S S note.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User note controller class.
*
* @since 2.5
*/
class UsersControllerNote extends JControllerForm
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 2.5
*/
protected $text_prefix = 'COM_USERS_NOTE';
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $key The name of the primary key variable.
*
* @return string The arguments to append to the redirect URL.
*
* @since 2.5
*/
protected function getRedirectToItemAppend($recordId = null, $key = 'id')
{
$append = parent::getRedirectToItemAppend($recordId, $key);
$userId = JFactory::getApplication()->input->get('u_id', 0, 'int');
if ($userId)
{
$append .= '&u_id=' . $userId;
}
return $append;
}
}
PK �M#]}��R R
ajax.json.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_newsfeeds
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\LanguageHelper;
/**
* The newsfeed controller for ajax requests
*
* @since 3.9.0
*/
class NewsfeedsControllerAjax extends JControllerLegacy
{
/**
* Method to fetch associations of a newsfeed
*
* The method assumes that the following http parameters are passed in an Ajax Get request:
* token: the form token
* assocId: the id of the newsfeed whose associations are to be returned
* excludeLang: the association for this language is to be excluded
*
* @return null
*
* @since 3.9.0
*/
public function fetchAssociations()
{
if (!JSession::checkToken('get'))
{
echo new JResponseJson(null, JText::_('JINVALID_TOKEN'), true);
}
else
{
$input = JFactory::getApplication()->input;
$assocId = $input->getInt('assocId', 0);
if ($assocId == 0)
{
echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true);
return;
}
$excludeLang = $input->get('excludeLang', '', 'STRING');
$associations = JLanguageAssociations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', (int) $assocId);
unset($associations[$excludeLang]);
// Add the title to each of the associated records
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_newsfeeds/tables');
$newsfeedsTable = JTable::getInstance('Newsfeed', 'NewsfeedsTable');
foreach ($associations as $lang => $association)
{
$newsfeedsTable->load($association->id);
$associations[$lang]->title = $newsfeedsTable->name;
}
$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1)));
if (count($associations) == 0)
{
$message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE');
}
elseif ($countContentLanguages > count($associations) + 2)
{
$tags = implode(', ', array_keys($associations));
$message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags);
}
else
{
$message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL');
}
echo new JResponseJson($associations, $message);
}
}
}
PK �M#]�I�D� � newsfeed.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_newsfeeds
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Newsfeed controller class.
*
* @since 1.6
*/
class NewsfeedsControllerNewsfeed extends JControllerForm
{
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
$categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
$allow = null;
if ($categoryId)
{
// If the category has been passed in the URL check it.
$allow = JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId);
}
if ($allow === null)
{
// In the absence of better information, revert to the component permissions.
return parent::allowAdd($data);
}
else
{
return $allow;
}
}
/**
* Method to check if you can edit a record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Since there is no asset tracking, fallback to the component permissions.
if (!$recordId)
{
return parent::allowEdit($data, $key);
}
// Get the item.
$item = $this->getModel()->getItem($recordId);
// Since there is no item, return false.
if (empty($item))
{
return false;
}
$user = JFactory::getUser();
// Check if can edit own core.edit.own.
$canEditOwn = $user->authorise('core.edit.own', $this->option . '.category.' . (int) $item->catid) && $item->created_by == $user->id;
// Check the category core.edit permissions.
return $canEditOwn || $user->authorise('core.edit', $this->option . '.category.' . (int) $item->catid);
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 2.5
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('Newsfeed', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_newsfeeds&view=newsfeeds' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Function that allows child controller access to model data after the data has been saved.
*
* @param JModelLegacy $model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 3.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
}
}
PK �M#]�g�� �
newsfeeds.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_newsfeeds
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Newsfeeds list controller class.
*
* @since 1.6
*/
class NewsfeedsControllerNewsfeeds extends JControllerAdmin
{
/**
* Method to get a model object, loading it if required.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'Newsfeed', $prefix = 'NewsfeedsModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Function that allows child controller access to model data
* after the item has been deleted.
*
* @param JModelLegacy $model The data model object.
* @param integer $ids The validated data.
*
* @return void
*
* @since 3.1
*/
protected function postDeleteHook(JModelLegacy $model, $ids = null)
{
}
}
PK �#]��� � suggestions.json.phpnu &1i� PK �;#]���� � � application.phpnu &1i� PK �;#]���-� �
� component.phpnu &1i� PK C>#]��(H H � sitemaps.phpnu &1i� PK C>#]=I�M+ + j# sitemap.phpnu &1i� PK C>#]�6�
�'