| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/controllers.zip |
PK ��!]���� � article.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @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;
/**
* The article controller
*
* @since 1.6
*/
class ContentControllerArticle extends JControllerForm
{
/**
* Class constructor.
*
* @param array $config A named array of configuration variables.
*
* @since 1.6
*/
public function __construct($config = array())
{
parent::__construct($config);
// An article edit form can come from the articles or featured view.
// Adjust the redirect view on the value of 'return' in the request.
if ($this->input->get('return') == 'featured')
{
$this->view_list = 'featured';
$this->view_item = 'article&return=featured';
}
}
/**
* 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 data or URL check it.
$allow = JFactory::getUser()->authorise('core.create', 'com_content.category.' . $categoryId);
}
if ($allow === null)
{
// In the absence of better information, revert to the component permissions.
return parent::allowAdd();
}
return $allow;
}
/**
* Method override to check if you can edit an existing 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;
$user = JFactory::getUser();
// Zero record (id:0), return component edit permission by calling parent controller method
if (!$recordId)
{
return parent::allowEdit($data, $key);
}
// Check edit on the record asset (explicit or inherited)
if ($user->authorise('core.edit', 'com_content.article.' . $recordId))
{
return true;
}
// Check edit own on the record asset (explicit or inherited)
if ($user->authorise('core.edit.own', 'com_content.article.' . $recordId))
{
// Existing record already has an owner, get it
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
// Grant if current user is owner of the record
return $user->id == $record->created_by;
}
return false;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 1.6
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
/** @var ContentModelArticle $model */
$model = $this->getModel('Article', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_content&view=articles' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
}
PK ��!]��(
ajax.json.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 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.controller');
/**
* Xmap Ajax Controller
*
* @package Xmap
* @subpackage com_xmap
* @since 2.0
*/
class XmapControllerAjax extends JControllerLegacy
{
public function editElement()
{
JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));
jimport('joomla.utilities.date');
jimport('joomla.user.helper');
$user = JFactory::getUser();
$groups = array_keys(JUserHelper::getUserGroups($user->get('id')));
$result = new JRegistry('_default');
$sitemapId = JREquest::getInt('id');
if (!$user->authorise('core.edit', 'com_xmap.sitemap.'.$sitemapId)) {
$result->setValue('result', 'KO');
$result->setValue('message', 'You are not authorized to perform this action!');
} else {
$model = $this->getModel('sitemap');
if ($model->getItem()) {
$action = JRequest::getCmd('action', '');
$uid = JRequest::getCmd('uid', '');
$itemid = JRequest::getInt('itemid', '');
switch ($action) {
case 'toggleElement':
if ($uid && $itemid) {
$state = $model->toggleItem($uid, $itemid);
}
break;
case 'changeProperty':
$uid = JRequest::getCmd('uid', '');
$property = JRequest::getCmd('property', '');
$value = JRequest::getCmd('value', '');
if ($uid && $itemid && $uid && $property) {
$state = $model->chageItemPropery($uid, $itemid, 'xml', $property, $value);
}
break;
}
}
$result->set('result', 'OK');
$result->set('state', $state);
$result->set('message', '');
}
echo $result->toString();
}
}PK ��!]���J� � featured.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @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;
JLoader::register('ContentControllerArticles', __DIR__ . '/articles.php');
/**
* Featured content controller class.
*
* @since 1.6
*/
class ContentControllerFeatured extends ContentControllerArticles
{
/**
* Removes an item.
*
* @return void
*
* @since 1.6
*/
public function delete()
{
// Check for request forgeries
$this->checkToken();
$user = JFactory::getUser();
$ids = (array) $this->input->get('cid', array(), 'int');
// Access checks.
foreach ($ids as $i => $id)
{
// Remove zero value resulting from input filter
if ($id === 0)
{
unset($ids[$i]);
continue;
}
if (!$user->authorise('core.delete', 'com_content.article.' . (int) $id))
{
// Prune items that you can't delete.
unset($ids[$i]);
JError::raiseNotice(403, JText::_('JERROR_CORE_DELETE_NOT_PERMITTED'));
}
}
if (empty($ids))
{
JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
}
else
{
// Get the model.
/** @var ContentModelFeature $model */
$model = $this->getModel();
// Remove the items.
if (!$model->featured($ids, 0))
{
JError::raiseWarning(500, $model->getError());
}
}
$this->setRedirect('index.php?option=com_content&view=featured');
}
/**
* Method to publish a list of articles.
*
* @return void
*
* @since 1.0
*/
public function publish()
{
parent::publish();
$this->setRedirect('index.php?option=com_content&view=featured');
}
/**
* 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 JModelLegacy The model.
*
* @since 1.6
*/
public function getModel($name = 'Feature', $prefix = 'ContentModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK ��!]�f��3 3 articles.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @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;
/**
* Articles list controller class.
*
* @since 1.6
*/
class ContentControllerArticles extends JControllerAdmin
{
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JControllerLegacy
* @since 1.6
*/
public function __construct($config = array())
{
parent::__construct($config);
// Articles default form can come from the articles or featured view.
// Adjust the redirect view on the value of 'view' in the request.
if ($this->input->get('view') == 'featured')
{
$this->view_list = 'featured';
}
$this->registerTask('unfeatured', 'featured');
}
/**
* Method to toggle the featured setting of a list of articles.
*
* @return void
*
* @since 1.6
*/
public function featured()
{
// Check for request forgeries
$this->checkToken();
$user = JFactory::getUser();
$ids = (array) $this->input->get('cid', array(), 'int');
$values = array('featured' => 1, 'unfeatured' => 0);
$task = $this->getTask();
$value = ArrayHelper::getValue($values, $task, 0, 'int');
// Access checks.
foreach ($ids as $i => $id)
{
// Remove zero value resulting from input filter
if ($id === 0)
{
unset($ids[$i]);
continue;
}
if (!$user->authorise('core.edit.state', 'com_content.article.' . (int) $id))
{
// Prune items that you can't change.
unset($ids[$i]);
JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
}
}
if (empty($ids))
{
$message = null;
JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
}
else
{
// Get the model.
/** @var ContentModelArticle $model */
$model = $this->getModel();
// Publish the items.
if (!$model->featured($ids, $value))
{
JError::raiseWarning(500, $model->getError());
}
if ($value == 1)
{
$message = JText::plural('COM_CONTENT_N_ITEMS_FEATURED', count($ids));
}
else
{
$message = JText::plural('COM_CONTENT_N_ITEMS_UNFEATURED', count($ids));
}
}
$view = $this->input->get('view', '');
if ($view == 'featured')
{
$this->setRedirect(JRoute::_('index.php?option=com_content&view=featured', false), $message);
}
else
{
$this->setRedirect(JRoute::_('index.php?option=com_content&view=articles', false), $message);
}
}
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config The array of possible config values. Optional.
*
* @return JModelLegacy
*
* @since 1.6
*/
public function getModel($name = 'Article', $prefix = 'ContentModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK S|!]e�/f
filter.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @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;
use Joomla\Utilities\ArrayHelper;
/**
* Indexer controller class for Finder.
*
* @since 2.5
*/
class FinderControllerFilter extends JControllerForm
{
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 2.5
*/
public function save($key = null, $urlVar = null)
{
// Check for request forgeries.
$this->checkToken();
$app = JFactory::getApplication();
$input = $app->input;
$model = $this->getModel();
$table = $model->getTable();
$data = $input->post->get('jform', array(), 'array');
$checkin = property_exists($table, 'checked_out');
$context = "$this->option.edit.$this->context";
$task = $this->getTask();
// Determine the name of the primary key for the data.
if (empty($key))
{
$key = $table->getKeyName();
}
// To avoid data collisions the urlVar may be different from the primary key.
if (empty($urlVar))
{
$urlVar = $key;
}
$recordId = $input->get($urlVar, '', 'int');
if (!$this->checkEditId($context, $recordId))
{
// Somehow the person just went to the form and tried to save it. We don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $recordId));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false));
return false;
}
// Populate the row id from the session.
$data[$key] = $recordId;
// The save2copy task needs to be handled slightly differently.
if ($task === 'save2copy')
{
// Check-in the original row.
if ($checkin && $model->checkin($data[$key]) === false)
{
// Check-in failed. Go back to the item and display a notice.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar));
return false;
}
// Reset the ID and then treat the request as for Apply.
$data[$key] = 0;
$task = 'apply';
}
// Access check.
if (!$this->allowSave($data, $key))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false));
return false;
}
// Validate the posted data.
// Sometimes the form needs some posted data, such as for plugins and modules.
$form = $model->getForm($data, false);
if (!$form)
{
$app->enqueueMessage($model->getError(), 'error');
return false;
}
// Test whether the data is valid.
$validData = $model->validate($form, $data);
// Check for validation errors.
if ($validData === false)
{
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
{
if ($errors[$i] instanceof Exception)
{
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
}
else
{
$app->enqueueMessage($errors[$i], 'warning');
}
}
// Save the data in the session.
$app->setUserState($context . '.data', $data);
// Redirect back to the edit screen.
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $key), false)
);
return false;
}
// Get and sanitize the filter data.
$validData['data'] = $input->post->get('t', array(), 'array');
$validData['data'] = array_unique($validData['data']);
$validData['data'] = ArrayHelper::toInteger($validData['data']);
// Remove any values of zero.
if (array_search(0, $validData['data'], true))
{
unset($validData['data'][array_search(0, $validData['data'], true)]);
}
// Attempt to save the data.
if (!$model->save($validData))
{
// Save the data in the session.
$app->setUserState($context . '.data', $validData);
// Redirect back to the edit screen.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $key), false)
);
return false;
}
// Save succeeded, so check-in the record.
if ($checkin && $model->checkin($validData[$key]) === false)
{
// Save the data in the session.
$app->setUserState($context . '.data', $validData);
// Check-in failed, so go back to the record and display a notice.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $key));
return false;
}
$this->setMessage(
JText::_(
(JFactory::getLanguage()->hasKey($this->text_prefix . ($recordId === 0 && $app->isClient('site') ? '_SUBMIT' : '') . '_SAVE_SUCCESS')
? $this->text_prefix : 'JLIB_APPLICATION') . ($recordId === 0 && $app->isClient('site') ? '_SUBMIT' : '') . '_SAVE_SUCCESS'
)
);
// Redirect the user and adjust session state based on the chosen task.
switch ($task)
{
case 'apply':
// Set the record data in the session.
$recordId = $model->getState($this->context . '.id');
$this->holdEditId($context, $recordId);
$app->setUserState($context . '.data', null);
$model->checkout($recordId);
// Redirect back to the edit screen.
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $key), false)
);
break;
case 'save2new':
// Clear the record id and data from the session.
$this->releaseEditId($context, $recordId);
$app->setUserState($context . '.data', null);
// Redirect back to the edit screen.
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend(null, $key), false)
);
break;
default:
// Clear the record id and data from the session.
$this->releaseEditId($context, $recordId);
$app->setUserState($context . '.data', null);
// Redirect to the list screen.
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false)
);
break;
}
// Invoke the postSave method to allow for the child class to access the model.
$this->postSaveHook($model, $validData);
return true;
}
}
PK S|!],V��o o filters.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @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;
/**
* Filters controller class for Finder.
*
* @since 2.5
*/
class FinderControllerFilters 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 JModelLegacy The model.
*
* @since 2.5
*/
public function getModel($name = 'Filter', $prefix = 'FinderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK S|!]�ʼn�g g maps.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @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;
/**
* Maps controller class for Finder.
*
* @since 2.5
*/
class FinderControllerMaps 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 JModelLegacy The model.
*
* @since 1.6
*/
public function getModel($name = 'Maps', $prefix = 'FinderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK S|!]�nͿ) �) indexer.json.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @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;
// Register dependent classes.
JLoader::register('FinderIndexer', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/indexer.php');
/**
* Indexer controller class for Finder.
*
* @since 2.5
*/
class FinderControllerIndexer extends JControllerLegacy
{
/**
* Method to start the indexer.
*
* @return void
*
* @since 2.5
*/
public function start()
{
$params = JComponentHelper::getParams('com_finder');
if ($params->get('enable_logging', '0'))
{
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'indexer.php';
JLog::addLogger($options);
}
// Log the start
try
{
JLog::add('Starting the indexer', JLog::INFO);
}
catch (RuntimeException $exception)
{
// Informational log only
}
// We don't want this form to be cached.
$app = JFactory::getApplication();
$app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);
$app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
$app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
$app->setHeader('Pragma', 'no-cache');
// Check for a valid token. If invalid, send a 403 with the error message.
JSession::checkToken('request') or static::sendResponse(new Exception(JText::_('JINVALID_TOKEN_NOTICE'), 403));
// Put in a buffer to silence noise.
ob_start();
// Reset the indexer state.
FinderIndexer::resetState();
// Import the finder plugins.
JPluginHelper::importPlugin('finder');
// Add the indexer language to JS
JText::script('COM_FINDER_AN_ERROR_HAS_OCCURRED');
JText::script('COM_FINDER_NO_ERROR_RETURNED');
// Start the indexer.
try
{
// Trigger the onStartIndex event.
JEventDispatcher::getInstance()->trigger('onStartIndex');
// Get the indexer state.
$state = FinderIndexer::getState();
$state->start = 1;
// Send the response.
static::sendResponse($state);
}
// Catch an exception and return the response.
catch (Exception $e)
{
static::sendResponse($e);
}
}
/**
* Method to run the next batch of content through the indexer.
*
* @return void
*
* @since 2.5
*/
public function batch()
{
$params = JComponentHelper::getParams('com_finder');
if ($params->get('enable_logging', '0'))
{
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'indexer.php';
JLog::addLogger($options);
}
// Log the start
try
{
JLog::add('Starting the indexer batch process', JLog::INFO);
}
catch (RuntimeException $exception)
{
// Informational log only
}
// We don't want this form to be cached.
$app = JFactory::getApplication();
$app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);
$app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
$app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
$app->setHeader('Pragma', 'no-cache');
// Check for a valid token. If invalid, send a 403 with the error message.
JSession::checkToken('request') or static::sendResponse(new Exception(JText::_('JINVALID_TOKEN_NOTICE'), 403));
// Put in a buffer to silence noise.
ob_start();
// Remove the script time limit.
@set_time_limit(0);
// Get the indexer state.
$state = FinderIndexer::getState();
// Reset the batch offset.
$state->batchOffset = 0;
// Update the indexer state.
FinderIndexer::setState($state);
// Import the finder plugins.
JPluginHelper::importPlugin('finder');
/*
* We are going to swap out the raw document object with an HTML document
* in order to work around some plugins that don't do proper environment
* checks before trying to use HTML document functions.
*/
$raw = clone JFactory::getDocument();
$lang = JFactory::getLanguage();
// Get the document properties.
$attributes = array (
'charset' => 'utf-8',
'lineend' => 'unix',
'tab' => ' ',
'language' => $lang->getTag(),
'direction' => $lang->isRtl() ? 'rtl' : 'ltr'
);
// Get the HTML document.
$html = JDocument::getInstance('html', $attributes);
// Todo: Why is this document fetched and immediately overwritten?
$doc = JFactory::getDocument();
// Swap the documents.
$doc = $html;
// Get the admin application.
$admin = clone JFactory::getApplication();
// Get the site app.
$site = JApplicationCms::getInstance('site');
// Swap the app.
$app = JFactory::getApplication();
// Todo: Why is the app fetched and immediately overwritten?
$app = $site;
// Start the indexer.
try
{
// Trigger the onBeforeIndex event.
JEventDispatcher::getInstance()->trigger('onBeforeIndex');
// Trigger the onBuildIndex event.
JEventDispatcher::getInstance()->trigger('onBuildIndex');
// Get the indexer state.
$state = FinderIndexer::getState();
$state->start = 0;
$state->complete = 0;
// Swap the documents back.
$doc = $raw;
// Swap the applications back.
$app = $admin;
// Log batch completion and memory high-water mark.
try
{
JLog::add('Batch completed, peak memory usage: ' . number_format(memory_get_peak_usage(true)) . ' bytes', JLog::INFO);
}
catch (RuntimeException $exception)
{
// Informational log only
}
// Send the response.
static::sendResponse($state);
}
// Catch an exception and return the response.
catch (Exception $e)
{
// Swap the documents back.
$doc = $raw;
// Send the response.
static::sendResponse($e);
}
}
/**
* Method to optimize the index and perform any necessary cleanup.
*
* @return void
*
* @since 2.5
*/
public function optimize()
{
// We don't want this form to be cached.
$app = JFactory::getApplication();
$app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);
$app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
$app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
$app->setHeader('Pragma', 'no-cache');
// Check for a valid token. If invalid, send a 403 with the error message.
JSession::checkToken('request') or static::sendResponse(new Exception(JText::_('JINVALID_TOKEN_NOTICE'), 403));
// Put in a buffer to silence noise.
ob_start();
// Import the finder plugins.
JPluginHelper::importPlugin('finder');
try
{
// Optimize the index
FinderIndexer::getInstance()->optimize();
// Get the indexer state.
$state = FinderIndexer::getState();
$state->start = 0;
$state->complete = 1;
// Send the response.
static::sendResponse($state);
}
// Catch an exception and return the response.
catch (Exception $e)
{
static::sendResponse($e);
}
}
/**
* Method to handle a send a JSON response. The body parameter
* can be an Exception object for when an error has occurred or
* a JObject for a good response.
*
* @param mixed $data JObject on success, Exception on error. [optional]
*
* @return void
*
* @since 2.5
*/
public static function sendResponse($data = null)
{
// This method always sends a JSON response
$app = JFactory::getApplication();
$app->mimeType = 'application/json';
$params = JComponentHelper::getParams('com_finder');
if ($params->get('enable_logging', '0'))
{
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'indexer.php';
JLog::addLogger($options);
}
// Send the assigned error code if we are catching an exception.
if ($data instanceof Exception)
{
try
{
JLog::add($data->getMessage(), JLog::ERROR);
}
catch (RuntimeException $exception)
{
// Informational log only
}
$app->setHeader('status', $data->getCode());
}
// Create the response object.
$response = new FinderIndexerResponse($data);
// Add the buffer.
$response->buffer = JDEBUG ? ob_get_contents() : ob_end_clean();
// Send the JSON response.
$app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet);
$app->sendHeaders();
echo json_encode($response);
// Close the application.
$app->close();
}
}
/**
* Finder Indexer JSON Response Class
*
* @since 2.5
*/
class FinderIndexerResponse
{
/**
* Class Constructor
*
* @param mixed $state The processing state for the indexer
*
* @since 2.5
*/
public function __construct($state)
{
$params = JComponentHelper::getParams('com_finder');
if ($params->get('enable_logging', '0'))
{
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'indexer.php';
JLog::addLogger($options);
}
// The old token is invalid so send a new one.
$this->token = JFactory::getSession()->getFormToken();
// Check if we are dealing with an error.
if ($state instanceof Exception)
{
// Log the error
try
{
JLog::add($state->getMessage(), JLog::ERROR);
}
catch (RuntimeException $exception)
{
// Informational log only
}
// Prepare the error response.
$this->error = true;
$this->header = JText::_('COM_FINDER_INDEXER_HEADER_ERROR');
$this->message = $state->getMessage();
}
else
{
// Prepare the response data.
$this->batchSize = (int) $state->batchSize;
$this->batchOffset = (int) $state->batchOffset;
$this->totalItems = (int) $state->totalItems;
$this->startTime = $state->startTime;
$this->endTime = JFactory::getDate()->toSql();
$this->start = !empty($state->start) ? (int) $state->start : 0;
$this->complete = !empty($state->complete) ? (int) $state->complete : 0;
// Set the appropriate messages.
if ($this->totalItems <= 0 && $this->complete)
{
$this->header = JText::_('COM_FINDER_INDEXER_HEADER_COMPLETE');
$this->message = JText::_('COM_FINDER_INDEXER_MESSAGE_COMPLETE');
}
elseif ($this->totalItems <= 0)
{
$this->header = JText::_('COM_FINDER_INDEXER_HEADER_OPTIMIZE');
$this->message = JText::_('COM_FINDER_INDEXER_MESSAGE_OPTIMIZE');
}
else
{
$this->header = JText::_('COM_FINDER_INDEXER_HEADER_RUNNING');
$this->message = JText::_('COM_FINDER_INDEXER_MESSAGE_RUNNING');
}
}
}
}
// Register the error handler.
JError::setErrorHandling(E_ALL, 'callback', array('FinderControllerIndexer', 'sendResponse'));
PK S|!]�E��: : index.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @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;
/**
* Index controller class for Finder.
*
* @since 2.5
*/
class FinderControllerIndex 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 JModelLegacy The model.
*
* @since 2.5
*/
public function getModel($name = 'Index', $prefix = 'FinderModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to purge all indexed links from the database.
*
* @return boolean True on success.
*
* @since 2.5
*/
public function purge()
{
$this->checkToken();
// Remove the script time limit.
@set_time_limit(0);
$model = $this->getModel('Index', 'FinderModel');
// Attempt to purge the index.
$return = $model->purge();
if (!$return)
{
$message = JText::_('COM_FINDER_INDEX_PURGE_FAILED', $model->getError());
$this->setRedirect('index.php?option=com_finder&view=index', $message);
return false;
}
else
{
$message = JText::_('COM_FINDER_INDEX_PURGE_SUCCESS');
$this->setRedirect('index.php?option=com_finder&view=index', $message);
return true;
}
}
}
PK W|!]�tx�D D tags.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage com_tags
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The Tags List Controller
*
* @since 3.1
*/
class TagsControllerTags extends JControllerLegacy
{
/**
* Method to search tags with AJAX
*
* @return void
*/
public function searchAjax()
{
// Required objects
$app = JFactory::getApplication();
$user = JFactory::getUser();
// Receive request data
$filters = array(
'like' => trim($app->input->get('like', null, 'string')),
'title' => trim($app->input->get('title', null, 'string')),
'flanguage' => $app->input->get('flanguage', null, 'word'),
'published' => $app->input->get('published', 1, 'int'),
'parent_id' => $app->input->get('parent_id', 0, 'int'),
'access' => $user->getAuthorisedViewLevels(),
);
if ((!$user->authorise('core.edit.state', 'com_tags')) && (!$user->authorise('core.edit', 'com_tags')))
{
// Filter on published for those who do not have edit or edit.state rights.
$filters['published'] = 1;
}
$results = JHelperTags::searchTags($filters);
if ($results)
{
// Output a JSON object
echo json_encode($results);
}
$app->close();
}
}
PK W|!]��'� � tag.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_tags
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The Tag Controller
*
* @since 3.1
*/
class TagsControllerTag extends JControllerForm
{
/**
* Method to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 3.1
*/
protected function allowAdd($data = array())
{
$user = JFactory::getUser();
return $user->authorise('core.create', 'com_tags');
}
/**
* 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 3.1
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Since there is no asset tracking and no categories, revert to the component permissions.
return parent::allowEdit($data, $key);
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 3.1
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('Tag');
// Preset the redirect
$this->setRedirect('index.php?option=com_tags&view=tags');
return parent::batch($model);
}
}
PK Y|!]!i=�
�
contact.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_contact
*
* @copyright (C) 2008 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;
/**
* Controller for a single contact
*
* @since 1.6
*/
class ContactControllerContact 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);
}
return $allow;
}
/**
* Method override to check if you can edit an existing 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
/** @var ContactModelContact $model */
$model = $this->getModel('Contact', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_contact&view=contacts' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
}
PK Y|!]��T�
�
contacts.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_contact
*
* @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;
/**
* Contacts list controller class.
*
* @since 1.6
*/
class ContactControllerContacts extends JControllerAdmin
{
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JControllerLegacy
* @since 1.6
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('unfeatured', 'featured');
}
/**
* Method to toggle the featured setting of a list of contacts.
*
* @return void
*
* @since 1.6
*/
public function featured()
{
// Check for request forgeries
$this->checkToken();
$ids = (array) $this->input->get('cid', array(), 'int');
$values = array('featured' => 1, 'unfeatured' => 0);
$task = $this->getTask();
$value = ArrayHelper::getValue($values, $task, 0, 'int');
// Get the model.
/** @var ContactModelContact $model */
$model = $this->getModel();
// Access checks.
foreach ($ids as $i => $id)
{
// Remove zero value resulting from input filter
if ($id === 0)
{
unset($ids[$i]);
continue;
}
$item = $model->getItem($id);
if (!JFactory::getUser()->authorise('core.edit.state', 'com_contact.category.' . (int) $item->catid))
{
// Prune items that you can't change.
unset($ids[$i]);
JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
}
}
if (empty($ids))
{
$message = null;
JError::raiseWarning(500, JText::_('COM_CONTACT_NO_ITEM_SELECTED'));
}
else
{
// Publish the items.
if (!$model->featured($ids, $value))
{
JError::raiseWarning(500, $model->getError());
}
if ($value == 1)
{
$message = JText::plural('COM_CONTACT_N_ITEMS_FEATURED', count($ids));
}
else
{
$message = JText::plural('COM_CONTACT_N_ITEMS_UNFEATURED', count($ids));
}
}
$this->setRedirect('index.php?option=com_contact&view=contacts', $message);
}
/**
* Proxy for getModel.
*
* @param string $name The name of the model.
* @param string $prefix The prefix for the PHP class name.
* @param array $config Array of configuration parameters.
*
* @return JModelLegacy
*
* @since 1.6
*/
public function getModel($name = 'Contact', $prefix = 'ContactModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK Z|!]PڞB �B
update.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_joomlaupdate
*
* @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The Joomla! update controller for the Update view
*
* @since 2.5.4
*/
class JoomlaupdateControllerUpdate extends JControllerLegacy
{
/**
* Performs the download of the update package
*
* @return void
*
* @since 2.5.4
*/
public function download()
{
$this->checkToken();
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'joomla_update.php';
JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror'));
$user = JFactory::getUser();
try
{
JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_START', $user->id, $user->name, JVERSION), JLog::INFO, 'Update');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$this->_applyCredentials();
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('Default');
$result = $model->download();
$file = $result['basename'];
$message = null;
$messageType = null;
// The validation was not successful for now just a warning.
// TODO: In Joomla 4 this will abort the installation
if ($result['check'] === false)
{
$message = JText::_('COM_JOOMLAUPDATE_VIEW_UPDATE_CHECKSUM_WRONG');
$messageType = 'warning';
try
{
JLog::add($message, JLog::INFO, 'Update');
}
catch (RuntimeException $exception)
{
// Informational log only
}
}
if ($file)
{
JFactory::getApplication()->setUserState('com_joomlaupdate.file', $file);
$url = 'index.php?option=com_joomlaupdate&task=update.install&' . JFactory::getSession()->getFormToken() . '=1';
try
{
JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_FILE', $file), JLog::INFO, 'Update');
}
catch (RuntimeException $exception)
{
// Informational log only
}
}
else
{
JFactory::getApplication()->setUserState('com_joomlaupdate.file', null);
$url = 'index.php?option=com_joomlaupdate';
$message = JText::_('COM_JOOMLAUPDATE_VIEW_UPDATE_DOWNLOADFAILED');
$messageType = 'error';
}
$this->setRedirect($url, $message, $messageType);
}
/**
* Start the installation of the new Joomla! version
*
* @return void
*
* @since 2.5.4
*/
public function install()
{
$this->checkToken('get');
JFactory::getApplication()->setUserState('com_joomlaupdate.oldversion', JVERSION);
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'joomla_update.php';
JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror'));
try
{
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_INSTALL'), JLog::INFO, 'Update');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$this->_applyCredentials();
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('Default');
$file = JFactory::getApplication()->getUserState('com_joomlaupdate.file', null);
$model->createRestorationFile($file);
$this->display();
}
/**
* Finalise the upgrade by running the necessary scripts
*
* @return void
*
* @since 2.5.4
*/
public function finalise()
{
/*
* Finalize with login page. Used for pre-token check versions
* to allow updates without problems but with a maximum of security.
*/
if (!JSession::checkToken('get'))
{
$this->setRedirect('index.php?option=com_joomlaupdate&view=update&layout=finaliseconfirm');
return false;
}
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'joomla_update.php';
JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror'));
try
{
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_FINALISE'), JLog::INFO, 'Update');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$this->_applyCredentials();
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('Default');
$model->finaliseUpgrade();
$url = 'index.php?option=com_joomlaupdate&task=update.cleanup&' . JFactory::getSession()->getFormToken() . '=1';
$this->setRedirect($url);
}
/**
* Clean up after ourselves
*
* @return void
*
* @since 2.5.4
*/
public function cleanup()
{
/*
* Cleanup with login page. Used for pre-token check versions to be able to update
* from =< 3.2.7 to allow updates without problems but with a maximum of security.
*/
if (!JSession::checkToken('get'))
{
$this->setRedirect('index.php?option=com_joomlaupdate&view=update&layout=finaliseconfirm');
return false;
}
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'joomla_update.php';
JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror'));
try
{
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_CLEANUP'), JLog::INFO, 'Update');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$this->_applyCredentials();
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('Default');
$model->cleanUp();
$url = 'index.php?option=com_joomlaupdate&view=default&layout=complete';
$this->setRedirect($url);
try
{
JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_COMPLETE', JVERSION), JLog::INFO, 'Update');
}
catch (RuntimeException $exception)
{
// Informational log only
}
}
/**
* Purges updates.
*
* @return void
*
* @since 3.0
*/
public function purge()
{
// Check for request forgeries
$this->checkToken();
// Purge updates
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('Default');
$model->purge();
$url = 'index.php?option=com_joomlaupdate';
$this->setRedirect($url, $model->_message);
}
/**
* Uploads an update package to the temporary directory, under a random name
*
* @return void
*
* @since 3.6.0
*/
public function upload()
{
// Check for request forgeries
$this->checkToken();
// Did a non Super User tried to upload something (a.k.a. pathetic hacking attempt)?
JFactory::getUser()->authorise('core.admin') or jexit(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'));
$this->_applyCredentials();
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('Default');
try
{
$model->upload();
}
catch (RuntimeException $e)
{
$url = 'index.php?option=com_joomlaupdate';
$this->setRedirect($url, $e->getMessage(), 'error');
return;
}
$token = JSession::getFormToken();
$url = 'index.php?option=com_joomlaupdate&task=update.captive&' . $token . '=1';
$this->setRedirect($url);
}
/**
* Checks there is a valid update package and redirects to the captive view for super admin authentication.
*
* @return array
*
* @since 3.6.0
*/
public function captive()
{
// Check for request forgeries
$this->checkToken('get');
// Did a non Super User tried to upload something (a.k.a. pathetic hacking attempt)?
if (!JFactory::getUser()->authorise('core.admin'))
{
throw new RuntimeException(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
}
// Do I really have an update package?
$tempFile = JFactory::getApplication()->getUserState('com_joomlaupdate.temp_file', null);
JLoader::import('joomla.filesystem.file');
if (empty($tempFile) || !JFile::exists($tempFile))
{
throw new RuntimeException(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
}
$this->input->set('view', 'upload');
$this->input->set('layout', 'captive');
$this->display();
}
/**
* Checks the admin has super administrator privileges and then proceeds with the update.
*
* @return array
*
* @since 3.6.0
*/
public function confirm()
{
// Check for request forgeries
$this->checkToken();
// Did a non Super User tried to upload something (a.k.a. pathetic hacking attempt)?
if (!JFactory::getUser()->authorise('core.admin'))
{
throw new RuntimeException(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
}
// Get the model
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('default');
// Get the captive file before the session resets
$tempFile = JFactory::getApplication()->getUserState('com_joomlaupdate.temp_file', null);
// Do I really have an update package?
if (!$model->captiveFileExists())
{
throw new RuntimeException(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
}
// Try to log in
$credentials = array(
'username' => $this->input->post->get('username', '', 'username'),
'password' => $this->input->post->get('passwd', '', 'raw'),
'secretkey' => $this->input->post->get('secretkey', '', 'raw'),
);
$result = $model->captiveLogin($credentials);
if (!$result)
{
$model->removePackageFiles();
throw new RuntimeException(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
}
// Set the update source in the session
JFactory::getApplication()->setUserState('com_joomlaupdate.file', basename($tempFile));
try
{
JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_FILE', $tempFile), JLog::INFO, 'Update');
}
catch (RuntimeException $exception)
{
// Informational log only
}
// Redirect to the actual update page
$url = 'index.php?option=com_joomlaupdate&task=update.install&' . JFactory::getSession()->getFormToken() . '=1';
$this->setRedirect($url);
}
/**
* Method to display a view.
*
* @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 JoomlaupdateControllerUpdate This object to support chaining.
*
* @since 2.5.4
*/
public function display($cachable = false, $urlparams = array())
{
// Get the document object.
$document = JFactory::getDocument();
// Set the default view name and format from the Request.
$vName = $this->input->get('view', 'update');
$vFormat = $document->getType();
$lName = $this->input->get('layout', 'default', 'string');
// Get and render the view.
if ($view = $this->getView($vName, $vFormat))
{
// Get the model for the view.
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('Default');
// Push the model into the view (as default).
$view->setModel($model, true);
$view->setLayout($lName);
// Push document object into the view.
$view->document = $document;
$view->display();
}
return $this;
}
/**
* Applies FTP credentials to Joomla! itself, when required
*
* @return void
*
* @since 2.5.4
*/
protected function _applyCredentials()
{
JFactory::getApplication()->getUserStateFromRequest('com_joomlaupdate.method', 'method', 'direct', 'cmd');
if (!JClientHelper::hasCredentials('ftp'))
{
$user = JFactory::getApplication()->getUserStateFromRequest('com_joomlaupdate.ftp_user', 'ftp_user', null, 'raw');
$pass = JFactory::getApplication()->getUserStateFromRequest('com_joomlaupdate.ftp_pass', 'ftp_pass', null, 'raw');
if ($user != '' && $pass != '')
{
// Add credentials to the session
if (!JClientHelper::setCredentials('ftp', $user, $pass))
{
JError::raiseWarning(500, JText::_('JLIB_CLIENT_ERROR_HELPER_SETCREDENTIALSFROMREQUEST_FAILED'));
}
}
}
}
/**
* Checks the admin has super administrator privileges and then proceeds with the final & cleanup steps.
*
* @return array
*
* @since 3.6.3
*/
public function finaliseconfirm()
{
// Check for request forgeries
$this->checkToken();
// Did a non Super User try do this?
if (!JFactory::getUser()->authorise('core.admin'))
{
throw new RuntimeException(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
}
// Get the model
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('default');
// Try to log in
$credentials = array(
'username' => $this->input->post->get('username', '', 'username'),
'password' => $this->input->post->get('passwd', '', 'raw'),
'secretkey' => $this->input->post->get('secretkey', '', 'raw'),
);
$result = $model->captiveLogin($credentials);
// The login fails?
if (!$result)
{
JFactory::getApplication()->enqueueMessage(JText::_('JGLOBAL_AUTH_INVALID_PASS'), 'warning');
$this->setRedirect('index.php?option=com_joomlaupdate&view=update&layout=finaliseconfirm');
return false;
}
// Redirect back to the actual finalise page
$this->setRedirect('index.php?option=com_joomlaupdate&task=update.finalise&' . JFactory::getSession()->getFormToken() . '=1');
}
/**
* Fetch Extension update XML proxy. Used to prevent Access-Control-Allow-Origin errors.
* Prints a JSON string.
* Called from JS.
*
* @since 3.10.0
*
* @return void
*/
public function fetchExtensionCompatibility()
{
$extensionID = $this->input->get('extension-id', '', 'DEFAULT');
$joomlaTargetVersion = $this->input->get('joomla-target-version', '', 'DEFAULT');
$joomlaCurrentVersion = $this->input->get('joomla-current-version', '', JVERSION);
$extensionVersion = $this->input->get('extension-version', '', 'DEFAULT');
/** @var JoomlaupdateModelDefault $model */
$model = $this->getModel('default');
$upgradeCompatibilityStatus = $model->fetchCompatibility($extensionID, $joomlaTargetVersion);
$currentCompatibilityStatus = $model->fetchCompatibility($extensionID, $joomlaCurrentVersion);
$upgradeUpdateVersion = false;
$currentUpdateVersion = false;
$upgradeWarning = 0;
if ($upgradeCompatibilityStatus->state == 1 && !empty($upgradeCompatibilityStatus->compatibleVersions))
{
$upgradeUpdateVersion = end($upgradeCompatibilityStatus->compatibleVersions);
}
if ($currentCompatibilityStatus->state == 1 && !empty($currentCompatibilityStatus->compatibleVersions))
{
$currentUpdateVersion = end($currentCompatibilityStatus->compatibleVersions);
}
if ($upgradeUpdateVersion !== false)
{
$upgradeOldestVersion = $upgradeCompatibilityStatus->compatibleVersions[0];
if ($currentUpdateVersion !== false)
{
// If there are updates compatible with both CMS versions use these
$bothCompatibleVersions = array_values(
array_intersect($upgradeCompatibilityStatus->compatibleVersions, $currentCompatibilityStatus->compatibleVersions)
);
if (!empty($bothCompatibleVersions))
{
$upgradeOldestVersion = $bothCompatibleVersions[0];
$upgradeUpdateVersion = end($bothCompatibleVersions);
}
}
if (version_compare($upgradeOldestVersion, $extensionVersion, '>'))
{
// Installed version is empty or older than the oldest compatible update: Update required
$resultGroup = 2;
}
else
{
// Current version is compatible
$resultGroup = 3;
}
if ($currentUpdateVersion !== false && version_compare($upgradeUpdateVersion, $currentUpdateVersion, '<'))
{
// Special case warning when version compatible with target is lower than current
$upgradeWarning = 2;
}
}
elseif ($currentUpdateVersion !== false)
{
// No compatible version for target version but there is a compatible version for current version
$resultGroup = 1;
}
else
{
// No update server available
$resultGroup = 1;
}
// Do we need to capture
$combinedCompatibilityStatus = array(
'upgradeCompatibilityStatus' => (object) array(
'state' => $upgradeCompatibilityStatus->state,
'compatibleVersion' => $upgradeUpdateVersion
),
'currentCompatibilityStatus' => (object) array(
'state' => $currentCompatibilityStatus->state,
'compatibleVersion' => $currentUpdateVersion
),
'resultGroup' => $resultGroup,
'upgradeWarning' => $upgradeWarning,
);
$this->app = JFactory::getApplication();
$this->app->mimeType = 'application/json';
$this->app->charSet = 'utf-8';
$this->app->setHeader('Content-Type', $this->app->mimeType . '; charset=' . $this->app->charSet);
$this->app->sendHeaders();
try
{
echo new JResponseJson($combinedCompatibilityStatus);
}
catch (Exception $e)
{
echo $e;
}
$this->app->close();
}
/**
* Fetch and report updates in JSON format, for AJAX requests
*
* @return void
*
* @since 3.10.10
*/
public function ajax()
{
$app = JFactory::getApplication();
if (!JSession::checkToken('get'))
{
$app->setHeader('status', 403, true);
$app->sendHeaders();
echo JText::_('JINVALID_TOKEN_NOTICE');
$app->close();
}
$model = $this->getModel('default');
$updateInfo = $model->getUpdateInformation();
$update = array();
$update[] = array('version' => $updateInfo['latest']);
echo json_encode($update);
$app->close();
}
}
PK Z|!]�y/� � searches.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_search
*
* @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;
/**
* Methods supporting a list of search terms.
*
* @since 1.6
*/
class SearchControllerSearches extends JControllerLegacy
{
/**
* Method to reset the search log table.
*
* @return boolean
*/
public function reset()
{
// Check for request forgeries.
$this->checkToken();
$model = $this->getModel('Searches');
if (!$model->reset())
{
JError::raiseWarning(500, $model->getError());
}
$this->setRedirect('index.php?option=com_search&view=searches');
}
/**
* Method to toggle the view of results.
*
* @return boolean
*/
public function toggleResults()
{
// Check for request forgeries.
$this->checkToken();
if ($this->getModel('Searches')->getState('show_results', 1, 'int') === 0)
{
$this->setRedirect('index.php?option=com_search&view=searches&show_results=1');
}
else
{
$this->setRedirect('index.php?option=com_search&view=searches&show_results=0');
}
}
}
PK ]|!]O���
client.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_banners
*
* @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;
/**
* Client controller class.
*
* @since 1.6
*/
class BannersControllerClient extends JControllerForm
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
protected $text_prefix = 'COM_BANNERS_CLIENT';
}
PK ]|!]c� �
banner.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_banners
*
* @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;
use Joomla\Utilities\ArrayHelper;
/**
* Banner controller class.
*
* @since 1.6
*/
class BannersControllerBanner extends JControllerForm
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
protected $text_prefix = 'COM_BANNERS_BANNER';
/**
* 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())
{
$filter = $this->input->getInt('filter_category_id');
$categoryId = ArrayHelper::getValue($data, 'catid', $filter, '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)
{
return $allow;
}
// In the absence of better information, revert to the component permissions.
return parent::allowAdd($data);
}
/**
* Method override to check if you can edit an existing 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;
$categoryId = 0;
if ($recordId)
{
$categoryId = (int) $this->getModel()->getItem($recordId)->catid;
}
if ($categoryId)
{
// The category has been set. Check the category permissions.
return JFactory::getUser()->authorise('core.edit', $this->option . '.category.' . $categoryId);
}
// Since there is no asset tracking, revert to the component permissions.
return parent::allowEdit($data, $key);
}
/**
* Method to run batch operations.
*
* @param string $model The model
*
* @return boolean True on success.
*
* @since 2.5
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('Banner', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_banners&view=banners' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
}
PK ]|!]2��Ʒ � banners.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_banners
*
* @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;
/**
* Banners list controller class.
*
* @since 1.6
*/
class BannersControllerBanners extends JControllerAdmin
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
protected $text_prefix = 'COM_BANNERS_BANNERS';
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JControllerLegacy
* @since 1.6
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('sticky_unpublish', 'sticky_publish');
}
/**
* 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 JModelLegacy The model.
*
* @since 1.6
*/
public function getModel($name = 'Banner', $prefix = 'BannersModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Stick items
*
* @return void
*
* @since 1.6
*/
public function sticky_publish()
{
// Check for request forgeries.
$this->checkToken();
$ids = (array) $this->input->get('cid', array(), 'int');
$values = array('sticky_publish' => 1, 'sticky_unpublish' => 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_BANNERS_NO_BANNERS_SELECTED'));
}
else
{
// Get the model.
/** @var BannersModelBanner $model */
$model = $this->getModel();
// Change the state of the records.
if (!$model->stick($ids, $value))
{
JError::raiseWarning(500, $model->getError());
}
else
{
if ($value == 1)
{
$ntext = 'COM_BANNERS_N_BANNERS_STUCK';
}
else
{
$ntext = 'COM_BANNERS_N_BANNERS_UNSTUCK';
}
$this->setMessage(JText::plural($ntext, count($ids)));
}
}
$this->setRedirect('index.php?option=com_banners&view=banners');
}
}
PK ]|!]��F� �
tracks.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_banners
*
* @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;
/**
* Tracks list controller class.
*
* @since 1.6
*/
class BannersControllerTracks extends JControllerLegacy
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
protected $context = 'com_banners.tracks';
/**
* 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 JModelLegacy The model.
*
* @since 1.6
*/
public function getModel($name = 'Tracks', $prefix = 'BannersModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to remove a record.
*
* @return void
*
* @since 1.6
*/
public function delete()
{
// Check for request forgeries.
$this->checkToken();
// Get the model.
/** @var BannersModelTracks $model */
$model = $this->getModel();
// Load the filter state.
$app = JFactory::getApplication();
$model->setState('filter.type', $app->getUserState($this->context . '.filter.type'));
$model->setState('filter.begin', $app->getUserState($this->context . '.filter.begin'));
$model->setState('filter.end', $app->getUserState($this->context . '.filter.end'));
$model->setState('filter.category_id', $app->getUserState($this->context . '.filter.category_id'));
$model->setState('filter.client_id', $app->getUserState($this->context . '.filter.client_id'));
$model->setState('list.limit', 0);
$model->setState('list.start', 0);
$count = $model->getTotal();
// Remove the items.
if (!$model->delete())
{
JError::raiseWarning(500, $model->getError());
}
elseif ($count > 0)
{
$this->setMessage(JText::plural('COM_BANNERS_TRACKS_N_ITEMS_DELETED', $count));
}
else
{
$this->setMessage(JText::_('COM_BANNERS_TRACKS_NO_ITEMS_DELETED'));
}
$this->setRedirect('index.php?option=com_banners&view=tracks');
}
}
PK ]|!]�(�U� � clients.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_banners
*
* @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;
/**
* Clients list controller class.
*
* @since 1.6
*/
class BannersControllerClients extends JControllerAdmin
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
protected $text_prefix = 'COM_BANNERS_CLIENTS';
/**
* 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 JModelLegacy The model.
*
* @since 1.6
*/
public function getModel($name = 'Client', $prefix = 'BannersModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK ]|!]�@�v
v
tracks.raw.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_banners
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Tracks list controller class.
*
* @since 1.6
*/
class BannersControllerTracks extends JControllerLegacy
{
/**
* The context for persistent state.
*
* @var string
* @since 1.6
*/
protected $context = 'com_banners.tracks';
/**
* Method to get a model object, loading it if required.
*
* @param string $name The name of the model.
* @param string $prefix The prefix for the model class name.
* @param array $config Configuration array for model. Optional.
*
* @return JModelLegacy
*
* @since 1.6
*/
public function getModel($name = 'Tracks', $prefix = 'BannersModel', $config = array())
{
return parent::getModel($name, $prefix, array('ignore_request' => true));
}
/**
* Display method for the raw track data.
*
* @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 BannersControllerTracks This object to support chaining.
*
* @since 1.5
* @todo This should be done as a view, not here!
*/
public function display($cachable = false, $urlparams = array())
{
// Check for request forgeries.
$this->checkToken('GET');
// Get the document object.
$vName = 'tracks';
// Get and render the view.
if ($view = $this->getView($vName, 'raw'))
{
// Get the model for the view.
/** @var BannersModelTracks $model */
$model = $this->getModel($vName);
// Load the filter state.
$app = JFactory::getApplication();
$model->setState('filter.type', $app->getUserState($this->context . '.filter.type'));
$model->setState('filter.begin', $app->getUserState($this->context . '.filter.begin'));
$model->setState('filter.end', $app->getUserState($this->context . '.filter.end'));
$model->setState('filter.category_id', $app->getUserState($this->context . '.filter.category_id'));
$model->setState('filter.client_id', $app->getUserState($this->context . '.filter.client_id'));
$model->setState('list.limit', 0);
$model->setState('list.start', 0);
$form = $this->input->get('jform', array(), 'array');
$model->setState('basename', $form['basename']);
$model->setState('compressed', $form['compressed']);
// Create one year cookies.
$cookieLifeTime = time() + 365 * 86400;
$cookieDomain = $app->get('cookie_domain', '');
$cookiePath = $app->get('cookie_path', '/');
$isHttpsForced = $app->isHttpsForced();
$app->input->cookie->set(
JApplicationHelper::getHash($this->context . '.basename'),
$form['basename'],
$cookieLifeTime,
$cookiePath,
$cookieDomain,
$isHttpsForced,
true
);
$app->input->cookie->set(
JApplicationHelper::getHash($this->context . '.compressed'),
$form['compressed'],
$cookieLifeTime,
$cookiePath,
$cookieDomain,
$isHttpsForced,
true
);
// Push the model into the view (as default).
$view->setModel($model, true);
// Push document object into the view.
$view->document = JFactory::getDocument();
$view->display();
}
return $this;
}
}
PK `|!]^c� message.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @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;
/**
* Messages Component Message Model
*
* @since 1.6
*/
class MessagesControllerMessage extends JControllerForm
{
/**
* Method (override) to check if you can save a new or existing record.
*
* Adjusts for the primary key name and hands off to the parent class.
*
* @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 = 'message_id')
{
return parent::allowSave($data, $key);
}
/**
* Reply to an existing message.
*
* This is a simple redirect to the compose form.
*
* @return void
*
* @since 1.6
*/
public function reply()
{
if ($replyId = $this->input->getInt('reply_id'))
{
$this->setRedirect('index.php?option=com_messages&view=message&layout=edit&reply_id=' . $replyId);
}
else
{
$this->setMessage(JText::_('COM_MESSAGES_INVALID_REPLY_ID'));
$this->setRedirect('index.php?option=com_messages&view=messages');
}
}
}
PK `|!]���Yl l messages.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @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;
/**
* Messages list controller class.
*
* @since 1.6
*/
class MessagesControllerMessages 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 = 'Message', $prefix = 'MessagesModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK `|!]�n|F� �
config.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @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;
/**
* Messages Component Message Model
*
* @since 1.6
*/
class MessagesControllerConfig extends JControllerLegacy
{
/**
* Method to save a record.
*
* @return boolean
*
* @since 1.6
*/
public function save()
{
// Check for request forgeries.
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel('Config', 'MessagesModel');
$data = $this->input->post->get('jform', array(), 'array');
// Validate the posted data.
$form = $model->getForm();
if (!$form)
{
JError::raiseError(500, $model->getError());
return false;
}
$data = $model->validate($form, $data);
// Check for validation errors.
if ($data === false)
{
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
{
if ($errors[$i] instanceof Exception)
{
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
}
else
{
$app->enqueueMessage($errors[$i], 'warning');
}
}
// Redirect back to the main list.
$this->setRedirect(JRoute::_('index.php?option=com_messages&view=messages', false));
return false;
}
// Attempt to save the data.
if (!$model->save($data))
{
// Redirect back to the main list.
$this->setMessage(JText::sprintf('JERROR_SAVE_FAILED', $model->getError()), 'warning');
$this->setRedirect(JRoute::_('index.php?option=com_messages&view=messages', false));
return false;
}
// Redirect to the list screen.
$this->setMessage(JText::_('COM_MESSAGES_CONFIG_SAVED'));
$this->setRedirect(JRoute::_('index.php?option=com_messages&view=messages', false));
return true;
}
}
PK �|!]�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 �|!]�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 �|!]Ϟ�Z Z categories.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.3.3 2014-04-12
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Categories list controller class.
*/
class iCagendaControllerCategories extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 1.0
*/
public function getModel($name = 'category', $prefix = 'iCagendaModel')
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
PK �|!]t~Q� � customfield.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-05-01
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Category controller class.
*/
class iCagendaControllerCustomfield extends JControllerForm
{
function __construct()
{
$this->view_list = 'customfields';
parent::__construct();
}
}
PK �|!]�� @�
�
events.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.1.10 2013-09-12
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Events list controller class.
*/
class iCagendaControllerEvents extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 1.6
*/
public function getModel($name = 'event', $prefix = 'iCagendaModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to save the submitted ordering values for records via AJAX.
*
* @return void
*
* @since 3.0
*/
public function saveOrderAjax()
{
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
$order = $input->post->get('order', array(), 'array');
// Sanitize the input
JArrayHelper::toInteger($pks);
JArrayHelper::toInteger($order);
// Get the model
$model = $this->getModel();
// Save the ordering
$return = $model->saveorder($pks, $order);
if ($return)
{
echo "1";
}
// Close the application
JFactory::getApplication()->close();
}
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('unapprove', 'approve');
}
/**
* Method to approve an event.
*
* @return void
*
* @since 3.2
*/
public function approve()
{
// Check for request forgeries.
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$input = JFactory::getApplication()->input;
$ids = $input->post->get('cid', array(), 'array');
if (empty($ids))
{
JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Change the state of the records.
if (!$model->approve($ids))
{
JError::raiseWarning(500, $model->getError());
}
else
{
$this->setMessage(JText::plural('COM_ICAGENDA_N_EVENTS_APPROVED', count($ids)));
}
}
$this->setRedirect('index.php?option=com_icagenda&view=events');
}
}
PK �|!]��S� � category.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.2.13 2014-01-26
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Category controller class.
*/
class iCagendaControllerCategory extends JControllerForm
{
function __construct() {
$this->view_list = 'categories';
parent::__construct();
}
}
PK �|!]���H
registration.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.5.9 2015-07-22
* @since 3.3.3
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Registration controller class.
*/
class iCagendaControllerRegistration extends JControllerForm
{
function __construct()
{
$this->view_list = 'registrations';
parent::__construct();
}
/**
* Return Ajax to load date select options
*
* @since 3.5.9
*/
function dates()
{
icagendaAjax::getOptionsEventDates('registration');
// Cut the execution short
// JFactory::getApplication()->close();
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 3.3.3
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Initialise variables.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
$userId = $user->get('id');
// Check general edit permission first.
if ($user->authorise('core.edit', 'com_icagenda.registration.' . $recordId))
{
return true;
}
// Fallback on edit.own.
// First test if the permission is available.
if ($user->authorise('core.edit.own', 'com_icagenda.registration.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId) && $recordId)
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then do the test.
if ($ownerId == $userId)
{
return true;
}
}
// Since there is no asset tracking, revert to the component permissions.
return parent::allowEdit($data, $key);
}
}
PK �|!]{��%[ [ features.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author doorknob & Cyril Rezé
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-07-02
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Features list controller class.
*/
class iCagendaControllerFeatures extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 3.4.0
*/
public function getModel($name = 'feature', $prefix = 'iCagendaModel')
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
PK �|!]�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 �|!]����` ` customfields.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-05-01
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Categories list controller class.
*/
class iCagendaControllerCustomfields extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 1.0
*/
public function getModel($name = 'customfield', $prefix = 'iCagendaModel')
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
PK �|!]��
�u u registrations.raw.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.5.9 2015-07-23
* @since 3.5.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
/**
* Registrations list controller class.
*
* @since 3.5.0
*/
class icagendaControllerRegistrations extends JControllerLegacy
{
/**
* @var string The context for persistent state.
*
* @since 3.5.0
*/
protected $context = 'com_icagenda.registrations';
/**
* Proxy for getModel.
*
* @param string $name The name of the model.
* @param string $prefix The prefix for the model class name.
* @param array $config Configuration array for model. Optional.
*
* @return JModel
*
* @since 3.5.0
*/
public function getModel($name = 'Registrations', $prefix = 'iCagendaModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
/**
* Display method for the raw track data.
*
* @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 JController This object to support chaining.
*
* @since 3.5.0
* @todo This should be done as a view, not here!
*/
public function display($cachable = false, $urlparams = false)
{
// Get the document object.
$document = JFactory::getDocument();
$vName = 'registrations';
$vFormat = 'raw';
// Get and render the view.
if ($view = $this->getView($vName, $vFormat))
{
// Get the model for the view.
$model = $this->getModel($vName);
// Load the filter state.
$app = JFactory::getApplication();
$published = $app->getUserState($this->context . '.filter.state');
$model->setState('filter.state', $published);
$eventId = $app->getUserState($this->context . '.filter.events');
$model->setState('filter.events', $eventId);
$date = $app->getUserState($this->context . '.filter.dates');
$model->setState('filter.dates', $date);
$model->setState('list.limit', 0);
$model->setState('list.start', 0);
$input = JFactory::getApplication()->input;
$form = $input->get('jform', array(), 'array');
$model->setState('event_title', $form['event_title']);
$model->setState('date', $form['date']);
$model->setState('tickets', $form['tickets']);
$model->setState('name', $form['name']);
$model->setState('email', $form['email']);
$model->setState('phone', $form['phone']);
$model->setState('customfields', $form['customfields']);
$model->setState('notes', $form['notes']);
$model->setState('status', $form['status']);
$model->setState('basename', $form['basename']);
$model->setState('separator', $form['separator']);
$model->setState('compressed', $form['compressed']);
$config = JFactory::getConfig();
$cookie_domain = $config->get('cookie_domain', '');
$cookie_path = $config->get('cookie_path', '/');
// Joomla 3
if (version_compare(JVERSION, '3.0', 'ge'))
{
setcookie(JApplicationHelper::getHash($this->context . '.event_title'), $form['event_title'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.date'), $form['date'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.tickets'), $form['tickets'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.name'), $form['name'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.email'), $form['email'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.phone'), $form['phone'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.customfields'), $form['customfields'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.notes'), $form['notes'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.status'), $form['status'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.separator'), $form['separator'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain);
}
// Joomla 2.5
else
{
setcookie(JApplication::getHash($this->context.'.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplication::getHash($this->context.'.separator'), $form['separator'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplication::getHash($this->context.'.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain);
}
// Push the model into the view (as default).
$view->setModel($model, true);
// Push document object into the view.
$view->document = $document;
$view->display();
}
}
}
PK �|!]�r��� �
themes.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.0 2013-06-03
* @since 2.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
jimport('joomla.client.helper');
class iCagendaControllerthemes extends JControllerForm
{
protected $option = 'com_icagenda';
function __construct() {
parent::__construct();
$this->registerTask( 'themeinstall' , 'themeinstall' );
}
function themeinstall() {
JRequest::checkToken() or die( 'Invalid Token' );
$post = JRequest::get('post');
$theme = array();
if (isset($post['theme_component'])) {
$theme['component'] = 1;
}
if (empty($theme)) {
$ftp =& JClientHelper::setCredentialsFromRequest('ftp');
$model = &$this->getModel( 'themes' );
if ($model->install($theme)) {
$cache = &JFactory::getCache('mod_menu');
$cache->clean();
$msg = JText::_('COM_ICAGENDA_SUCCESS_THEME_INSTALLED');
}
} else {
$msg = JText::_('COM_ICAGENDA_ERROR_THEME_APPLICATION_AREA');
}
$this->setRedirect( 'index.php?option=com_icagenda&view=themes', $msg );
}
function cancel() {
$this->setRedirect( 'index.php?option=com_icagenda' );
}
}
?>
PK �|!]vu$$ $ event.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 2.1 2013-02-17
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Event controller class.
*/
class iCagendaControllerEvent extends JControllerForm
{
function __construct()
{
$this->view_list = 'events';
parent::__construct();
}
/**
* 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())
{
// Initialise variables.
$user = JFactory::getUser();
$categoryId = JArrayHelper::getValue($data, 'catid', JRequest::getInt('filter_category_id'), 'int');
$allow = null;
if ($categoryId)
{
// If the category has been passed in the data or URL check it.
$allow = $user->authorise('core.create', 'com_icagenda.category.' . $categoryId);
}
if ($allow === null)
{
// In the absense of better information, revert to the component permissions.
return parent::allowAdd();
}
else
{
return $allow;
}
}
/**
* Method override to check if you can edit an existing 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')
{
// Initialise variables.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
$userId = $user->get('id');
// Check general edit permission first.
if ($user->authorise('core.edit', 'com_icagenda.event.' . $recordId))
{
return true;
}
// Fallback on edit.own.
// First test if the permission is available.
if ($user->authorise('core.edit.own', 'com_icagenda.event.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId) && $recordId)
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then do the test.
if ($ownerId == $userId)
{
return true;
}
}
// Since there is no asset tracking, revert to the component permissions.
return parent::allowEdit($data, $key);
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 1.6
*/
public function batch($model = null)
{
JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Event', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_icagenda&view=events' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
}
PK �|!]��
�� � icagenda.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.0 2013-05-05
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Categories list controller class.
*/
// J2.5 : class iCagendaControlleriCagenda extends JControllerAdmin
class iCagendaControlleriCagenda extends JControllerLegacyAdmin
{
/**
* Proxy for getModel.
* @since 1.6
*/
public function &getModel($name = 'icagenda', $prefix = 'iCagendaModel')
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
PK �|!]�")_d d registrations.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.5.9 2015-07-22
* @since 2.0.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Registrations list controller class.
*/
class iCagendaControllerRegistrations extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 2.0.0
*/
public function getModel($name = 'registration', $prefix = 'iCagendaModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK �|!]J�ۄ� � feature.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author doorknob
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-07-02
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Feature controller class.
*/
class iCagendaControllerFeature extends JControllerForm
{
function __construct()
{
$this->view_list = 'features';
parent::__construct();
}
}
PK �|!]wtW�
index.htmlnu &1i� <html><body></body></html>PK �}!]"��Kg g
file.json.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
/**
* File Media Controller
*
* @since 1.6
*/
class MediaControllerFile extends JControllerLegacy
{
/**
* Upload a file
*
* @return void
*
* @since 1.5
*/
public function upload()
{
$params = JComponentHelper::getParams('com_media');
// Check for request forgeries
if (!JSession::checkToken('request'))
{
$response = array(
'status' => '0',
'message' => JText::_('JINVALID_TOKEN'),
'error' => JText::_('JINVALID_TOKEN')
);
echo json_encode($response);
return;
}
// Get the user
$user = JFactory::getUser();
JLog::addLogger(array('text_file' => 'upload.error.php'), JLog::ALL, array('upload'));
// Get some data from the request
$file = $this->input->files->get('Filedata', '', 'array');
$folder = $this->input->get('folder', '', 'path');
// Instantiate the media helper
$mediaHelper = new JHelperMedia;
if ($_SERVER['CONTENT_LENGTH'] > ($params->get('upload_maxsize', 0) * 1024 * 1024)
|| $_SERVER['CONTENT_LENGTH'] > $mediaHelper->toBytes(ini_get('upload_max_filesize'))
|| $_SERVER['CONTENT_LENGTH'] > $mediaHelper->toBytes(ini_get('post_max_size'))
|| $_SERVER['CONTENT_LENGTH'] > $mediaHelper->toBytes(ini_get('memory_limit')))
{
$response = array(
'status' => '0',
'message' => JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'),
'error' => JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE')
);
echo json_encode($response);
return;
}
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
if (isset($file['name']))
{
// Make the filename safe
$file['name'] = JFile::makeSafe($file['name']);
// We need a URL safe name
$fileparts = pathinfo(COM_MEDIA_BASE . '/' . $folder . '/' . $file['name']);
// Transform filename to punycode
$fileparts['filename'] = JStringPunycode::toPunycode($fileparts['filename']);
$tempExt = !empty($fileparts['extension']) ? strtolower($fileparts['extension']) : '';
// Transform filename to punycode, then neglect other than non-alphanumeric characters & underscores. Also transform extension to lowercase
$safeFileName = preg_replace(array("/[\\s]/", '/[^a-zA-Z0-9_\-]/'), array('_', ''), $fileparts['filename']) . '.' . $tempExt;
// Create filepath with safe-filename
$files['final'] = $fileparts['dirname'] . DIRECTORY_SEPARATOR . $safeFileName;
$file['name'] = $safeFileName;
$filepath = JPath::clean($files['final']);
if (!$mediaHelper->canUpload($file, 'com_media')
|| strpos(realpath($fileparts['dirname']), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
try
{
JLog::add('Invalid: ' . $filepath, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'message' => JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE'),
'error' => JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE')
);
echo json_encode($response);
return;
}
// Trigger the onContentBeforeSave event.
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$object_file = new JObject($file);
$object_file->filepath = $filepath;
$result = $dispatcher->trigger('onContentBeforeSave', array('com_media.file', &$object_file, true));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
try
{
JLog::add(
'Errors before save: ' . $object_file->filepath . ' : ' . implode(', ', $object_file->getErrors()),
JLog::INFO,
'upload'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'message' => JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors)),
'error' => JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors))
);
echo json_encode($response);
return;
}
if (JFile::exists($object_file->filepath))
{
// File exists
try
{
JLog::add('File exists: ' . $object_file->filepath . ' by user_id ' . $user->id, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'message' => JText::_('COM_MEDIA_ERROR_FILE_EXISTS'),
'error' => JText::_('COM_MEDIA_ERROR_FILE_EXISTS'),
'location' => str_replace(JPATH_ROOT, '', $filepath)
);
echo json_encode($response);
return;
}
elseif (!$user->authorise('core.create', 'com_media'))
{
// File does not exist and user is not authorised to create
try
{
JLog::add('Create not permitted: ' . $object_file->filepath . ' by user_id ' . $user->id, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'error' => JText::_('COM_MEDIA_ERROR_CREATE_NOT_PERMITTED'),
'message' => JText::_('COM_MEDIA_ERROR_CREATE_NOT_PERMITTED')
);
echo json_encode($response);
return;
}
if (!JFile::upload($object_file->tmp_name, $object_file->filepath))
{
// Error in upload
try
{
JLog::add('Error on upload: ' . $object_file->filepath, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'message' => JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE'),
'error' => JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE')
);
echo json_encode($response);
return;
}
else
{
// Trigger the onContentAfterSave event.
$dispatcher->trigger('onContentAfterSave', array('com_media.file', &$object_file, true));
try
{
JLog::add($folder, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$returnUrl = str_replace(JPATH_ROOT, '', $object_file->filepath);
$response = array(
'status' => '1',
'message' => JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', $returnUrl),
'error' => JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', $returnUrl),
'location' => str_replace('\\', '/', $returnUrl)
);
echo json_encode($response);
return;
}
}
else
{
$response = array(
'status' => '0',
'error' => JText::_('COM_MEDIA_ERROR_BAD_REQUEST'),
'message' => JText::_('COM_MEDIA_ERROR_BAD_REQUEST')
);
echo json_encode($response);
return;
}
}
}
PK �}!]���) ) file.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @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;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
/**
* Media File Controller
*
* @since 1.5
*/
class MediaControllerFile extends JControllerLegacy
{
/**
* The folder we are uploading into
*
* @var string
*/
protected $folder = '';
/**
* Upload one or more files
*
* @return boolean
*
* @since 1.5
*/
public function upload()
{
// Check for request forgeries
$this->checkToken('request');
$params = JComponentHelper::getParams('com_media');
// Get some data from the request
$files = $this->input->files->get('Filedata', array(), 'array');
$return = JFactory::getSession()->get('com_media.return_url');
$this->folder = $this->input->get('folder', '', 'path');
// Instantiate the media helper
$mediaHelper = new JHelperMedia;
// Don't redirect to an external URL.
if (!JUri::isInternal($return))
{
$return = '';
}
// Set the redirect
if ($return)
{
$this->setRedirect($return . '&folder=' . $this->folder);
}
else
{
$this->setRedirect('index.php?option=com_media&folder=' . $this->folder);
}
// First check against unfiltered input.
if (!$this->input->files->get('Filedata', null, 'RAW'))
{
// Total length of post back data in bytes.
$contentLength = $this->input->server->get('CONTENT_LENGTH', 0, 'INT');
// Maximum allowed size of post back data in MB.
$postMaxSize = $mediaHelper->toBytes(ini_get('post_max_size'));
// Maximum allowed size of script execution in MB.
$memoryLimit = $mediaHelper->toBytes(ini_get('memory_limit'));
// Check for the total size of post back data.
if (($postMaxSize > 0 && $contentLength > $postMaxSize)
|| ($memoryLimit != -1 && $contentLength > $memoryLimit))
{
// Files are too large.
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNUPLOADTOOLARGE'));
return false;
}
// No files were provided.
$this->setMessage(JText::_('COM_MEDIA_ERROR_UPLOAD_INPUT'), 'warning');
return false;
}
if (!$files)
{
// Files were provided but are unsafe to upload.
$this->setMessage(JText::_('COM_MEDIA_ERROR_WARNFILENOTSAFE'), 'error');
return false;
}
// Authorize the user
if (!$this->authoriseUser('create'))
{
return false;
}
$uploadMaxSize = $params->get('upload_maxsize', 0) * 1024 * 1024;
$uploadMaxFileSize = $mediaHelper->toBytes(ini_get('upload_max_filesize'));
// Perform basic checks on file info before attempting anything
foreach ($files as &$file)
{
// Make the filename safe
$file['name'] = JFile::makeSafe($file['name']);
// We need a url safe name
$fileparts = pathinfo(COM_MEDIA_BASE . '/' . $this->folder . '/' . $file['name']);
if (strpos(realpath($fileparts['dirname']), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER'));
return false;
}
// Transform filename to punycode, check extension and transform it to lowercase
$fileparts['filename'] = JStringPunycode::toPunycode($fileparts['filename']);
$tempExt = !empty($fileparts['extension']) ? strtolower($fileparts['extension']) : '';
// Neglect other than non-alphanumeric characters, hyphens & underscores.
$safeFileName = preg_replace(array("/[\\s]/", '/[^a-zA-Z0-9_\-]/'), array('_', ''), $fileparts['filename']) . '.' . $tempExt;
$file['name'] = $safeFileName;
$file['filepath'] = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $this->folder, $file['name'])));
if (($file['error'] == 1)
|| ($uploadMaxSize > 0 && $file['size'] > $uploadMaxSize)
|| ($uploadMaxFileSize > 0 && $file['size'] > $uploadMaxFileSize))
{
// File size exceed either 'upload_max_filesize' or 'upload_maxsize'.
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'));
return false;
}
if (JFile::exists($file['filepath']))
{
// A file with this name already exists
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_FILE_EXISTS'));
return false;
}
if (!isset($file['name']))
{
// No filename (after the name was cleaned by JFile::makeSafe)
$this->setRedirect('index.php', JText::_('COM_MEDIA_INVALID_REQUEST'), 'error');
return false;
}
}
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
foreach ($files as &$file)
{
// The request is valid
$err = null;
if (!MediaHelper::canUpload($file, $err))
{
// The file can't be uploaded
return false;
}
// Trigger the onContentBeforeSave event.
$object_file = new JObject($file);
$result = $dispatcher->trigger('onContentBeforeSave', array('com_media.file', &$object_file, true));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors)));
return false;
}
if (!JFile::upload($object_file->tmp_name, $object_file->filepath))
{
// Error in upload
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE'));
return false;
}
// Trigger the onContentAfterSave event.
$dispatcher->trigger('onContentAfterSave', array('com_media.file', &$object_file, true));
$this->setMessage(JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
return true;
}
/**
* Check that the user is authorized to perform this action
*
* @param string $action - the action to be performed (create or delete)
*
* @return boolean
*
* @since 1.6
*/
protected function authoriseUser($action)
{
if (!JFactory::getUser()->authorise('core.' . strtolower($action), 'com_media'))
{
// User is not authorised
JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_' . strtoupper($action) . '_NOT_PERMITTED'));
return false;
}
return true;
}
/**
* Deletes paths from the current path
*
* @return boolean
*
* @since 1.5
*/
public function delete()
{
$this->checkToken('request');
$user = JFactory::getUser();
// Get some data from the request
$tmpl = $this->input->get('tmpl');
$paths = $this->input->get('rm', array(), 'array');
$folder = $this->input->get('folder', '', 'path');
$redirect = 'index.php?option=com_media&folder=' . $folder;
if ($tmpl == 'component')
{
// We are inside the iframe
$redirect .= '&view=mediaList&tmpl=component';
}
$this->setRedirect($redirect);
// Just return if there's nothing to do
if (empty($paths))
{
$this->setMessage(JText::_('JERROR_NO_ITEMS_SELECTED'), 'error');
return true;
}
if (!$user->authorise('core.delete', 'com_media'))
{
// User is not authorised to delete
JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'));
return false;
}
// Need this to enqueue messages.
$app = JFactory::getApplication();
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$ret = true;
$safePaths = array_intersect($paths, array_map(array('JFile', 'makeSafe'), $paths));
foreach ($safePaths as $key => $path)
{
$fullPath = implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path));
if (strpos(realpath($fullPath), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
unset($safePaths[$key]);
}
}
$unsafePaths = array_diff($paths, $safePaths);
foreach ($unsafePaths as $path)
{
$path = JPath::clean(implode(DIRECTORY_SEPARATOR, array($folder, $path)));
$path = htmlspecialchars($path, ENT_COMPAT, 'UTF-8');
$app->enqueueMessage(JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FILE_WARNFILENAME', $path), 'error');
}
foreach ($safePaths as $path)
{
$fullPath = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path)));
$object_file = new JObject(array('filepath' => $fullPath));
if (is_file($object_file->filepath))
{
// Trigger the onContentBeforeDelete event.
$result = $dispatcher->trigger('onContentBeforeDelete', array('com_media.file', &$object_file));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
$errors = $object_file->getErrors();
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors), implode('<br />', $errors)));
continue;
}
$ret &= JFile::delete($object_file->filepath);
// Trigger the onContentAfterDelete event.
$dispatcher->trigger('onContentAfterDelete', array('com_media.file', &$object_file));
$app->enqueueMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
elseif (is_dir($object_file->filepath))
{
$contents = JFolder::files($object_file->filepath, '.', true, false, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html'));
if (!empty($contents))
{
// This makes no sense...
$folderPath = substr($object_file->filepath, strlen(COM_MEDIA_BASE));
JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_NOT_EMPTY', $folderPath));
continue;
}
// Trigger the onContentBeforeDelete event.
$result = $dispatcher->trigger('onContentBeforeDelete', array('com_media.folder', &$object_file));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
$errors = $object_file->getErrors();
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors), implode('<br />', $errors)));
continue;
}
$ret &= !JFolder::delete($object_file->filepath);
// Trigger the onContentAfterDelete event.
$dispatcher->trigger('onContentAfterDelete', array('com_media.folder', &$object_file));
$app->enqueueMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
}
return $ret;
}
}
PK �}!]��N� �
folder.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @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;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
/**
* Folder Media Controller
*
* @since 1.5
*/
class MediaControllerFolder extends JControllerLegacy
{
/**
* Deletes paths from the current path
*
* @return boolean
*
* @since 1.5
*/
public function delete()
{
$this->checkToken('request');
$user = JFactory::getUser();
// Get some data from the request
$tmpl = $this->input->get('tmpl');
$paths = $this->input->get('rm', array(), 'array');
$folder = $this->input->get('folder', '', 'path');
$redirect = 'index.php?option=com_media&folder=' . $folder;
if ($tmpl == 'component')
{
// We are inside the iframe
$redirect .= '&view=mediaList&tmpl=component';
}
$this->setRedirect($redirect);
// Just return if there's nothing to do
if (empty($paths))
{
$this->setMessage(JText::_('JERROR_NO_ITEMS_SELECTED'), 'error');
return true;
}
if (!$user->authorise('core.delete', 'com_media'))
{
// User is not authorised to delete
JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'));
return false;
}
// Need this to enqueue messages.
$app = JFactory::getApplication();
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$ret = true;
$safePaths = array_intersect($paths, array_map(array('JFile', 'makeSafe'), $paths));
$unsafePaths = array_diff($paths, $safePaths);
foreach ($unsafePaths as $path)
{
$path = JPath::clean(implode(DIRECTORY_SEPARATOR, array($folder, $path)));
$path = htmlspecialchars($path, ENT_COMPAT, 'UTF-8');
$app->enqueueMessage(JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FILE_WARNFILENAME', $path), 'error');
}
foreach ($safePaths as $path)
{
$fullPath = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path)));
if (strpos(realpath($fullPath), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER'));
continue;
}
$object_file = new JObject(array('filepath' => $fullPath));
if (is_file($object_file->filepath))
{
// Trigger the onContentBeforeDelete event.
$result = $dispatcher->trigger('onContentBeforeDelete', array('com_media.file', &$object_file));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
$errors = $object_file->getErrors();
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors), implode('<br />', $errors)));
continue;
}
$ret &= JFile::delete($object_file->filepath);
// Trigger the onContentAfterDelete event.
$dispatcher->trigger('onContentAfterDelete', array('com_media.file', &$object_file));
$app->enqueueMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
elseif (is_dir($object_file->filepath))
{
$contents = JFolder::files($object_file->filepath, '.', true, false, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html'));
if (!empty($contents))
{
// This makes no sense...
$folderPath = substr($object_file->filepath, strlen(COM_MEDIA_BASE));
JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_NOT_EMPTY', $folderPath));
continue;
}
// Trigger the onContentBeforeDelete event.
$result = $dispatcher->trigger('onContentBeforeDelete', array('com_media.folder', &$object_file));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
$errors = $object_file->getErrors();
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors), implode('<br />', $errors)));
continue;
}
$ret &= !JFolder::delete($object_file->filepath);
// Trigger the onContentAfterDelete event.
$dispatcher->trigger('onContentAfterDelete', array('com_media.folder', &$object_file));
$app->enqueueMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
}
return $ret;
}
/**
* Create a folder
*
* @return boolean
*
* @since 1.5
*/
public function create()
{
// Check for request forgeries
$this->checkToken();
$user = JFactory::getUser();
$folder = $this->input->get('foldername', '');
$folderCheck = (string) $this->input->get('foldername', null, 'raw');
$parent = $this->input->get('folderbase', '', 'path');
$this->setRedirect('index.php?option=com_media&folder=' . $parent . '&tmpl=' . $this->input->get('tmpl', 'index'));
if (strlen($folder) > 0)
{
if (!$user->authorise('core.create', 'com_media'))
{
// User is not authorised to create
JError::raiseWarning(403, JText::_('COM_MEDIA_ERROR_CREATE_NOT_PERMITTED'));
return false;
}
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
$this->input->set('folder', $parent);
if (($folderCheck !== null) && ($folder !== $folderCheck))
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_MEDIA_ERROR_UNABLE_TO_CREATE_FOLDER_WARNDIRNAME'), 'warning');
return false;
}
$path = JPath::clean(COM_MEDIA_BASE . '/' . $parent . '/' . $folder);
if (strpos(realpath(COM_MEDIA_BASE . '/' . $parent), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER'), 'error');
return false;
}
if (!is_dir($path) && !is_file($path))
{
// Trigger the onContentBeforeSave event.
$object_file = new JObject(array('filepath' => $path));
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$result = $dispatcher->trigger('onContentBeforeSave', array('com_media.folder', &$object_file, true));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors)));
return false;
}
if (JFolder::create($object_file->filepath))
{
$data = "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($object_file->filepath . '/index.html', $data);
// Trigger the onContentAfterSave event.
$dispatcher->trigger('onContentAfterSave', array('com_media.folder', &$object_file, true));
$this->setMessage(JText::sprintf('COM_MEDIA_CREATE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
}
$this->input->set('folder', ($parent) ? $parent . '/' . $folder : $folder);
}
else
{
// File name is of zero length (null).
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_UNABLE_TO_CREATE_FOLDER_WARNDIRNAME'));
return false;
}
return true;
}
}
PK D�!]lU,�� � menus.phpnu &1i� <?php
/**
* @name Slideshow CK
* @package com_slideshowck
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
*/
// No direct access
defined('CK_LOADED') or die;
use \Slideshowck\CKController;
use \Slideshowck\CKFof;
class SlideshowckControllerMenus extends CKController {
function ajaxShowMenuItems() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$parentId = $this->input->get('parentid', 0, 'int');
$menutype = $this->input->get('menutype', '', 'string');
$model = $this->getModel('Menus', 'Slideshowck', array());
$items = $model->getChildrenItems($menutype, $parentId);
$links = array();
$imagespath = SLIDESHOWCK_MEDIA_URI .'/images/';
?>
<div class="cksubfolder">
<?php
foreach ($items as $item) {
// CKFof::dump($item);
$aliasId = $item->id;
if ($item->type == 'alias') {
$itemParams = new \Joomla\Registry\Registry($item->params);
$aliasId = $itemParams->get('aliasoptions', 0);
}
$Itemid = substr($item->link,-7,7) == 'Itemid=' ? $aliasId : '&Itemid=' . $aliasId;
?>
<div class="ckfoldertree parent">
<div class="ckfoldertreetoggler <?php if ($item->rgt - $item->lft <= 1) { echo 'empty'; } ?>" onclick="ckToggleTreeSub(this, <?php echo $item->id ?>)" data-menutype="<?php echo $item->menutype; ?>"></div>
<div class="ckfoldertreename hasTip" title="<?php echo $item->link . $Itemid ?>" onclick="ckSetMenuItemUrl('<?php echo $item->link . $Itemid ?>')"><img src="<?php echo $imagespath ?>folder.png" /><?php echo $item->title; ?></div>
</div>
<?php
}
?>
</div>
<?php
exit;
}
}
PK D�!]m�6�v v ajax.phpnu &1i� <?php
/**
* @name Slideshow CK
* @package com_slideshowck
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
*/
// No direct access
defined('CK_LOADED') or die;
use \Slideshowck\CKController;
use \Slideshowck\CKFof;
use \Slideshowck\CKText;
class SlideshowckControllerAjax extends CKController {
function __construct() {
// security check
if (! CKFof::checkAjaxToken()) exit;
parent::__construct();
$plugin = $this->input->get('plugin', '', 'cmd');
$task = $this->input->get('task', '', 'cmd');
if ($plugin) {
if (file_exists(SLIDESHOWCK_PLUGINS_PATH . '/' . $plugin . '/helper/helper_' . $plugin . '.php')) {
require_once(SLIDESHOWCK_PLUGINS_PATH . '/' . $plugin . '/helper/helper_' . $plugin . '.php');
$className = 'SlideshowckHelpersource' . ucfirst($plugin);
//SlideshowckHelpersourceArticles
$class = new $className();
if (method_exists($class, $task)) {
$class::$task();
exit;
}
}
}
die;
}
}
PK ��!]�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 ��!]��&�8 �8 user.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class UserController extends acymailingController{
function __construct($config = array()){
parent::__construct($config);
$this->registerDefaultTask('subscribe');
$this->registerTask('optout', 'unsub');
$this->registerTask('out', 'unsub');
}
function confirm(){
if(acymailing_isRobot()) return false;
$config = acymailing_config();
$userClass = acymailing_get('class.subscriber');
$userClass->geolocRight = true;
$user = $userClass->identify();
if(empty($user)) return false;
$redirectUrl = $config->get('confirm_redirect');
$listRedirection = '';
$subscription = $userClass->getSubscriptionStatus($user->subid);
foreach($subscription as $i => $onelist){
if(!in_array($onelist->status, array(1, 2)) || acymailing_translation('REDIRECTION_CONFIRMATION_'.$i) == 'REDIRECTION_CONFIRMATION_'.$i) continue;
$listRedirection = acymailing_translation('REDIRECTION_CONFIRMATION_'.$i);
break;
}
if(!empty($listRedirection)) $redirectUrl = $listRedirection;
if($config->get('confirmation_message', 1)){
if($user->confirmed && strlen(acymailing_translation('ALREADY_CONFIRMED')) > 0){
acymailing_enqueueMessage(acymailing_translation('ALREADY_CONFIRMED'));
}elseif(!$user->confirmed && strlen(acymailing_translation('SUBSCRIPTION_CONFIRMED')) > 0) acymailing_enqueueMessage(acymailing_translation('SUBSCRIPTION_CONFIRMED'));
}
if(!$user->confirmed) $userClass->confirmSubscription($user->subid);
$notifConfirm = $config->get('notification_confirm');
if(!empty($notifConfirm)){
$listsubClass = acymailing_get('class.listsub');
$userHelper = acymailing_get('helper.user');
$mailer = acymailing_get('helper.mailer');
$mailer->autoAddUser = true;
$mailer->checkConfirmField = false;
$mailer->report = false;
foreach($user as $field => $value) $mailer->addParam('user:'.$field, $value);
$mailer->addParam('user:subscription', $listsubClass->getSubscriptionString($user->subid));
$mailer->addParam('user:subscriptiondates', $listsubClass->getSubscriptionString($user->subid, true));
$mailer->addParam('user:ip', $userHelper->getIP());
if(!empty($userClass->geolocData)){
foreach($userClass->geolocData as $map => $value){
$mailer->addParam('geoloc:notif_'.$map, $value);
}
}
$mailer->addParamInfo();
$allUsers = explode(' ', trim(str_replace(array(';', ','), ' ', $notifConfirm)));
foreach($allUsers as $oneUser){
if(empty($oneUser)) continue;
$mailer->sendOne('notification_confirm', $oneUser);
}
}
if(!empty($redirectUrl)){
$replace = array();
foreach($user as $key => $val){
$replace['{'.$key.'}'] = $val;
$replace['{user:'.$key.'}'] = $val;
}
if($config->get('redirect_tags', 0) == 1) $redirectUrl = str_replace(array_keys($replace), $replace, $redirectUrl);
acymailing_redirect($redirectUrl);
}
if('joomla' == 'wordpress') acymailing_redirect(acymailing_rootURI());
acymailing_setVar('layout', 'confirm');
return parent::display();
}//endfct
function modify(){
$userClass = acymailing_get('class.subscriber');
$userClass->geolocRight = true;
$user = $userClass->identify(true);
if(empty($user)) return $this->subscribe();
acymailing_setVar('layout', 'modify');
return parent::display();
}
function subscribe(){
$userClass = acymailing_get('class.subscriber');
$userClass->geolocRight = true;
$currentUserid = acymailing_currentUserId();
if(!empty($currentUserid) AND $userClass->identify(true)){
return $this->modify();
}
$config = acymailing_config();
$allowvisitor = $config->get('allow_visitor', 1);
if(empty($allowvisitor)){
acymailing_askLog(true, 'ONLY_LOGGED', 'message');
return false;
}
acymailing_setVar('layout', 'modify');
return parent::display();
}
function unsub(){
$userClass = acymailing_get('class.subscriber');
$user = $userClass->identify();
if(empty($user)) return false;
$statsClass = acymailing_get('class.stats');
$statsClass->countReturn = false;
$statsClass->saveStats();
acymailing_setVar('layout', 'unsub');
return parent::display();
}
function saveunsub(){
acymailing_checkRobots();
$subscriberClass = acymailing_get('class.subscriber');
$subscriberClass->sendConf = false;
$listsubClass = acymailing_get('class.listsub');
$userHelper = acymailing_get('helper.user');
$config = acymailing_config();
$subscriber = new stdClass();
$subscriber->subid = acymailing_getVar('int', 'subid');
$user = $subscriberClass->identify();
if(!$user || empty($subscriber->subid) || $user->subid != $subscriber->subid){
echo "<script>alert('ERROR : You are not allowed to modify this user'); window.history.go(-1);</script>";
exit;
}
$refusemails = acymailing_getVar('int', 'refuse');
$unsuball = acymailing_getVar('int', 'unsuball');
$mailid = acymailing_getVar('int', 'mailid');
$oldUser = $subscriberClass->get($subscriber->subid);
$survey = acymailing_getVar('array', 'survey', array(), '');
$tagSurvey = '';
$data = array();
if(!empty($survey)){
foreach($survey as $oneResult){
if(empty($oneResult)) continue;
$data[] = "REASON::".str_replace(array("\n", "\r"), array('<br />', ''), strip_tags($oneResult));
}
$tagSurvey = implode('<br />', $data);
}
$replace = array();
$replace['REASON::'] = '<br />'.acymailing_translation('REASON').' : ';
$reasons = unserialize($config->get('unsub_reasons'));
foreach($reasons as $i => $oneReason){
if(preg_match('#^[A-Z_]*$#', $oneReason)){
$replace[$oneReason] = acymailing_translation($oneReason);
}
}
$tagSurvey = str_replace(array_keys($replace), $replace, $tagSurvey);
$historyClass = acymailing_get('class.acyhistory');
$historyClass->insert($subscriber->subid, 'unsubscribed', $data, $mailid);
$notifToSend = '';
$incrementUnsub = false;
if($refusemails OR $unsuball){
if($refusemails){
$subscriber->accept = 0;
if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('CONFIRM_UNSUB_FULL')) > 0) acymailing_enqueueMessage(acymailing_translation('CONFIRM_UNSUB_FULL'));
$notifToSend = 'notification_refuse';
}elseif($unsuball){
$notifToSend = 'notification_unsuball';
}
$subscription = $subscriberClass->getSubscriptionStatus($subscriber->subid);
$updatelists = array();
foreach($subscription as $listid => $oneList){
if($oneList->status != -1){
$updatelists[-1][] = $listid;
}
}
$listsubClass->sendNotif = false;
if(!empty($updatelists)){
$status = $listsubClass->updateSubscription($subscriber->subid, $updatelists);
if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('CONFIRM_UNSUB_ALL')) > 0) acymailing_enqueueMessage(acymailing_translation('CONFIRM_UNSUB_ALL'));
$incrementUnsub = true;
}else{
if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('ERROR_NOT_SUBSCRIBED')) > 0) acymailing_enqueueMessage(acymailing_translation('ERROR_NOT_SUBSCRIBED'));
}
$subscriber->confirmed = 0;
$subscriberClass->save($subscriber);
}else{
$subscription = $subscriberClass->getSubscriptionStatus($subscriber->subid);
$allLists = acymailing_loadObjectList('SELECT b.listid, b.name, b.type FROM '.acymailing_table('listmail').' as a JOIN '.acymailing_table('list').' as b on a.listid = b.listid WHERE a.mailid = '.$mailid);
if(empty($allLists)){
$allLists = acymailing_loadObjectList('SELECT b.listid, b.name, b.type FROM '.acymailing_table('list').' as b WHERE b.welmailid = '.$mailid.' OR b.unsubmailid = '.$mailid);
}
if(empty($allLists)){
$allLists = acymailing_loadObjectList('SELECT b.listid, b.name, b.type FROM #__acymailing_listsub as a JOIN #__acymailing_list as b on a.listid = b.listid WHERE a.subid = '.$subscriber->subid);
}
$otherSubscriptionsBoxes = acymailing_getVar('array', 'unsubotherlists', array(), 'post');
$otherSubscriptionsId = acymailing_getVar('array', 'unsubotherlistsid', array(), 'post');
$othersubscriptionsToRemove = array();
if(!empty($otherSubscriptionsBoxes)){
$i = 0;
foreach($otherSubscriptionsBoxes as $anotherSubscriptionsBox => $value){
if($value == 1) $othersubscriptionsToRemove[] = intval($otherSubscriptionsId[$i]);
$i++;
}
$otherSubscriptions = acymailing_loadObjectList('SELECT listid, name, type FROM #__acymailing_list WHERE listid IN ('.implode(',', $othersubscriptionsToRemove).')');
foreach($otherSubscriptions as $anotherSubscription){
array_push($allLists, $anotherSubscription);
}
}
if(empty($allLists)){
echo "<script>alert('ERROR : Could not get the list for the mailing $mailid'); window.history.go(-1);</script>";
exit;
}
$campaignList = array();
$unsubList = array();
foreach($allLists as $oneList){
if(isset($subscription[$oneList->listid]) AND $subscription[$oneList->listid]->status != -1){
if($oneList->type == 'campaign'){
$campaignList[] = $oneList->listid;
}else{
$unsubList[$oneList->listid] = $oneList;
}
}
}
if(!empty($campaignList)){
$otherLists = acymailing_loadObjectList('SELECT b.listid, b.name, b.type FROM '.acymailing_table('listcampaign').' as a LEFT JOIN '.acymailing_table('list').' as b on a.listid = b.listid WHERE a.campaignid IN ('.implode(',', $campaignList).')');
if(!empty($otherLists)){
foreach($otherLists as $oneList){
if(isset($subscription[$oneList->listid]) AND $subscription[$oneList->listid]->status != -1){
$unsubList[$oneList->listid] = $oneList;
}
}
}
}
if(!empty($unsubList)){
$updatelists = array();
$updatelists[-1] = array_keys($unsubList);
$listsubClass->survey = $tagSurvey;
$status = $listsubClass->updateSubscription($subscriber->subid, $updatelists);
if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('CONFIRM_UNSUB_CURRENT')) > 0) acymailing_enqueueMessage(acymailing_translation('CONFIRM_UNSUB_CURRENT'));
$incrementUnsub = true;
}else{
if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('ERROR_NOT_SUBSCRIBED_CURRENT')) > 0) acymailing_enqueueMessage(acymailing_translation('ERROR_NOT_SUBSCRIBED_CURRENT'));
}
}
if($incrementUnsub){
$alreadythere = acymailing_loadResult('SELECT subid FROM #__acymailing_history WHERE `action` = "unsubscribed" AND `subid` = '.intval($subscriber->subid).' AND `mailid` = '.intval($mailid).' LIMIT 1,1');
if(empty($alreadythere)){
acymailing_query('UPDATE '.acymailing_table('stats').' SET `unsub` = `unsub` +1 WHERE `mailid` = '.(int)$mailid);
}
}
$classGeoloc = acymailing_get('class.geolocation');
$classGeoloc->saveGeolocation('unsubscription', $subscriber->subid);
if(!empty($notifToSend)){
$notifyUsers = $config->get($notifToSend);
if(!empty($notifyUsers)){
$mailer = acymailing_get('helper.mailer');
$mailer->autoAddUser = true;
$mailer->checkConfirmField = false;
$mailer->report = false;
foreach($oldUser as $field => $value) $mailer->addParam('user:'.$field, $value);
$mailer->addParam('user:subscription', $listsubClass->getSubscriptionString($oldUser->subid));
$mailer->addParam('user:subscriptiondates', $listsubClass->getSubscriptionString($oldUser->subid, true));
$mailer->addParam('user:ip', $userHelper->getIP());
$mailer->addParam('survey', $tagSurvey);
$mailer->addParamInfo();
$allUsers = explode(' ', trim(str_replace(array(';', ','), ' ', $notifyUsers)));
foreach($allUsers as $oneUser){
if(empty($oneUser)) continue;
$mailer->sendOne('notification_unsuball', $oneUser);
}
}
}
$redirectUnsub = $config->get('unsub_redirect');
if(!empty($redirectUnsub)){
$replace = array();
foreach($oldUser as $key => $val){
$replace['{'.$key.'}'] = $val;
$replace['{user:'.$key.'}'] = $val;
}
if($config->get('redirect_tags', 0) == 1) $redirectUnsub = str_replace(array_keys($replace), $replace, $redirectUnsub);
acymailing_redirect($redirectUnsub);
return;
}elseif('joomla' == 'wordpress'){
acymailing_redirect(acymailing_rootURI());
return;
}
acymailing_setVar('layout', 'saveunsub');
return parent::display();
}
function savechanges(){
acymailing_checkToken();
acymailing_checkRobots();
$config = acymailing_config();
$subscriberClass = acymailing_get('class.subscriber');
$subscriberClass->geolocRight = true;
$subscriberClass->extendedEmailVerif = true;
$status = $subscriberClass->saveForm();
$subscriberClass->sendNotification();
if($status){
if($subscriberClass->confirmationSent){
if($config->get('subscription_message', 1) && strlen(acymailing_translation('CONFIRMATION_SENT')) > 0) acymailing_enqueueMessage(acymailing_translation('CONFIRMATION_SENT'), 'message');
$redirectlink = $config->get('sub_redirect');
}elseif($subscriberClass->newUser){
if($config->get('subscription_message', 1) && strlen(acymailing_translation('SUBSCRIPTION_OK')) > 0) acymailing_enqueueMessage(acymailing_translation('SUBSCRIPTION_OK'), 'message');
$redirectlink = $config->get('sub_redirect');
}else{
if(strlen(acymailing_translation('SUBSCRIPTION_UPDATE_OK')) > 0) acymailing_enqueueMessage(acymailing_translation('SUBSCRIPTION_UPDATED_OK'), 'message');
$redirectlink = $config->get('modif_redirect');
}
}elseif($subscriberClass->requireId){
if(strlen(acymailing_translation('IDENTIFICATION_SENT')) > 0) acymailing_enqueueMessage(acymailing_translation('IDENTIFICATION_SENT'), 'notice');
}else{
if(strlen(acymailing_translation('ERROR_SAVING')) > 0) acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error');
}
if(!empty($redirectlink)){
if($config->get('redirect_tags', false)) {
$user = $subscriberClass->identify(true);
if(!empty($user->subid)) {
$replace = array();
foreach ($user as $key => $val) {
if(!is_array($val) && !is_object($val)) $replace['{' . $key . '}'] = $val;
}
$redirectlink = str_replace(array_keys($replace), $replace, $redirectlink);
}
}
acymailing_redirect($redirectlink);
return;
}
if($subscriberClass->identify(true)) return $this->modify();
return $this->subscribe();
}
}
PK ��!]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 ��!]�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 ��!]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 ��!]�$���
�
group.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2016 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\Registry\Registry;
/**
* The Group controller
*
* @since 3.7.0
*/
class FieldsControllerGroup extends JControllerForm
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS_GROUP';
/**
* The component for which the group applies.
*
* @var string
* @since 3.7.0
*/
private $component = '';
/**
* Class constructor.
*
* @param array $config A named array of configuration variables.
*
* @since 3.7.0
*/
public function __construct($config = array())
{
parent::__construct($config);
$parts = FieldsHelper::extract($this->input->getCmd('context'));
if ($parts)
{
$this->component = $parts[0];
}
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 3.7.0
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('Group');
// Preset the redirect
$this->setRedirect('index.php?option=com_fields&view=groups');
return parent::batch($model);
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 3.7.0
*/
protected function allowAdd($data = array())
{
return JFactory::getUser()->authorise('core.create', $this->component);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 3.7.0
*/
protected function allowEdit($data = array(), $key = 'parent_id')
{
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
// Zero record (parent_id:0), return component edit permission by calling parent controller method
if (!$recordId)
{
return parent::allowEdit($data, $key);
}
// Check edit on the record asset (explicit or inherited)
if ($user->authorise('core.edit', $this->component . '.fieldgroup.' . $recordId))
{
return true;
}
// Check edit own on the record asset (explicit or inherited)
if ($user->authorise('core.edit.own', $this->component . '.fieldgroup.' . $recordId) || $user->authorise('core.edit.own', $this->component))
{
// Existing record already has an owner, get it
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
// Grant if current user is owner of the record
return $user->id == $record->created_by;
}
return false;
}
/**
* 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.7.0
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
$item = $model->getItem();
if (isset($item->params) && is_array($item->params))
{
$registry = new Registry;
$registry->loadArray($item->params);
$item->params = (string) $registry;
}
return;
}
}
PK ��!]�A�
groups.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Groups list controller class.
*
* @since 3.7.0
*/
class FieldsControllerGroups extends JControllerAdmin
{
/**
* The prefix to use with controller messages.
*
* @var string
*
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS_GROUP';
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config The array of possible config values. Optional.
*
* @return JModelLegacy|boolean Model object on success; otherwise false on failure.
*
* @since 3.7.0
*/
public function getModel($name = 'Group', $prefix = 'FieldsModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK ��!]ҋ��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 �!]���� �
overrides.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @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;
/**
* Languages Overrides Controller.
*
* @since 2.5
*/
class LanguagesControllerOverrides extends JControllerAdmin
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 2.5
*/
protected $text_prefix = 'COM_LANGUAGES_VIEW_OVERRIDES';
/**
* Method for deleting one or more overrides.
*
* @return void
*
* @since 2.5
*/
public function delete()
{
// Check for request forgeries.
$this->checkToken();
// Get items to delete from the request.
$cid = (array) $this->input->get('cid', array(), 'string');
// Remove zero values resulting from input filter
$cid = array_filter($cid);
if (empty($cid))
{
$this->setMessage(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), 'warning');
}
else
{
// Get the model.
$model = $this->getModel('overrides');
// Remove the items.
if ($model->delete($cid))
{
$this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
}
else
{
$this->setMessage($model->getError());
}
}
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
}
/**
* Method to purge the overrider table.
*
* @return void
*
* @since 3.4.2
*/
public function purge()
{
// Check for request forgeries.
$this->checkToken();
$model = $this->getModel('overrides');
$model->purge();
$this->setRedirect(JRoute::_('index.php?option=com_languages&view=overrides', false));
}
}
PK �!]5���3 3 strings.json.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @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;
/**
* Languages Strings JSON Controller
*
* @since 2.5
*/
class LanguagesControllerStrings extends JControllerAdmin
{
/**
* Method for refreshing the cache in the database with the known language strings
*
* @return void
*
* @since 2.5
*/
public function refresh()
{
echo new JResponseJson($this->getModel('strings')->refresh());
}
/**
* Method for searching language strings
*
* @return void
*
* @since 2.5
*/
public function search()
{
echo new JResponseJson($this->getModel('strings')->search());
}
}
PK �!]d�
� � override.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @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;
/**
* Languages Override Controller
*
* @since 2.5
*/
class LanguagesControllerOverride extends JControllerForm
{
/**
* Method to edit an existing override.
*
* @param string $key The name of the primary key of the URL variable (not used here).
* @param string $urlVar The name of the URL variable if different from the primary key (not used here).
*
* @return void
*
* @since 2.5
*/
public function edit($key = null, $urlVar = null)
{
// Do not cache the response to this, its a redirect
JFactory::getApplication()->allowCache(false);
$app = JFactory::getApplication();
$cid = (array) $this->input->post->get('cid', array(), 'string');
$context = "$this->option.edit.$this->context";
// Get the constant name.
$recordId = (count($cid) ? $cid[0] : $this->input->get('id'));
// Access check.
if (!$this->allowEdit())
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false));
return;
}
$app->setUserState($context . '.data', null);
$this->setRedirect('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, 'id'));
}
/**
* Method to save an override.
*
* @param string $key The name of the primary key of the URL variable (not used here).
* @param string $urlVar The name of the URL variable if different from the primary key (not used here).
*
* @return void
*
* @since 2.5
*/
public function save($key = null, $urlVar = null)
{
// Check for request forgeries.
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$data = $this->input->post->get('jform', array(), 'array');
$context = "$this->option.edit.$this->context";
$task = $this->getTask();
$recordId = $this->input->get('id');
$data['id'] = $recordId;
// Access check.
if (!$this->allowSave($data, 'id'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false));
return;
}
// Validate the posted data.
$form = $model->getForm($data, false);
if (!$form)
{
$app->enqueueMessage($model->getError(), 'error');
return;
}
// Require helper for filter functions called by JForm.
JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
// Test whether the data is valid.
$validData = $model->validate($form, $data);
// Check for validation errors.
if ($validData === false)
{
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
{
if ($errors[$i] instanceof Exception)
{
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
}
else
{
$app->enqueueMessage($errors[$i], 'warning');
}
}
// Save the data in the session.
$app->setUserState($context . '.data', $data);
// Redirect back to the edit screen.
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, 'id'), false)
);
return;
}
// Attempt to save the data.
if (!$model->save($validData))
{
// Save the data in the session.
$app->setUserState($context . '.data', $validData);
// Redirect back to the edit screen.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, 'id'), false)
);
return;
}
// Add message of success.
$this->setMessage(JText::_('COM_LANGUAGES_VIEW_OVERRIDE_SAVE_SUCCESS'));
// Redirect the user and adjust session state based on the chosen task.
switch ($task)
{
case 'apply':
// Set the record data in the session.
$app->setUserState($context . '.data', null);
// Redirect back to the edit screen
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($validData['key'], 'id'), false)
);
break;
case 'save2new':
// Clear the record id and data from the session.
$app->setUserState($context . '.data', null);
// Redirect back to the edit screen
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend(null, 'id'), false)
);
break;
default:
// Clear the record id and data from the session.
$app->setUserState($context . '.data', null);
// Redirect to the list screen.
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false));
break;
}
}
/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable (not used here).
*
* @return void
*
* @since 2.5
*/
public function cancel($key = null)
{
$this->checkToken();
$app = JFactory::getApplication();
$context = "$this->option.edit.$this->context";
$app->setUserState($context . '.data', null);
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false));
}
}
PK �!]�Q<�D D language.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @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;
/**
* Languages list actions controller.
*
* @since 1.6
*/
class LanguagesControllerLanguage extends JControllerForm
{
/**
* Gets the URL arguments to append to an item redirect.
*
* @param int $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 1.6
*/
protected function getRedirectToItemAppend($recordId = null, $key = 'lang_id')
{
return parent::getRedirectToItemAppend($recordId, $key);
}
}
PK �!]u�
| |
languages.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @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;
/**
* Languages controller Class.
*
* @since 1.6
*/
class LanguagesControllerLanguages 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 = 'Language', $prefix = 'LanguagesModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to save the submitted ordering values for records via AJAX.
*
* @return void
*
* @since 3.1
*/
public function saveOrderAjax()
{
// Check for request forgeries.
$this->checkToken();
$pks = (array) $this->input->post->get('cid', array(), 'int');
$order = (array) $this->input->post->get('order', array(), 'int');
// Remove zero PK's and corresponding order values resulting from input filter for PK
foreach ($pks as $i => $pk)
{
if ($pk === 0)
{
unset($pks[$i]);
unset($order[$i]);
}
}
// Get the model.
$model = $this->getModel();
// Save the ordering.
$return = $model->saveorder($pks, $order);
if ($return)
{
echo '1';
}
// Close the application.
JFactory::getApplication()->close();
}
}
PK �!]���%
%
installed.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @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;
/**
* Languages Controller.
*
* @since 1.5
*/
class LanguagesControllerInstalled extends JControllerLegacy
{
/**
* Task to set the default language.
*
* @return void
*/
public function setDefault()
{
// Check for request forgeries.
$this->checkToken();
$cid = (string) $this->input->get('cid', '', 'string');
$model = $this->getModel('installed');
if ($model->publish($cid))
{
// Switching to the new administrator language for the message
if ($model->getState('client_id') == 1)
{
$language = JFactory::getLanguage();
$newLang = JLanguage::getInstance($cid);
JFactory::$language = $newLang;
JFactory::getApplication()->loadLanguage($language = $newLang);
$newLang->load('com_languages', JPATH_ADMINISTRATOR);
}
$msg = JText::_('COM_LANGUAGES_MSG_DEFAULT_LANGUAGE_SAVED');
$type = 'message';
}
else
{
$msg = $this->getError();
$type = 'error';
}
$clientId = $model->getState('client_id');
$this->setredirect('index.php?option=com_languages&view=installed&client=' . $clientId, $msg, $type);
}
/**
* Task to switch the administrator language.
*
* @return void
*/
public function switchAdminLanguage()
{
// Check for request forgeries.
$this->checkToken();
$cid = (string) $this->input->get('cid', '', 'string');
$model = $this->getModel('installed');
// Fetching the language name from the xx-XX.xml or langmetadata.xml respectively.
$file = JPATH_ADMINISTRATOR . '/language/' . $cid . '/' . $cid . '.xml';
if (!is_file($file))
{
$file = JPATH_ADMINISTRATOR . '/language/' . $cid . '/langmetadata.xml';
}
$info = JInstaller::parseXMLInstallFile($file);
if ($model->switchAdminLanguage($cid))
{
// Switching to the new language for the message
$languageName = $info['name'];
$language = JFactory::getLanguage();
$newLang = JLanguage::getInstance($cid);
JFactory::$language = $newLang;
JFactory::getApplication()->loadLanguage($language = $newLang);
$newLang->load('com_languages', JPATH_ADMINISTRATOR);
$msg = JText::sprintf('COM_LANGUAGES_MSG_SWITCH_ADMIN_LANGUAGE_SUCCESS', $languageName);
$type = 'message';
}
else
{
$msg = $this->getError();
$type = 'error';
}
$this->setredirect('index.php?option=com_languages&view=installed', $msg, $type);
}
}
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 &�!]�Ym m style.phpnu &1i� <?php
/**
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr
*/
// No direct access
defined('_JEXEC') or die;
use \Slideshowck\CKController;
use \Slideshowck\CKFof;
class SlideshowckControllerStyle extends CKController {
// public function add() {
// $this->edit(0);
// Redirect to the edit screen.
// CKFof::redirect(SLIDESHOWCK_ADMIN_URL . '&view=style&layout=edit&id=0&tmpl=component&layout=modal');
// }
// public function edit($id = null, $appendUrl = '') {
// parent::edit($id, '&layout=modal&tmpl=component');
// }
//
// public function copy() {
// parent::edit('&layout=modal&tmpl=component');
// }
/*
* Generate the CSS styles from the settings
*/
public function save() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$id = $this->input->get('id', 0, 'int');
$model = $this->getModel();
$row = $model->getItem($id);
// get data
$fields = $this->input->get('fields', '', 'raw');
$name = $this->input->get('name', '', 'string');
if (! $name) $name = 'style' . $id;
$layoutcss = trim($this->input->get('layoutcss', '', 'html'));
// set data
$row->params = $fields;
$row->name = $name;
$row->layoutcss = $layoutcss;
if (! $id = $model->save($row)) {
echo "{'result': '0', 'id': '" . $row->id . "', 'message': 'Error : Can not save the Styles !'}";
echo($this->_db->getErrorMsg());
exit;
}
echo '{"result": "1", "id": "' . $id . '", "message": "Styles saved successfully"}';
exit;
}
/**
* copy an existing page
* @return void
*/
// function copy() {
// $model = $this->getModel();
// $cid = $this->input->get('cid', '', 'array');
// $this->input->set('id', (int) $cid[0]);
// if (!$model->copy()) {
// $msg = \Joomla\CMS\Language\Text::_('CK_COPY_ERROR');
// $type = 'error';
// } else {
// $msg = \Joomla\CMS\Language\Text::_('CK_COPY_SUCCESS');
// $type = 'message';
// }
//
// $this->setRedirect('index.php?option=com_slideshowck&view=styles', $msg, $type);
// }
/*
* Generate the CSS styles from the settings
*/
public function ajaxRenderCss() {
$fields = $this->input->get('fields', '', 'raw');
$fields = json_decode($fields);
$customstyles = stripslashes( $this->input->get('customstyles', '', 'string'));
$customstyles = json_decode($customstyles);
$customcss = $this->input->get('customcss', '', 'html');
$css = $this->renderCss($fields, $customstyles);
echo $css . $customcss;
exit();
}
/*
* Render the CSS from the settings
*/
public function renderCss($fields, $customstyles) {
include_once SLIDESHOWCK_PATH . '/helpers/ckstyles.php';
$ckstyles = new \Slideshowck\CKStyles();
$css = $ckstyles->create($fields, $customstyles);
return $css;
}
/**
* Ajax method to save the json data into the .mmck file
*
* @return boolean - true on success for the file creation
*
*/
public function exportParams() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
// create a backup file with all fields stored in it
$fields = $this->input->get('jsonfields', '', 'string');
$backupfile_path = SLIDESHOWCK_PATH . '/export/exportParamsSlideshowckStyle'. $this->input->get('styleid',0,'int') .'.mmck';
if (file_put_contents($backupfile_path, $fields)) {
echo '1';
} else {
echo '0';
}
exit();
}
/**
* Ajax method to import the .mmck file into the interface
*
* @return boolean - true on success for the file creation
*
*/
public function uploadParamsFile() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$file = $this->input->files->get('file', '', 'array');
if (!is_array($file))
exit();
$filename = \Joomla\CMS\Filesystem\File::makeSafe($file['name']);
// check if the file exists
if (\Joomla\CMS\Filesystem\File::getExt($filename) != 'mmck') {
$msg = \Joomla\CMS\Language\Text::_('CK_NOT_MMCK_FILE', true);
echo json_encode(array('error'=> $msg));
exit();
}
//Set up the source and destination of the file
$src = $file['tmp_name'];
// check if the file exists
if (!$src || !\Joomla\CMS\Filesystem\File::exists($src)) {
$msg = \Joomla\CMS\Language\Text::_('CK_FILE_NOT_EXISTS', true);
echo json_encode(array('error'=> $msg));
exit();
}
// read the file
if (!$filecontent = \Joomla\CMS\Filesystem\File::read($src)) {
$msg = \Joomla\CMS\Language\Text::_('CK_UNABLE_READ_FILE', true);
echo json_encode(array('error'=> $msg));
exit();
}
// replace vars to allow data to be moved from another server
$filecontent = str_replace("|URIROOT|", \Joomla\CMS\Uri\Uri::root(true), $filecontent);
// $filecontent = str_replace("|qq|", '"', $filecontent);
// echo $filecontent;
echo json_encode(array('data'=> $filecontent));
exit();
}
/**
* Ajax method to read the fields values from the selected preset
*
* @return json -
*
*/
function loadPresetFields() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$preset = $this->input->get('preset', '', 'string');
$folder_path = SLIDESHOWCK_MEDIA_PATH . '/presets/';
// load the fields
$fields = '{}';
if ( file_exists($folder_path . $preset. '.mmck') ) {
$fields = @file_get_contents($folder_path . $preset. '.mmck');
$fields = str_replace('\n','', $fields);
// $fields = str_replace("{", "|ob|", $fields);
// $fields = str_replace("}", "|cb|", $fields);
} else {
echo '{"result" : 0, "message" : "File Not found : '.$folder_path . $preset. '.mmck'.'"}';
exit();
}
echo '{"result" : 1, "fields" : "'.$fields.'", "customcss" : ""}';
exit();
}
}PK &�!]R~�_^ _^ template.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @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;
JLoader::register('InstallerModelInstall', JPATH_ADMINISTRATOR . '/components/com_installer/models/install.php');
use Joomla\CMS\Filter\InputFilter;
/**
* Template style controller class.
*
* @since 1.6
*/
class TemplatesControllerTemplate extends JControllerLegacy
{
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JControllerLegacy
* @since 3.2
*/
public function __construct($config = array())
{
parent::__construct($config);
// Apply, Save & New, and Save As copy should be standard on forms.
$this->registerTask('apply', 'save');
}
/**
* Method for closing the template.
*
* @return void
*
* @since 3.2
*/
public function cancel()
{
$this->setRedirect(JRoute::_('index.php?option=com_templates&view=templates', false));
}
/**
* Method for closing a file.
*
* @return void
*
* @since 3.2
*/
public function close()
{
$app = JFactory::getApplication();
$file = base64_encode('home');
$id = (int) $app->input->get('id', 0, 'int');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
/**
* Method for copying the template.
*
* @return boolean true on success, false otherwise
*
* @since 3.2
*/
public function copy()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$this->input->set('installtype', 'folder');
$newName = (string) $this->input->get('new_name', null, 'cmd');
$newNameRaw = (string) $this->input->get('new_name', null, 'string');
$templateID = (int) $this->input->get('id', 0, 'int');
$file = (string) $this->input->get('file', '', 'cmd');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
$this->setRedirect('index.php?option=com_templates&view=template&id=' . $templateID . '&file=' . $file);
$model = $this->getModel('Template', 'TemplatesModel');
$model->setState('new_name', $newName);
$model->setState('tmp_prefix', uniqid('template_copy_'));
$model->setState('to_path', JFactory::getConfig()->get('tmp_path') . '/' . $model->getState('tmp_prefix'));
// Process only if we have a new name entered
if (strlen($newName) > 0)
{
if (!JFactory::getUser()->authorise('core.create', 'com_templates'))
{
// User is not authorised to delete
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_CREATE_NOT_PERMITTED'), 'error');
return false;
}
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
// Check that new name is valid
if (($newNameRaw !== null) && ($newName !== $newNameRaw))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INVALID_TEMPLATE_NAME'), 'error');
return false;
}
// Check that new name doesn't already exist
if (!$model->checkNewName())
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_DUPLICATE_TEMPLATE_NAME'), 'error');
return false;
}
// Check that from name does exist and get the folder name
$fromName = $model->getFromName();
if (!$fromName)
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INVALID_FROM_NAME'), 'error');
return false;
}
// Call model's copy method
if (!$model->copy())
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_COULD_NOT_COPY'), 'error');
return false;
}
// Call installation model
$this->input->set('install_directory', JFactory::getConfig()->get('tmp_path') . '/' . $model->getState('tmp_prefix'));
$installModel = $this->getModel('Install', 'InstallerModel');
JFactory::getLanguage()->load('com_installer');
if (!$installModel->install())
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_COULD_NOT_INSTALL'), 'error');
return false;
}
$this->setMessage(JText::sprintf('COM_TEMPLATES_COPY_SUCCESS', $newName));
$model->cleanup();
return true;
}
}
/**
* 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 (note, the empty array is atypical compared to other models).
*
* @return JModelLegacy The model.
*
* @since 3.2
*/
public function getModel($name = 'Template', $prefix = 'TemplatesModel', $config = array())
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to check if the user can modify template files
*
* @return boolean
*
* @since 3.2
*/
protected function allowEdit()
{
return JFactory::getUser()->authorise('core.admin');
}
/**
* Saves a template source file.
*
* @return void
*
* @since 3.2
*/
public function save()
{
// Check for request forgeries.
$this->checkToken();
$app = JFactory::getApplication();
$data = $this->input->post->get('jform', array(), 'array');
$task = $this->getTask();
$model = $this->getModel();
$fileName = (string) $app->input->get('file', '', 'cmd');
$explodeArray = explode(':', base64_decode($fileName));
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
// Match the stored id's with the submitted.
if (empty($data['extension_id']) || empty($data['filename']))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error');
return false;
}
elseif ($data['extension_id'] != $model->getState('extension.id'))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error');
return false;
}
elseif ($data['filename'] != end($explodeArray))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error');
return false;
}
// Validate the posted data.
$form = $model->getForm();
if (!$form)
{
$app->enqueueMessage($model->getError(), 'error');
return false;
}
$data = $model->validate($form, $data);
// Check for validation errors.
if ($data === false)
{
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
{
if ($errors[$i] instanceof Exception)
{
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
}
else
{
$app->enqueueMessage($errors[$i], 'warning');
}
}
// Redirect back to the edit screen.
$url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName;
$this->setRedirect(JRoute::_($url, false));
return false;
}
// Attempt to save the data.
if (!$model->save($data))
{
// Redirect back to the edit screen.
$this->setMessage(JText::sprintf('JERROR_SAVE_FAILED', $model->getError()), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName;
$this->setRedirect(JRoute::_($url, false));
return false;
}
$this->setMessage(JText::_('COM_TEMPLATES_FILE_SAVE_SUCCESS'));
// Redirect the user based on the chosen task.
switch ($task)
{
case 'apply':
// Redirect back to the edit screen.
$url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName;
$this->setRedirect(JRoute::_($url, false));
break;
default:
// Redirect to the list screen.
$file = base64_encode('home');
$id = (int) $app->input->get('id', 0, 'int');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
break;
}
}
/**
* Method for creating override.
*
* @return void
*
* @since 3.2
*/
public function overrides()
{
// Check for request forgeries.
$this->checkToken('get');
$app = JFactory::getApplication();
$model = $this->getModel();
$file = (string) $app->input->get('file', '', 'cmd');
$override = (string) InputFilter::getInstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('folder', '', 'base64')), 'path');
$id = (int) $app->input->get('id', 0, 'int');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($model->createOverride($override))
{
$this->setMessage(JText::_('COM_TEMPLATES_OVERRIDE_SUCCESS'));
}
// Redirect back to the edit screen.
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
/**
* Method for compiling LESS.
*
* @return void
*
* @since 3.2
*/
public function less()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($model->compileLess($file))
{
$this->setMessage(JText::_('COM_TEMPLATES_COMPILE_SUCCESS'));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_COMPILE_ERROR'), 'error');
}
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
/**
* Method for deleting a file.
*
* @return void
*
* @since 3.2
*/
public function delete()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (base64_decode(urldecode($file)) == '/index.php')
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INDEX_DELETE'), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->deleteFile($file))
{
$this->setMessage(JText::_('COM_TEMPLATES_FILE_DELETE_SUCCESS'));
$file = base64_encode('home');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_DELETE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for creating a new file.
*
* @return void
*
* @since 3.2
*/
public function createFile()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$name = (string) $app->input->get('name', '', 'cmd');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
$type = (string) $app->input->get('type', '', 'cmd');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($type == 'null')
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_TYPE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $name))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->createFile($name, $type, $location))
{
$this->setMessage(JText::_('COM_TEMPLATES_FILE_CREATE_SUCCESS'));
$file = urlencode(base64_encode($location . '/' . $name . '.' . $type));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_CREATE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for uploading a file.
*
* @return void
*
* @since 3.2
*/
public function uploadFile()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$upload = $app->input->files->get('files');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($return = $model->uploadFile($upload, $location))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_UPLOAD_SUCCESS') . $upload['name']);
$redirect = base64_encode($return);
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $redirect;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_UPLOAD'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for creating a new folder.
*
* @return void
*
* @since 3.2
*/
public function createFolder()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$name = $app->input->get('name');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $name))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FOLDER_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->createFolder($name, $location))
{
$this->setMessage(JText::_('COM_TEMPLATES_FOLDER_CREATE_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FOLDER_CREATE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for deleting a folder.
*
* @return void
*
* @since 3.2
*/
public function deleteFolder()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (empty($location))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_ROOT_DELETE'), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->deleteFolder($location))
{
$this->setMessage(JText::_('COM_TEMPLATES_FOLDER_DELETE_SUCCESS'));
if (stristr(base64_decode($file), $location) != false)
{
$file = base64_encode('home');
}
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FOLDER_DELETE_ERROR'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for renaming a file.
*
* @return void
*
* @since 3.2
*/
public function renameFile()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$newName = $app->input->get('new_name');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (base64_decode(urldecode($file)) == '/index.php')
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_RENAME_INDEX'), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $newName))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($rename = $model->renameFile($file, $newName))
{
$this->setMessage(JText::_('COM_TEMPLATES_FILE_RENAME_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $rename;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_RENAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for cropping an image.
*
* @return void
*
* @since 3.2
*/
public function cropImage()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$x = $app->input->get('x');
$y = $app->input->get('y');
$w = $app->input->get('w');
$h = $app->input->get('h');
$model = $this->getModel();
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (empty($w) && empty($h) && empty($x) && empty($y))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_CROP_AREA_ERROR'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->cropImage($file, $w, $h, $x, $y))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_CROP_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_CROP_ERROR'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for resizing an image.
*
* @return void
*
* @since 3.2
*/
public function resizeImage()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$width = $app->input->get('width');
$height = $app->input->get('height');
$model = $this->getModel();
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($model->resizeImage($file, $width, $height))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_RESIZE_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_RESIZE_ERROR'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for copying a file.
*
* @return void
*
* @since 3.2
*/
public function copyFile()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$newName = $app->input->get('new_name');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
$model = $this->getModel();
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (!preg_match('/^[a-zA-Z0-9-_]+$/', $newName))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->copyFile($newName, $location, $file))
{
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_COPY_FAIL'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for extracting an archive file.
*
* @return void
*
* @since 3.2
*/
public function extractArchive()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$model = $this->getModel();
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($model->extractArchive($file))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_ARCHIVE_EXTRACT_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_ARCHIVE_EXTRACT_FAIL'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
}
PK &�!]�Yr�� �
styles.phpnu &1i� <?php
/**
* @name Slider CK
* @package com_slideshowck
* @copyright Copyright (C) 2016. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr
*/
// No direct access.
defined('_JEXEC') or die;
jimport('joomla.application.component.controlleradmin');
/**
* Pages list controller class.
*/
class SlideshowckControllerStyles extends \Joomla\CMS\MVC\Controller\AdminController {
/**
* Proxy for getModel.
* @since 1.6
*/
public function getModel($name = 'style', $prefix = 'SlideshowckModel', $config = array()) {
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}PK \�!]�T�# # request.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage com_privacy
*
* @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;
/**
* Request action controller class.
*
* @since 3.9.0
*/
class PrivacyControllerRequest extends JControllerLegacy
{
/**
* Method to confirm the information request.
*
* @return boolean
*
* @since 3.9.0
*/
public function confirm()
{
// Check the request token.
$this->checkToken('post');
/** @var PrivacyModelConfirm $model */
$model = $this->getModel('Confirm', 'PrivacyModel');
$data = $this->input->post->get('jform', array(), 'array');
$return = $model->confirmRequest($data);
// Check for a hard error.
if ($return instanceof Exception)
{
// Get the error message to display.
if (JFactory::getApplication()->get('error_reporting'))
{
$message = $return->getMessage();
}
else
{
$message = JText::_('COM_PRIVACY_ERROR_CONFIRMING_REQUEST');
}
// Go back to the confirm form.
$this->setRedirect(JRoute::_('index.php?option=com_privacy&view=confirm', false), $message, 'error');
return false;
}
elseif ($return === false)
{
// Confirm failed.
// Go back to the confirm form.
$message = JText::sprintf('COM_PRIVACY_ERROR_CONFIRMING_REQUEST_FAILED', $model->getError());
$this->setRedirect(JRoute::_('index.php?option=com_privacy&view=confirm', false), $message, 'notice');
return false;
}
else
{
// Confirm succeeded.
$this->setRedirect(JRoute::_(JUri::root()), JText::_('COM_PRIVACY_CONFIRM_REQUEST_SUCCEEDED'), 'info');
return true;
}
}
/**
* Method to submit an information request.
*
* @return boolean
*
* @since 3.9.0
*/
public function submit()
{
// Check the request token.
$this->checkToken('post');
/** @var PrivacyModelRequest $model */
$model = $this->getModel('Request', 'PrivacyModel');
$data = $this->input->post->get('jform', array(), 'array');
$return = $model->createRequest($data);
// Check for a hard error.
if ($return instanceof Exception)
{
// Get the error message to display.
if (JFactory::getApplication()->get('error_reporting'))
{
$message = $return->getMessage();
}
else
{
$message = JText::_('COM_PRIVACY_ERROR_CREATING_REQUEST');
}
// Go back to the confirm form.
$this->setRedirect(JRoute::_('index.php?option=com_privacy&view=request', false), $message, 'error');
return false;
}
elseif ($return === false)
{
// Confirm failed.
// Go back to the confirm form.
$message = JText::sprintf('COM_PRIVACY_ERROR_CREATING_REQUEST_FAILED', $model->getError());
$this->setRedirect(JRoute::_('index.php?option=com_privacy&view=request', false), $message, 'notice');
return false;
}
else
{
// Confirm succeeded.
$this->setRedirect(JRoute::_(JUri::root()), JText::_('COM_PRIVACY_CREATE_REQUEST_SUCCEEDED'), 'info');
return true;
}
}
/**
* Method to extend the privacy consent.
*
* @return boolean
*
* @since 3.9.0
*/
public function remind()
{
// Check the request token.
$this->checkToken('post');
/** @var PrivacyModelConfirm $model */
$model = $this->getModel('Remind', 'PrivacyModel');
$data = $this->input->post->get('jform', array(), 'array');
$return = $model->remindRequest($data);
// Check for a hard error.
if ($return instanceof Exception)
{
// Get the error message to display.
if (JFactory::getApplication()->get('error_reporting'))
{
$message = $return->getMessage();
}
else
{
$message = JText::_('COM_PRIVACY_ERROR_REMIND_REQUEST');
}
// Go back to the confirm form.
$this->setRedirect(JRoute::_('index.php?option=com_privacy&view=remind', false), $message, 'error');
return false;
}
elseif ($return === false)
{
// Confirm failed.
// Go back to the confirm form.
$message = JText::sprintf('COM_PRIVACY_ERROR_CONFIRMING_REMIND_FAILED', $model->getError());
$this->setRedirect(JRoute::_('index.php?option=com_privacy&view=remind', false), $message, 'notice');
return false;
}
else
{
// Confirm succeeded.
$this->setRedirect(JRoute::_(JUri::root()), JText::_('COM_PRIVACY_CONFIRM_REMIND_SUCCEEDED'), 'info');
return true;
}
}
}
PK l�!]�n4� � archive.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class ArchiveController extends acymailingController{
function view(){
$statsClass = acymailing_get('class.stats');
$statsClass->countReturn = false;
$statsClass->saveStats();
$printEnabled = acymailing_getVar('none', 'print', 0);
if($printEnabled){
$js = "setTimeout(function(){
if(document.getElementById('iframepreview')){
document.getElementById('iframepreview').contentWindow.focus();
document.getElementById('iframepreview').contentWindow.print();
}else{
window.print();
}
},2000);";
acymailing_addScript(true, $js);
}
acymailing_setVar('layout', 'view');
return parent::display();
}
}
PK l�!]�2Z@A @A sub.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class SubController extends acymailingController{
function notask(){
$ajax = acymailing_getVar('int', 'ajax', 0);
if($ajax) header("Content-type:text/html; charset=utf-8");
if($ajax){
echo '{"message":"Please enable the Javascript to be able to subscribe","type":"error","code":"0"}';
exit;
}else{
$redirectUrl = urldecode(acymailing_getVar('string', 'redirect', '', ''));
$this->_checkRedirectUrl($redirectUrl);
acymailing_redirect($redirectUrl,'Please enable the Javascript to be able to subscribe','notice');
}
return false;
}
function display($dummy1 = false, $dummy2 = false){
$moduleId = acymailing_getVar('int', 'formid');
if(empty($moduleId)) return;
if(acymailing_getVar('int', 'interval') > 0) setcookie('acymailingSubscriptionState', true, time() + acymailing_getVar('int', 'interval'), '/');
$module = acymailing_loadObject('SELECT * FROM #__modules WHERE id = '.intval($moduleId).' AND `module` LIKE \'%acymailing%\' AND published = 1 LIMIT 1');
if(empty($module)){ echo 'No module found'; exit; }
$module->user = substr( $module->module, 0, 4 ) == 'mod_' ? 0 : 1;
$module->name = $module->user ? $module->title : substr( $module->module, 4 );
$module->style = null;
$module->module = preg_replace('/[^A-Z0-9_\.-]/i', '', $module->module);
$params = array();
if(acymailing_getVar('int', 'autofocus', 0)){
$js = "
window.addEventListener('load', function(){
this.focus();
var moduleInputs = document.getElementsByTagName('input');
if(moduleInputs){
var i = 0;
while(moduleInputs[i].disabled == true){
i++;
}
if(moduleInputs[i]) moduleInputs[i].focus();
}
});";
acymailing_addScript(true, $js);
}
echo JModuleHelper::renderModule($module, $params);
}
function optin(){
acymailing_checkRobots();
$config = acymailing_config();
if(!acymailing_getVar('cmd', 'acy_source') && !empty($_GET['user'])){
acymailing_setVar('acy_source','url');
}
$ajax = acymailing_getVar('int', 'ajax', 0);
if($ajax){
@ob_end_clean();
header("Content-type:text/html; charset=utf-8");
}
$currentUserid = acymailing_currentUserId();
if((int) $config->get('allow_visitor',1) != 1 && empty($currentUserid)){
if($ajax){
echo '{"message":"'.str_replace('"','\"',acymailing_translation('ONLY_LOGGED')).'","type":"error","code":"0"}';
exit;
}else{
acymailing_askLog(false, 'ONLY_LOGGED');
return;
}
}
$userClass = acymailing_get('class.subscriber');
$userClass->geolocRight = true;
$redirectUrl = urldecode(acymailing_getVar('string', 'redirect', '', ''));
$user = new stdClass();
$formData = acymailing_getVar('array', 'user', array(), '');
if(!empty($formData)){
$userClass->checkFields($formData,$user);
}
$allowUserModifications = (bool) ($config->get('allow_modif','data') == 'all');
$allowSubscriptionModifications = (bool) ($config->get('allow_modif','data') != 'none');
if(empty($user->email)){
$connectedUser = $userClass->identify(true);
if(!empty($connectedUser->email)){
$user->email = $connectedUser->email;
$allowUserModifications = true;
$allowSubscriptionModifications = true;
}
}
$user->email = trim($user->email);
$userHelper = acymailing_get('helper.user');
if(empty($user->email) || !$userHelper->validEmail($user->email,true)){
if ($ajax) echo '{"message":"'.str_replace('"','\"',acymailing_translation('VALID_EMAIL')).'","type":"error","code":"0"}';
else echo "<script>alert('".acymailing_translation('VALID_EMAIL',true)."'); window.history.go(-1);</script>";
exit;
}
if(!empty($user->email)) $user->email = acymailing_punycode($user->email);
$alreadyExists = $userClass->get($user->email);
if(!empty($alreadyExists->subid)){
if(!empty($alreadyExists->userid)) unset($user->name);
$user->subid = $alreadyExists->subid;
$currentSubscription = $userClass->getSubscriptionStatus($alreadyExists->subid);
}else{
$allowSubscriptionModifications = true;
$allowUserModifications = true;
$currentSubscription = array();
}
$user->accept = 1;
if($allowUserModifications){
$userClass->recordHistory = true;
$user->subid = $userClass->save($user);
}
$myuser = $userClass->get($user->subid);
if(empty($myuser->subid)){
if ($ajax) echo '{"message":"Could not save the user","type":"error","code":"1"}';
else echo "<script>alert('Could not save the user'); window.history.go(-1);</script>";
exit;
}
if(empty($myuser->accept)){
$myuser->accept = 1;
$userClass->save($myuser);
}
if(!$allowUserModifications && !empty($myuser->subid) && empty($myuser->confirmed)){
$userClass->sendConf($myuser->subid);
}
$statusAdd = (empty($myuser->confirmed) AND $config->get('require_confirmation',false)) ? 2 : 1;
$addlists = array();
$updatelists = array();
$hiddenlistsstring = acymailing_getVar('string', 'hiddenlists', '', '');
if(!empty($hiddenlistsstring)){
$hiddenlists = explode(',',$hiddenlistsstring);
acymailing_arrayToInteger($hiddenlists);
foreach($hiddenlists as $id => $idOneList){
if(!isset($currentSubscription[$idOneList])){
$addlists[$statusAdd][] = $idOneList;
continue;
}
if($currentSubscription[$idOneList]->status == $statusAdd || $currentSubscription[$idOneList]->status == 1) continue;
$updatelists[$statusAdd][] = $idOneList;
}
}
$visibleSubscription = acymailing_getVar('array', 'subscription', '', '');
if(!empty($visibleSubscription)){
foreach($visibleSubscription as $idOneList){
if(empty($idOneList)) continue;
if(!isset($currentSubscription[$idOneList])){
$addlists[$statusAdd][] = $idOneList;
continue;
}
if($currentSubscription[$idOneList]->status == $statusAdd || $currentSubscription[$idOneList]->status == 1) continue;
$updatelists[$statusAdd][] = $idOneList;
}
}
$visiblelistsstring = acymailing_getVar('string', 'visiblelists', '', '');
if(!empty($visiblelistsstring)){
$visiblelist = explode(',',$visiblelistsstring);
acymailing_arrayToInteger($visiblelist);
foreach($visiblelist as $idList){
if(!in_array($idList,$visibleSubscription) AND !empty($currentSubscription[$idList]) AND $currentSubscription[$idList]->status != '-1'){
$updatelists['-1'][] = $idList;
}
}
}
$listsubClass = acymailing_get('class.listsub');
$status = true;
$updateMessage = false;
$insertMessage = false;
if($allowSubscriptionModifications){
if(!empty($updatelists)){
$status = $listsubClass->updateSubscription($myuser->subid,$updatelists) && $status;
$updateMessage = true;
}
if(!empty($addlists)){
$status = $listsubClass->addSubscription($myuser->subid,$addlists) && $status;
$insertMessage = true;
}
}else{
$mailClass = acymailing_get('helper.mailer');
$mailClass->checkConfirmField = false;
$mailClass->checkEnabled = false;
$mailClass->report = false;
$modifySubscriptionSuccess = $mailClass->sendOne('modif',$myuser->subid);
$modifySubscriptionError = $mailClass->reportMessage;
}
$userClass->sendNotification();
if($config->get('subscription_message',1) || $ajax){
if($allowSubscriptionModifications){
if($statusAdd == 2){
if($userClass->confirmationSentSuccess){
$msg = 'CONFIRMATION_SENT';
$code = 2;
$msgtype = 'success';
}else{
$msg = $userClass->confirmationSentError;
$code = 7;
$msgtype = 'error';
}
}else{
if($insertMessage){
$msg = 'SUBSCRIPTION_OK';
$code = 3;
$msgtype = 'success';
}elseif($updateMessage){
$msg = 'SUBSCRIPTION_UPDATED_OK';
$code = 4;
$msgtype = 'success';
}else{
$msg = 'ALREADY_SUBSCRIBED';
$code = 5;
$msgtype = 'success';
}
}
}else{
if($modifySubscriptionSuccess){
$msg = 'IDENTIFICATION_SENT';
$code = 6;
$msgtype = 'warning';
}else{
$msg = $modifySubscriptionError;
$code = 8;
$msgtype = 'error';
}
}
if($msg == strtoupper($msg)){
$source = acymailing_getVar('cmd', 'acy_source');
if(strpos($source, 'module_') !== false){
$moduleId = '_'.strtoupper($source);
if(acymailing_translation($msg.$moduleId) != $msg.$moduleId) $msg = $msg.$moduleId;
}
$msg = acymailing_translation($msg);
}
$replace = array();
$replace['{list:name}'] = '';
foreach($myuser as $oneProp => $oneVal){
$replace['{user:'.$oneProp.'}'] = $oneVal;
}
$msg = str_replace(array_keys($replace),$replace,$msg);
if($config->get('redirect_tags', 0) == 1) $redirectUrl = str_replace(array_keys($replace),$replace,$redirectUrl);
if($ajax){
$msg = str_replace(array("\n","\r",'"','\\'),array(' ',' ',"'",'\\\\'),$msg);
echo '{"message":"'.$msg.'","type":"'.($msgtype == 'warning' ? 'success' : $msgtype).'","code":"'.$code.'"}';
}elseif(empty($redirectUrl)){
acymailing_enqueueMessage($msg,$msgtype == 'success' ? 'info' : $msgtype);
}else{
if(strlen($msg)>0){
if($msgtype == 'success') acymailing_enqueueMessage($msg);
elseif($msgtype == 'warning') acymailing_enqueueMessage($msg,'notice');
else acymailing_enqueueMessage($msg,'error');
}
}
}
$notifContact = $config->get('notification_contact');
if(!empty($notifContact)){
$mailer = acymailing_get('helper.mailer');
$mailer->autoAddUser = true;
$mailer->checkConfirmField = false;
$mailer->report = false;
foreach($user as $field => $value) $mailer->addParam('user:'.$field,$value);
$mailer->addParam('user:subscription',$listsubClass->getSubscriptionString($user->subid));
$mailer->addParam('user:subscriptiondates',$listsubClass->getSubscriptionString($user->subid, true));
$mailer->addParam('user:ip',$userHelper->getIP());
if(!empty($userClass->geolocData)){
foreach($userClass->geolocData as $map=>$value){
$mailer->addParam('geoloc:notif_'.$map,$value);
}
}
$mailer->addParamInfo();
$allUsers = explode(' ',trim(str_replace(array(';',','),' ',$notifContact)));
foreach($allUsers as $oneUser){
if(empty($oneUser)) continue;
$mailer->sendOne('notification_contact',$oneUser);
}
}
if ($ajax) exit;
$this->_closepop($redirectUrl);
if(!empty($redirectUrl)) acymailing_redirect($redirectUrl);
if('joomla' == 'wordpress') acymailing_redirect(acymailing_rootURI());
return true;
}
private function _closepop($redirectUrl){
$this->_checkRedirectUrl($redirectUrl);
if(empty($redirectUrl)) return;
if(!acymailing_getVar('int', 'closepop')) acymailing_redirect($redirectUrl);
echo '<script type="text/javascript" language="javascript">
window.parent.document.location.href=\''.str_replace('&','&',$redirectUrl).'\';
</script>';
$app = JFactory::getApplication();
$messages = $app->getMessageQueue();
if(!empty($messages)){
$session = JFactory::getSession();
$session->set('application.queue', $messages);
}
exit;
}
function optout(){
acymailing_checkRobots();
$config = acymailing_config();
$userClass = acymailing_get('class.subscriber');
$userClass->geolocRight = true;
$ajax = acymailing_getVar('int', 'ajax', 0);
if($ajax){
@ob_end_clean();
header("Content-type:text/html; charset=utf-8");
}
$redirectUrl = urldecode(acymailing_getVar('string', 'redirectunsub'));
$formData = acymailing_getVar('array', 'user', array(), '');
$email = trim(strip_tags(@$formData['email']));
$currentEmail = acymailing_currentUserEmail();
if(empty($email) && !empty($currentEmail)){
$email = $currentEmail;
}
$userHelper = acymailing_get('helper.user');
if(empty($email) || !$userHelper->validEmail($email)){
if ($ajax) echo '{"message":"'.str_replace('"','\"',acymailing_translation('VALID_EMAIL')).'","type":"error","code":"7"}';
else echo "<script>alert('".acymailing_translation('VALID_EMAIL',true)."'); window.history.go(-1);</script>";
exit;
}
$alreadyExists = $userClass->get($email);
if(empty($alreadyExists->subid)){
if ($ajax){
echo '{"message":"'.str_replace('"','\"',acymailing_translation_sprintf('NOT_IN_LIST','<b><i>'.$email.'</i></b>')).'","type":"error","code":"8"}';
exit;
}
if(empty($redirectUrl)) acymailing_enqueueMessage(acymailing_translation_sprintf('NOT_IN_LIST','<b><i>'.$email.'</i></b>'),'warning');
else acymailing_enqueueMessage(acymailing_translation_sprintf('NOT_IN_LIST','<b><i>'.$email.'</i></b>'),'notice');
return $this->_closepop($redirectUrl);
}
$currentEmail = acymailing_currentUserEmail();
if($config->get('allow_modif','data') == 'none' AND (empty($currentEmail) || $currentEmail != $email)){
$mailClass = acymailing_get('helper.mailer');
$mailClass->checkConfirmField = false;
$mailClass->checkEnabled = false;
$mailClass->report = false;
$mailClass->sendOne('modif',$alreadyExists->subid);
if ($ajax){
echo '{"message":"'.str_replace('"','\"',acymailing_translation('IDENTIFICATION_SENT')).'","type":"success","code":"9"}';
exit;
}
if(empty($redirectUrl)) acymailing_enqueueMessage(acymailing_translation( 'IDENTIFICATION_SENT' ),'warning');
else acymailing_enqueueMessage(acymailing_translation( 'IDENTIFICATION_SENT' ), 'notice');
return $this->_closepop($redirectUrl);
}
$visibleSubscription = acymailing_getVar('array', 'subscription', '', '');
$currentSubscription = $userClass->getSubscriptionStatus($alreadyExists->subid);
$hiddenSubscription = explode(',',acymailing_getVar('string', 'hiddenlists', '', ''));
$updatelists = array();
$removeSubscription = array_merge($visibleSubscription,$hiddenSubscription);
foreach($removeSubscription as $idList){
if(!empty($currentSubscription[$idList]) AND $currentSubscription[$idList]->status != '-1'){
$updatelists[-1][] = $idList;
}
}
if(!empty($updatelists)){
$listsubClass = acymailing_get('class.listsub');
$listsubClass->updateSubscription($alreadyExists->subid,$updatelists);
if($config->get('unsubscription_message',1)){
if ($ajax){
echo '{"message":"'.str_replace('"','\"',acymailing_translation('UNSUBSCRIPTION_OK')).'","type":"success","code":"10"}';
exit;
}
if(empty($redirectUrl)) acymailing_enqueueMessage(acymailing_translation('UNSUBSCRIPTION_OK'),'info');
else{
if(strlen(acymailing_translation('UNSUBSCRIPTION_OK'))>0){
acymailing_enqueueMessage(acymailing_translation('UNSUBSCRIPTION_OK'));
}
}
}
}elseif($config->get('unsubscription_message',1) || $ajax){
if ($ajax){
echo '{"message":"'.str_replace('"','\"',acymailing_translation('UNSUBSCRIPTION_NOT_IN_LIST')).'","type":"success","code":"11"}';
exit;
}
if(empty($redirectUrl)) acymailing_enqueueMessage(acymailing_translation('UNSUBSCRIPTION_NOT_IN_LIST'),'info');
else acymailing_enqueueMessage(acymailing_translation('UNSUBSCRIPTION_NOT_IN_LIST'));
}
if ($ajax) exit;
return $this->_closepop($redirectUrl);
}
function _checkRedirectUrl($redirectUrl){
$config = acymailing_config();
$regex = trim(preg_replace('#[^a-z0-9\|\.]#i','',$config->get('module_redirect')),'|');
if(empty($regex) || $regex == 'all' || empty($redirectUrl) || 'joomla' != 'joomla') return;
preg_match('#^(https?://)?(www.)?([^/]*)#i',$redirectUrl,$resultsurl);
$domainredirect = preg_replace('#[^a-z0-9\.]#i','',@$resultsurl[3]);
if(preg_match('#^'.$regex.'$#i',$domainredirect)) return;
$regex .= '|'.$domainredirect;
echo "<script>alert('This redirect url is not allowed, you should change the \"".acymailing_translation('REDIRECTION_MODULE',true)."\" parameter from the AcyMailing configuration page to \"".$regex."\" to allow it or set it to \"all\" to allow all urls'); window.history.go(-1);</script>";
exit;
}
function listing(){
$errorMsg = "You shouldn't see this page. If you come from an external subscription form, maybe the URL in the form action is not valid.";
if(!empty($_SERVER['HTTP_HOST'])) $errorMsg .= "<br />Host: ".htmlspecialchars($_SERVER['HTTP_HOST'],ENT_COMPAT, 'UTF-8');
if(!empty($_SERVER['REQUEST_URI'])) $errorMsg .= "<br />URI: ".htmlspecialchars($_SERVER['REQUEST_URI'],ENT_COMPAT, 'UTF-8');
if(!empty($_SERVER['HTTP_REFERER'])) $errorMsg .= "<br />Referer: ".htmlspecialchars($_SERVER['HTTP_REFERER'],ENT_COMPAT, 'UTF-8');
acymailing_display($errorMsg, 'error');
}
}
PK l�!]��O�a a statistics.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
acymailing_cmsLoaded();
class StatisticsController extends acymailingController{
function listing(){
acymailing_setVar('tmpl','component');
$statsClass = acymailing_get('class.stats');
$statsClass->saveStats();
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );
header("Expires: Wed, 17 Sep 1975 21:32:10 GMT");
ob_end_clean();
acymailing_importPlugin('acymailing');
$results = acymailing_trigger('acymailing_getstatpicture');
$picture = reset($results);
if(empty($picture)) $picture = 'media/com_acymailing/images/statpicture.png';
$picture = ltrim(str_replace(array('\\','/'),DS,$picture),DS);
$imagename = ACYMAILING_ROOT.$picture;
$handle = fopen($imagename, 'r');
if(!$handle) exit;
header("Content-type: image/png");
$contents = fread($handle, filesize($imagename));
fclose($handle);
echo $contents;
exit;
}
}
PK l�!]�뾎q q frontemail.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$userid = acymailing_currentUserId();
if(empty($userid)) die(acymailing_translation('ASK_LOG'));
$config = acymailing_config();
if(!acymailing_isAllowed($config->get('acl_lists_manage', 'all'))) die('You are not allowed to access this page');
include(ACYMAILING_BACK.'controllers'.DS.'email.php');
class FrontemailController extends EmailController{
}
PK l�!]����4 4
frontlist.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$currentUserid = acymailing_currentUserId();
if(empty($currentUserid)){
acymailing_askLog();
return false;
}
$config = acymailing_config();
if(!acymailing_isAllowed($config->get('acl_lists_manage', 'all'))) die(acymailing_translation('ACY_NOTALLOWED'));
include(ACYMAILING_BACK.'controllers'.DS.'list.php');
class FrontlistController extends ListController{
function __construct($config = array()){
parent::__construct($config);
$listClass = acymailing_get('class.list');
$lists = $listClass->getFrontendLists('listid');
$listid = acymailing_getVar('int', 'listid', 0);
if(empty($lists) || (!empty($listid) && !in_array($listid, array_keys($lists)))) {
acymailing_redirect('index.php', acymailing_translation('ACY_NOTALLOWED'), 'error');
return false;
}
}
function remove(){
$cids = acymailing_getVar('array', 'cid', array(), '');
acymailing_arrayToInteger($cids);
if(empty($cids)) acymailing_redirect('index.php?option=com_acymailing&ctrl=frontlist');
$lists = acymailing_loadObjectList('SELECT * FROM `#__acymailing_list` WHERE listid IN ('.implode(',', $cids).')');
foreach($lists as $list){
if(acymailing_currentUserId() != $list->userid){
acymailing_enqueueMessage(acymailing_translation_sprintf('ACY_NO_ACCESS_LIST', $list->listid), 'error');
array_splice($cids, array_search($list->listid, $cids), 1);
}
}
acymailing_setVar('cid', $cids);
return parent::remove();
}
function form(){
return $this->edit();
}
function edit(){
acymailing_setVar('layout', 'form');
return parent::display();
}
}
PK l�!]��d� � stats.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.6.1
* @author acyba.com
* @copyright (C) 2009-2017 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class StatsController extends acymailingController{
function listing(){
JRequest::setVar('tmpl','component');
$statsClass = acymailing_get('class.stats');
$statsClass->saveStats();
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );
header("Expires: Wed, 17 Sep 1975 21:32:10 GMT");
ob_end_clean();
JPluginHelper::importPlugin('acymailing');
$this->dispatcher = JDispatcher::getInstance();
$results = $this->dispatcher->trigger('acymailing_getstatpicture');
$picture = reset($results);
if(empty($picture)) $picture = 'media/com_acymailing/images/statpicture.png';
$picture = ltrim(str_replace(array('\\','/'),DS,$picture),DS);
$imagename = ACYMAILING_ROOT.$picture;
$handle = fopen($imagename, 'r');
if(!$handle) exit;
header("Content-type: image/png");
$contents = fread($handle, filesize($imagename));
fclose($handle);
echo $contents;
exit;
}
function detecttimeout(){
$config = acymailing_config();
if($config->get('security_key') != JRequest::getString('seckey')) die('wrong key');
$db = JFactory::getDBO();
$db->setQuery("REPLACE INTO `#__acymailing_config` (`namekey`,`value`) VALUES ('max_execution_time','5'), ('last_maxexec_check','".time()."')");
$db->query();
@ini_set('max_execution_time',600);
@ignore_user_abort(true);
$i = 0;
while($i < 480){
sleep(8);
$i += 10;
$db->setQuery("UPDATE `#__acymailing_config` SET `value` = '".intval($i)."' WHERE `namekey` = 'max_execution_time'");
$db->query();
$db->setQuery("UPDATE `#__acymailing_config` SET `value` = '".time()."' WHERE `namekey` = 'last_maxexec_check'");
$db->query();
sleep(2);
}
exit;
}
}
PK l�!]R�ҹ� � frontbounces.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$currentUserid = acymailing_currentUserId();
if(empty($currentUserid)){
acymailing_askLog();
return false;
}
$config = acymailing_config();
if(!acymailing_isAllowed($config->get('acl_statistics_manage', 'all'))) die(acymailing_translation('ACY_NOTALLOWED'));
include(ACYMAILING_BACK.'controllers'.DS.'bounces.php');
class FrontbouncesController extends BouncesController{
function __construct($config = array()){
parent::__construct($config);
$task = acymailing_getVar('cmd', 'task');
if($task != 'chart') die(acymailing_translation('ACY_NOTALLOWED'));
}
function chart(){
acymailing_setVar('layout', 'chart');
return parent::display();
}
}
PK l�!]��� � url.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class UrlController extends acymailingController{
function __construct($config = array())
{
parent::__construct($config);
acymailing_setVar('tmpl','component');
$this->registerDefaultTask('click');
}
function sef(){
$urls = acymailing_getVar('array', 'urls', array(), '');
$result = array();
$uri = acymailing_rootURI();
foreach($urls as $url){
$url = base64_decode($url);
$link = acymailing_route($url, false);
if(!empty($uri) && strpos($link, $uri) === 0) $link = substr($link, strlen($uri));
$link = ltrim($link, '/');
$mainurl = acymailing_mainURL($link);
$result[$url] = $mainurl.$link;
}
echo json_encode($result);
exit;
}
}
PK l�!]���G G lists.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class ListsController extends acymailingController{
}
PK l�!]:�-� � frontchooselist.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
include(ACYMAILING_BACK.'controllers'.DS.'chooselist.php');
class FrontchooselistController extends ChooselistController{
}
PK l�!]�hu�� �
frontfile.phpnu &1i� <?php
/**
* @package AcyMailing for Joomla!
* @version 5.9.6
* @author acyba.com
* @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$currentUserid = acymailing_currentUserId();
if(empty($currentUserid)){
acymailing_askLog();
return false;
}
include(ACYMAILING_BACK.'controllers'.DS.'file.php');
class FrontfileController extends FileController
{
function __construct($config = array()){
parent::__construct($config);
$task = acymailing_getVar('string', 'task');
if($task != 'select') die('Access not allowed');
}
function select(){
acymailing_setVar('layout', 'select');
return parent::display();
}
}
PK %�!]�(Q Q modules.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
/**
* Modules list controller class.
*
* @since 1.6
*/
class ModulesControllerModules extends JControllerAdmin
{
/**
* Method to clone an existing module.
*
* @return void
*
* @since 1.6
*/
public function duplicate()
{
// Check for request forgeries
$this->checkToken();
$pks = (array) $this->input->post->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$pks = array_filter($pks);
try
{
if (empty($pks))
{
throw new Exception(JText::_('COM_MODULES_ERROR_NO_MODULES_SELECTED'));
}
$model = $this->getModel();
$model->duplicate($pks);
$this->setMessage(JText::plural('COM_MODULES_N_MODULES_DUPLICATED', count($pks)));
}
catch (Exception $e)
{
JError::raiseWarning(500, $e->getMessage());
}
$this->setRedirect('index.php?option=com_modules&view=modules');
}
/**
* 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 = 'Module', $prefix = 'ModulesModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK %�!]c(#U� �
module.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
*
* @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;
/**
* Module controller class.
*
* @since 1.6
*/
class ModulesControllerModule extends JControllerForm
{
/**
* Override parent add method.
*
* @return mixed True if the record can be added, a JError object if not.
*
* @since 1.6
*/
public function add()
{
$app = JFactory::getApplication();
// Get the result of the parent method. If an error, just return it.
$result = parent::add();
if ($result instanceof Exception)
{
return $result;
}
// Look for the Extension ID.
$extensionId = $app->input->get('eid', 0, 'int');
if (empty($extensionId))
{
$redirectUrl = 'index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit';
$this->setRedirect(JRoute::_($redirectUrl, false));
return JError::raiseWarning(500, JText::_('COM_MODULES_ERROR_INVALID_EXTENSION'));
}
$app->setUserState('com_modules.add.module.extension_id', $extensionId);
$app->setUserState('com_modules.add.module.params', null);
// Parameters could be coming in for a new item, so let's set them.
$params = $app->input->get('params', array(), 'array');
$app->setUserState('com_modules.add.module.params', $params);
}
/**
* Override parent cancel method to reset the add module state.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 1.6
*/
public function cancel($key = null)
{
$app = JFactory::getApplication();
$result = parent::cancel();
$app->setUserState('com_modules.add.module.extension_id', null);
$app->setUserState('com_modules.add.module.params', null);
return $result;
}
/**
* Override parent allowSave method.
*
* @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')
{
// Use custom position if selected
if (isset($data['custom_position']))
{
if (empty($data['position']))
{
$data['position'] = $data['custom_position'];
}
unset($data['custom_position']);
}
return parent::allowSave($data, $key);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 3.2
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Initialise variables.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
// Zero record (id:0), return component edit permission by calling parent controller method
if (!$recordId)
{
return parent::allowEdit($data, $key);
}
// Check edit on the record asset (explicit or inherited)
if ($user->authorise('core.edit', 'com_modules.module.' . $recordId))
{
return true;
}
return false;
}
/**
* Method to run batch operations.
*
* @param string $model The model
*
* @return boolean True on success.
*
* @since 1.7
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('Module', '', array());
// Preset the redirect
$redirectUrl = 'index.php?option=com_modules&view=modules' . $this->getRedirectToListAppend();
$this->setRedirect(JRoute::_($redirectUrl, 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 1.6
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
$app = JFactory::getApplication();
$task = $this->getTask();
switch ($task)
{
case 'save2new':
$app->setUserState('com_modules.add.module.extension_id', $model->getState('module.extension_id'));
break;
default:
$app->setUserState('com_modules.add.module.extension_id', null);
break;
}
$app->setUserState('com_modules.add.module.params', null);
}
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key
*
* @return boolean True if successful, false otherwise.
*/
public function save($key = null, $urlVar = null)
{
$this->checkToken();
if (JFactory::getDocument()->getType() == 'json')
{
$model = $this->getModel();
$data = $this->input->post->get('jform', array(), 'array');
$item = $model->getItem($this->input->get('id'));
$properties = $item->getProperties();
if (isset($data['params']))
{
unset($properties['params']);
}
// Replace changed properties
$data = array_replace_recursive($properties, $data);
if (!empty($data['assigned']))
{
$data['assigned'] = array_map('abs', $data['assigned']);
}
// Add new data to input before process by parent save()
$this->input->post->set('jform', $data);
// Add path of forms directory
JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_modules/models/forms');
}
parent::save($key, $urlVar);
}
/**
* Method to get the other modules in the same position
*
* @return string The data for the Ajax request.
*
* @since 3.6.3
*/
public function orderPosition()
{
$app = JFactory::getApplication();
// Send json mime type.
$app->mimeType = 'application/json';
$app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet);
$app->sendHeaders();
// Check if user token is valid.
if (!JSession::checkToken('get'))
{
$app->enqueueMessage(JText::_('JINVALID_TOKEN_NOTICE'), 'error');
echo new JResponseJson;
$app->close();
}
$jinput = $app->input;
$clientId = $jinput->getValue('client_id');
$position = $jinput->getValue('position');
$moduleId = $jinput->getValue('module_id');
// Access check.
if (!JFactory::getUser()->authorise('core.create', 'com_modules')
&& !JFactory::getUser()->authorise('core.edit.state', 'com_modules')
&& ($moduleId && !JFactory::getUser()->authorise('core.edit.state', 'com_modules.module.' . $moduleId)))
{
$app->enqueueMessage(\JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 'error');
echo new JResponseJson;
$app->close();
}
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('position, ordering, title')
->from('#__modules')
->where('client_id = ' . (int) $clientId . ' AND position = ' . $db->q($position))
->order('ordering');
$db->setQuery($query);
try
{
$orders = $db->loadObjectList();
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
return '';
}
$orders2 = array();
$n = count($orders);
if ($n > 0)
{
for ($i = 0, $n; $i < $n; $i++)
{
if (!isset($orders2[$orders[$i]->position]))
{
$orders2[$orders[$i]->position] = 0;
}
$orders2[$orders[$i]->position]++;
$ord = $orders2[$orders[$i]->position];
$title = JText::sprintf('COM_MODULES_OPTION_ORDER_POSITION', $ord, htmlspecialchars($orders[$i]->title, ENT_QUOTES, 'UTF-8'));
$html[] = $orders[$i]->position . ',' . $ord . ',' . $title;
}
}
else
{
$html[] = $position . ',' . 1 . ',' . JText::_('JNONE');
}
echo new JResponseJson($html);
$app->close();
}
}
PK I�!]���� �
fields.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Fields list controller class.
*
* @since 3.7.0
*/
class FieldsControllerFields extends JControllerAdmin
{
/**
* The prefix to use with controller messages.
*
* @var string
*
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS_FIELD';
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config The array of possible config values. Optional.
*
* @return FieldsModelField|boolean
*
* @since 3.7.0
*/
public function getModel($name = 'Field', $prefix = 'FieldsModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK I�!]�0�W field.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2016 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\Registry\Registry;
/**
* The Field controller
*
* @since 3.7.0
*/
class FieldsControllerField extends JControllerForm
{
private $internalContext;
private $component;
/**
* The prefix to use with controller messages.
*
* @var string
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS_FIELD';
/**
* Class constructor.
*
* @param array $config A named array of configuration variables.
*
* @since 3.7.0
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->internalContext = JFactory::getApplication()->getUserStateFromRequest('com_fields.fields.context', 'context', 'com_content.article', 'CMD');
$parts = FieldsHelper::extract($this->internalContext);
$this->component = $parts ? $parts[0] : null;
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 3.7.0
*/
protected function allowAdd($data = array())
{
return JFactory::getUser()->authorise('core.create', $this->component);
}
/**
* Method override to check if you can edit an existing 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;
$user = JFactory::getUser();
// Zero record (id:0), return component edit permission by calling parent controller method
if (!$recordId)
{
return parent::allowEdit($data, $key);
}
// Check edit on the record asset (explicit or inherited)
if ($user->authorise('core.edit', $this->component . '.field.' . $recordId))
{
return true;
}
// Check edit own on the record asset (explicit or inherited)
if ($user->authorise('core.edit.own', $this->component . '.field.' . $recordId))
{
// Existing record already has an owner, get it
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
// Grant if current user is owner of the record
return $user->id == $record->created_user_id;
}
return false;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 3.7.0
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('Field');
// Preset the redirect
$this->setRedirect('index.php?option=com_fields&view=fields&context=' . $this->internalContext);
return parent::batch($model);
}
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 3.7.0
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
return parent::getRedirectToItemAppend($recordId) . '&context=' . $this->internalContext;
}
/**
* Gets the URL arguments to append to a list redirect.
*
* @return string The arguments to append to the redirect URL.
*
* @since 3.7.0
*/
protected function getRedirectToListAppend()
{
return parent::getRedirectToListAppend() . '&context=' . $this->internalContext;
}
/**
* 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.7.0
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
$item = $model->getItem();
if (isset($item->params) && is_array($item->params))
{
$registry = new Registry;
$registry->loadArray($item->params);
$item->params = (string) $registry;
}
return;
}
}
PK k�!]T�z� �
browse.phpnu &1i� <?php
/**
* @name Slideshow CK
* @package com_slideshowck
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
*/
// No direct access
defined('CK_LOADED') or die;
use Slideshowck\CKController;
use Slideshowck\CKFof;
require_once SLIDESHOWCK_PATH . '/helpers/ckbrowse.php';
class SlideshowckControllerBrowse extends CKController {
public function getFiles() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$folder = $this->input->get('folder', '', 'string');
$type = $this->input->get('type', '', 'string');
$filetypes = CKBrowse::getFileTypes($type);
$files = CKBrowse::getImagesInFolder(JPATH_SITE . '/' . $folder, implode('|', $filetypes));
if ($type == 'folder') {
$pathway = str_replace('/', '</span><span class="ckfoldertreepath">', $folder);
?>
<div id="ckfoldertreelistfolderselection">
<div class="ckbutton ckbutton-primary" style="font-size:20px;padding: 10px 20px;" onclick="ckSelectFolder('<?php echo ($folder) ?>')"><i class="fas fa-check-square"></i> <?php echo \Joomla\CMS\Language\Text::_('CK_SELECT_FOLDER') ?><br /><small><?php echo $pathway ?></small></div>
</div>
<?php }
if (empty($files)) {
echo \Joomla\CMS\Language\Text::_('CK_NO_IMAGE_FOUND');
} else {
foreach($files as $file) {
?>
<div class="ckfoldertreefile" data-type="<?php echo $type ?>" onclick="ckSelectFile(this)" data-path="<?php echo iconv('ISO-8859-1', 'UTF-8', $folder) ?>" data-filename="<?php echo iconv('ISO-8859-1', 'UTF-8', $file) ?>">
<img src="<?php echo \Joomla\CMS\Uri\Uri::root(true) . '/' . iconv('ISO-8859-1', 'UTF-8', $folder) . '/' . iconv('ISO-8859-1', 'UTF-8', $file) ?>" title="<?php echo iconv('ISO-8859-1', 'UTF-8', $file); ?>" loading="lazy">
<div class="ckimagetitle"><?php echo iconv('ISO-8859-1', 'UTF-8', $file); ?></div>
</div>
<?php
}
}
exit;
}
}
PK ��!]���� � article.phpnu &1i� PK ��!]��(
*
ajax.json.phpnu &1i� PK ��!]���J� � { featured.phpnu &1i� PK ��!]�f��3 3 u articles.phpnu &1i� PK S|!]e�/f
�+ filter.phpnu &1i� PK S|!],V��o o .I filters.phpnu &1i� PK S|!]�ʼn�g g �L maps.phpnu &1i� PK S|!]�nͿ) �) wP indexer.json.phpnu &1i� PK S|!]�E��: : vz index.phpnu &1i� PK W|!]�tx�D D � tags.phpnu &1i� PK W|!]��'� � e� tag.phpnu &1i� PK Y|!]!i=�
�
�� contact.phpnu &1i� PK Y|!]��T�
�
v� contacts.phpnu &1i� PK Z|!]PڞB �B
A� update.phpnu &1i� PK Z|!]�y/� � � searches.phpnu &1i� PK ]|!]O���
� client.phpnu &1i� PK ]|!]c� �
D� banner.phpnu &1i� PK ]|!]2��Ʒ � y� banners.phpnu &1i� PK ]|!]��F� �
k tracks.phpnu &1i� PK ]|!]�(�U� � � clients.phpnu &1i� PK ]|!]�@�v
v
�
tracks.raw.phpnu &1i� PK `|!]^c� � message.phpnu &1i� PK `|!]���Yl l � messages.phpnu &1i� PK `|!]�n|F� �
�$ config.phpnu &1i� PK �|!]�I�D� � �, newsfeed.phpnu &1i� PK �|!]�g�� �
�8 newsfeeds.phpnu &1i� PK �|!]Ϟ�Z Z �= categories.phpnu &1i� PK �|!]t~Q� � \B customfield.phpnu &1i� PK �|!]�� @�
�
}F events.phpnu &1i� PK �|!]��S� � �Q category.phpnu &1i� PK �|!]���H
�U registration.phpnu &1i� PK �|!]{��%[ [ ` features.phpnu &1i� PK �|!]�X� �d mail.phpnu &1i� PK �|!]����` ` �i customfields.phpnu &1i� PK �|!]��
�u u n registrations.raw.phpnu &1i� PK �|!]�r��� �
9� themes.phpnu &1i� PK �|!]vu$$ $ _� event.phpnu &1i� PK �|!]��
�� � �� icagenda.phpnu &1i� PK �|!]�")_d d �� registrations.phpnu &1i� PK �|!]J�ۄ� � :� feature.phpnu &1i� PK �|!]wtW�
1� index.htmlnu &1i� PK �}!]"��Kg g
�� file.json.phpnu &1i� PK �}!]���) ) )� file.phpnu &1i� PK �}!]��N� �
q� folder.phpnu &1i� PK D�!]lU,�� � E menus.phpnu &1i� PK D�!]m�6�v v b ajax.phpnu &1i� PK ��!]�t��5 5 level.phpnu &1i� PK ��!]��&�8 �8 ~# user.phpnu &1i� PK ��!]bQ�ԧ � �\ users.phpnu &1i� PK ��!]�h+�� �
�i levels.phpnu &1i� PK ��!]T�U�� � �m notes.phpnu &1i� PK ��!]�$���
�
�q group.phpnu &1i� PK ��!]�A�
� groups.phpnu &1i� PK ��!]ҋ��S S 6� note.phpnu &1i� PK �!]���� �
�� overrides.phpnu &1i� PK �!]5���3 3 � strings.json.phpnu &1i� PK �!]d�
� � ^� override.phpnu &1i� PK �!]�Q<�D D �� language.phpnu &1i� PK �!]u�
| |
� languages.phpnu &1i� PK �!]���%
%
�� installed.phpnu &1i� PK �!]���� � � application.phpnu &1i� PK �!]���-� �
�� component.phpnu &1i� PK &�!]�Ym m � style.phpnu &1i� PK &�!]R~�_^ _^ �� template.phpnu &1i� PK &�!]�Yr�� �
]F styles.phpnu &1i� PK \�!]�T�# # �I request.phpnu &1i� PK l�!]�n4� � �Z archive.phpnu &1i� PK l�!]�2Z@A @A �^ sub.phpnu &1i� PK l�!]��O�a a @� statistics.phpnu &1i� PK l�!]�뾎q q ߥ frontemail.phpnu &1i� PK l�!]����4 4
�� frontlist.phpnu &1i� PK l�!]��d� � �� stats.phpnu &1i� PK l�!]R�ҹ� � /� frontbounces.phpnu &1i� PK l�!]��� � � url.phpnu &1i� PK l�!]���G G � lists.phpnu &1i� PK l�!]:�-� � �� frontchooselist.phpnu &1i� PK l�!]�hu�� �
V� frontfile.phpnu &1i� PK %�!]�(Q Q �� modules.phpnu &1i� PK %�!]c(#U� �
� module.phpnu &1i� PK I�!]���� �
�� fields.phpnu &1i� PK I�!]�0�W � field.phpnu &1i� PK k�!]T�z� �
P browse.phpnu &1i� PK R R " �