PK !] article.phpnu &1i
* @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
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\LanguageHelper;
/**
* The categories controller for ajax requests
*
* @since 3.9.0
*/
class CategoriesControllerAjax extends JControllerLegacy
{
/**
* Method to fetch associations of a category
*
* The method assumes that the following http parameters are passed in an Ajax Get request:
* token: the form token
* assocId: the id of the category whose associations are to be returned
* excludeLang: the association for this language is to be excluded
*
* @return null
*
* @since 3.9.0
*/
public function fetchAssociations()
{
if (!JSession::checkToken('get'))
{
echo new JResponseJson(null, JText::_('JINVALID_TOKEN'), true);
}
else
{
$input = JFactory::getApplication()->input;
$extension = $input->get('extension');
$assocId = $input->getInt('assocId', 0);
if ($assocId == 0)
{
echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true);
return;
}
$excludeLang = $input->get('excludeLang', '', 'STRING');
$associations = JLanguageAssociations::getAssociations($extension, '#__categories', 'com_categories.item', (int) $assocId, 'id', 'alias', '');
unset($associations[$excludeLang]);
// Add the title to each of the associated records
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables');
$categoryTable = JTable::getInstance('Category', 'JTable');
foreach ($associations as $lang => $association)
{
$categoryTable->load($association->id);
$associations[$lang]->title = $categoryTable->title;
}
$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1)));
if (count($associations) == 0)
{
$message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE');
}
elseif ($countContentLanguages > count($associations) + 2)
{
$tags = implode(', ', array_keys($associations));
$message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags);
}
else
{
$message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL');
}
echo new JResponseJson($associations, $message);
}
}
}
PK !]J featured.phpnu &1i
* @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 !]f3 3 articles.phpnu &1i
* @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|!](dJ
filter.phpnu &1i add();
}
function countresults(){
$num = acymailing_getVar('int', 'num');
$filters = acymailing_getVar('none', 'filter');
foreach($filters['type'] as $block => $oneType){
if(!empty($oneType[$num])){
$currentType = $oneType[$num];
break;
}
}
if(empty($currentType)) die('No filter type found for the num '.intval($num));
if(empty($filters[$num][$currentType])) die('No filter parameters found for the num '.intval($num));
$filterClass = acymailing_get('class.filter'); // Keep it, it loads the acyQuery class
$query = new acyQuery();
$currentFilterData = $filters[$num][$currentType];
acymailing_importPlugin('acymailing');
$messages = acymailing_trigger('onAcyProcessFilterCount_'.$currentType, array(&$query,$currentFilterData,$num));
echo implode(' | ',$messages);
exit;
}
function displayCondFilter(){
acymailing_importPlugin('acymailing');
$fct = acymailing_getVar('none', 'fct');
$message = acymailing_trigger('onAcyTriggerFct_'.$fct);
echo implode(' | ',$message);
exit;
}
function process(){
if(!$this->isAllowed('lists','filter')) return;
acymailing_checkToken();
$filid = acymailing_getVar('int', 'filid');
if(!empty($filid)){
$this->store();
}
$filterClass = acymailing_get('class.filter');
$filterClass->subid = acymailing_getVar('string', 'subid');
$filterClass->execute(acymailing_getVar('none', 'filter'),acymailing_getVar('none', 'action'), 100000);
if(!empty($filterClass->report)){
if(acymailing_isNoTemplate()){
acymailing_display($filterClass->report,'info');
return;
}else{
foreach($filterClass->report as $oneReport){
acymailing_enqueueMessage($oneReport);
}
}
}
return $this->edit();
}
function filterDisplayUsers(){
if(!$this->isAllowed('lists','filter')) return;
acymailing_checkToken();
return $this->edit();
}
function store(){
if(!$this->isAllowed('lists','filter')) return;
acymailing_checkToken();
$class = acymailing_get('class.filter');
$status = $class->saveForm();
if($status){
acymailing_enqueueMessage(acymailing_translation( 'JOOMEXT_SUCC_SAVED' ), 'message');
}else{
acymailing_enqueueMessage(acymailing_translation( 'ERROR_SAVING' ), 'error');
if(!empty($class->errors)){
foreach($class->errors as $oneError){
acymailing_enqueueMessage($oneError, 'error');
}
}
}
}
}
PK S|!],Vo o filters.phpnu &1i
* @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|!]ʼng g maps.phpnu &1i
* @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
* @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
* @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|!]txD D tags.phpnu &1i
* @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|!]X tag.phpnu &1i registerDefaultTask('tag');
}
function tag(){
if(!$this->isAllowed($this->aclCat,'view')) return;
acymailing_setVar( 'layout', 'tag' );
return parent::display();
}
function plgtrigger(){
if(!require_once(ACYMAILING_BACK.DS.'controllers'.DS.'cpanel.php')) return;
$cPanelController = acymailing_get('controller.cpanel');
$cPanelController->plgtrigger();
return;
}
function customtemplate(){
acymailing_setVar('layout', 'form');
return parent::display();
}
function store(){
acymailing_checkToken();
$plugin = acymailing_getVar('string', 'plugin');
$plugin = preg_replace('#[^a-zA-Z0-9]#Uis', '', $plugin);
$body = acymailing_getVar('string', 'templatebody', '', '', ACY_ALLOWRAW);
if(empty($body)){ acymailing_enqueueMessage(acymailing_translation('FILL_ALL'),'error'); return; }
$pluginsFolder = ACYMAILING_MEDIA.'plugins';
if(!file_exists($pluginsFolder)) acymailing_createDir($pluginsFolder);
try{
$status = acymailing_writeFile($pluginsFolder.DS.$plugin.'.php',$body);
}catch(Exception $e){
$status = false;
}
if($status) acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'),'success');
else acymailing_enqueueMessage(acymailing_translation_sprintf('FAIL_SAVE', $pluginsFolder.DS.$plugin.'.php'),'error');
}
}
PK Y|!]!i=
contact.phpnu &1i
* @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
* @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|!]>^ٟ
update.phpnu &1i registerDefaultTask('update');
}
function listing(){
return $this->update();
}
function install(){
acymailing_increasePerf();
$newConfig = new stdClass();
$newConfig->installcomplete = 1;
$config = acymailing_config();
$updateHelper = acymailing_get('helper.update');
if(!$config->save($newConfig)){
$updateHelper->installTables();
return;
}
$updateHelper->installLanguages();
$updateHelper->initList();
$updateHelper->installTemplates();
$updateHelper->installNotifications();
$updateHelper->installFields();
$updateHelper->installMenu();
$updateHelper->installExtensions();
$updateHelper->installBounceRules();
$updateHelper->fixDoubleExtension();
$updateHelper->addUpdateSite();
$updateHelper->fixMenu();
if(ACYMAILING_J30) acymailing_moveFile(ACYMAILING_BACK.'acymailing_j3.xml', ACYMAILING_BACK.'acymailing.xml');
$acyToolbar = acymailing_get('helper.toolbar');
$acyToolbar->setTitle('AcyMailing', 'dashboard');
$acyToolbar->display();
$this->_iframe(ACYMAILING_UPDATEURL.'install&fromversion='.acymailing_getVar('cmd', 'fromversion').'&fromlevel='.acymailing_getVar('cmd', 'fromlevel'));
}
function update(){
$config = acymailing_config();
if(!acymailing_isAllowed($config->get('acl_config_manage', 'all'))){
acymailing_display(acymailing_translation('ACY_NOTALLOWED'), 'error');
return false;
}
$acyToolbar = acymailing_get('helper.toolbar');
$acyToolbar->setTitle(acymailing_translation('UPDATE_ABOUT'), 'update');
$acyToolbar->link(acymailing_completeLink('dashboard'), acymailing_translation('ACY_CLOSE'), 'cancel');
$acyToolbar->display();
return $this->_iframe(ACYMAILING_UPDATEURL.'update');
}
function _iframe($url){
$config = acymailing_config();
$url .= '&version='.$config->get('version').'&level='.$config->get('level').'&component=acymailing';
?>
get('level', 'starter'));
$userInformation = acymailing_fileGetContent($url, 30);
$warnings = ob_get_clean();
$result = (!empty($warnings) && acymailing_isDebug()) ? $warnings : '';
if(empty($userInformation) || $userInformation === false){
echo json_encode(array('content' => '
Could not load your information from our server
'.$result));
exit;
}
$decodedInformation = json_decode($userInformation, true);
$newConfig = new stdClass();
$listPluginNeedToUpDate = array();
if(!ACYMAILING_J16) {
$query = "SELECT element, id, folder
FROM `#__plugins`
WHERE `folder` = 'acymailing' OR `element` LIKE '%acymailing%' OR `name` LIKE '%acymailing%'";
}else{
$query = "SELECT element, folder, manifest_cache AS mc, extension_id AS id
FROM `#__extensions`
WHERE `state` <> -1 AND `type`= 'plugin' AND (`folder` = 'acymailing' OR `element` LIKE '%acymailing%' OR `name` LIKE '%acymailing%')";
}
$plugins = acymailing_loadObjectList($query);
if(!empty($plugins)){
foreach($plugins as $plugin){
if(ACYMAILING_J16) {
$manifest = json_decode($plugin->mc);
if(empty($manifest->version)) $manifest = simplexml_load_file(JURI::root().'/plugins/'.$plugin->folder.'/'.$plugin->element.'/'.$plugin->element.'.xml');
}else{
$manifest = simplexml_load_file(JURI::root().'/plugins/'.$plugin->folder.'/'.$plugin->element.'.xml');
}
$actualVersion = (string)$manifest->version;
$pluginOnServer = @simplexml_load_file(ACYMAILING_PLUGINURL.$plugin->element.'.xml');
if(empty($pluginOnServer) || $actualVersion >= (string)$pluginOnServer->update[0]->version) continue;
$listPluginNeedToUpDate[] = $plugin->id;
}
}
$newConfig->pluginNeedUpdate = empty($listPluginNeedToUpDate) ? '' : json_encode($listPluginNeedToUpDate);
$newConfig->latestversion = $decodedInformation['latestversion'];
$newConfig->expirationdate = $decodedInformation['expiration'];
$newConfig->lastlicensecheck = time();
$config->save($newConfig);
$menuHelper = acymailing_get('helper.acymenu');
$myAcyArea = $menuHelper->myacymailingarea();
echo json_encode(array('content' => $myAcyArea));
exit;
}
function acysms(){
$config = acymailing_config();
if(!acymailing_isAllowed($config->get('acl_configuration_manage', 'all'))){
acymailing_display(acymailing_translation('ACY_NOTALLOWED'), 'error');
return false;
}
if(file_exists(ACYMAILING_ROOT.'components'.DS.'com_acysms')) {
if(!JComponentHelper::isEnabled('com_acysms')){
acymailing_query('UPDATE #__extensions SET `enabled` = 1 WHERE `element` = "com_acysms" AND `type` = "component"');
}
acymailing_redirect('index.php?option=com_acysms');
}else{
acymailing_setVar('layout', 'acysms');
return parent::display();
}
}
}
PK Z|!]y/ searches.phpnu &1i
* @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
* @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
* @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
* @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
* @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
* @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
* @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 `|!]8:Y Y message.phpnu &1i
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Postinstall message controller.
*
* @since 3.2
*/
class PostinstallControllerMessage extends FOFController
{
/**
* Resets all post-installation messages of the specified extension.
*
* @return void
*
* @since 3.2
*/
public function reset()
{
// CSRF prevention.
$this->_csrfProtection();
/** @var PostinstallModelMessages $model */
$model = $this->getThisModel();
$eid = (int) $model->getState('eid', '700', 'int');
if (empty($eid))
{
$eid = 700;
}
$model->resetMessages($eid);
$this->setRedirect('index.php?option=com_postinstall&eid=' . $eid);
}
/**
* Hides all post-installation messages of the specified extension.
*
* @return void
*
* @since 3.8.7
*/
public function hideAll()
{
// CSRF prevention.
$this->_csrfProtection();
/** @var PostinstallModelMessages $model */
$model = $this->getThisModel();
$eid = (int) $model->getState('eid', '700', 'int');
if (empty($eid))
{
$eid = 700;
}
$model->hideMessages($eid);
$this->setRedirect('index.php?option=com_postinstall&eid=' . $eid);
}
/**
* Executes the action associated with an item.
*
* @return void
*
* @since 3.2
*/
public function action()
{
// CSRF prevention.
$this->_csrfProtection();
$model = $this->getThisModel();
if (!$model->getId())
{
$model->setIDsFromRequest();
}
$item = $model->getItem();
switch ($item->type)
{
case 'link':
$this->setRedirect($item->action);
return;
break;
case 'action':
jimport('joomla.filesystem.file');
$file = FOFTemplateUtils::parsePath($item->action_file, true);
if (JFile::exists($file))
{
require_once $file;
call_user_func($item->action);
}
break;
case 'message':
default:
break;
}
$this->setRedirect('index.php?option=com_postinstall');
}
}
PK `|!]Yl l messages.phpnu &1i
* @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
* @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 |!]ID newsfeed.phpnu &1i
* @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
* @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 |!]5f categories.phpnu &1i
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The Categories List Controller
*
* @since 1.6
*/
class CategoriesControllerCategories extends JControllerAdmin
{
/**
* 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 The model.
*
* @since 1.6
*/
public function getModel($name = 'Category', $prefix = 'CategoriesModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Rebuild the nested set tree.
*
* @return boolean False on failure or error, true on success.
*
* @since 1.6
*/
public function rebuild()
{
$this->checkToken();
$extension = $this->input->get('extension');
$this->setRedirect(JRoute::_('index.php?option=com_categories&view=categories&extension=' . $extension, false));
/** @var CategoriesModelCategory $model */
$model = $this->getModel();
if ($model->rebuild())
{
// Rebuild succeeded.
$this->setMessage(JText::_('COM_CATEGORIES_REBUILD_SUCCESS'));
return true;
}
// Rebuild failed.
$this->setMessage(JText::_('COM_CATEGORIES_REBUILD_FAILURE'));
return false;
}
/**
* Save the manual order inputs from the categories list page.
*
* @return boolean True on success
*
* @since 1.6
* @see JControllerAdmin::saveorder()
* @deprecated 4.0
*/
public function saveorder()
{
$this->checkToken();
try
{
JLog::add(sprintf('%s() is deprecated. Function will be removed in 4.0.', __METHOD__), JLog::WARNING, 'deprecated');
}
catch (RuntimeException $exception)
{
// Informational log only
}
// Get the arrays from the Request
$order = $this->input->post->get('order', null, 'array');
$originalOrder = explode(',', $this->input->getString('original_order_values'));
// Make sure something has changed
if (!($order === $originalOrder))
{
parent::saveorder();
}
else
{
// Nothing to reorder
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
return true;
}
}
/**
* Deletes and returns correctly.
*
* @return void
*
* @since 3.1.2
*/
public function delete()
{
$this->checkToken();
// Get items to remove from the request.
$cid = (array) $this->input->get('cid', array(), 'int');
$extension = $this->input->getCmd('extension', null);
// Remove zero values resulting from input filter
$cid = array_filter($cid);
if (empty($cid))
{
JError::raiseWarning(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED'));
}
else
{
// Get the model.
/** @var CategoriesModelCategory $model */
$model = $this->getModel();
// 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 . '&extension=' . $extension, false));
}
/**
* Check in of one or more records.
*
* Overrides JControllerAdmin::checkin to redirect to URL with extension.
*
* @return boolean True on success
*
* @since 3.6.0
*/
public function checkin()
{
// Process parent checkin method.
$result = parent::checkin();
// Override the redirect Uri.
$redirectUri = 'index.php?option=' . $this->option . '&view=' . $this->view_list . '&extension=' . $this->input->get('extension', '', 'CMD');
$this->setRedirect(JRoute::_($redirectUri, false), $this->message, $this->messageType);
return $result;
}
}
PK |!]t~Q customfield.phpnu &1i view_list = 'customfields';
parent::__construct();
}
}
PK |!] @
events.phpnu &1i 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 |!]e_p p category.phpnu &1i
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
/**
* The Category Controller
*
* @since 1.6
*/
class CategoriesControllerCategory extends JControllerForm
{
/**
* The extension for which the categories apply.
*
* @var string
* @since 1.6
*/
protected $extension;
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @since 1.6
* @see JControllerLegacy
*/
public function __construct($config = array())
{
parent::__construct($config);
// Guess the JText message prefix. Defaults to the option.
if (empty($this->extension))
{
$this->extension = $this->input->get('extension', 'com_content');
}
}
/**
* Method 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())
{
$user = JFactory::getUser();
return ($user->authorise('core.create', $this->extension) || count($user->getAuthorisedCategories($this->extension, 'core.create')));
}
/**
* 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 = 'parent_id')
{
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
// Check "edit" permission on record asset (explicit or inherited)
if ($user->authorise('core.edit', $this->extension . '.category.' . $recordId))
{
return true;
}
// Check "edit own" permission on record asset (explicit or inherited)
if ($user->authorise('core.edit.own', $this->extension . '.category.' . $recordId))
{
// Need to do a lookup from the model to get the owner
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_user_id;
// If the owner matches 'me' then do the test.
if ($ownerId == $user->id)
{
return true;
}
}
return false;
}
/**
* Override parent save method to store form data with right key as expected by edit category page
*
* @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 3.10.3
*/
public function save($key = null, $urlVar = null)
{
$result = parent::save($key, $urlVar);
$oldKey = $this->option . '.edit.category.data';
$newKey = $this->option . '.edit.category.' . substr($this->extension, 4) . '.data';
$app = JFactory::getApplication();
$app->setUserState($newKey, $app->getUserState($oldKey));
return $result;
}
/**
* Override cancel method to clear form data for a failed edit action
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 3.10.3
*/
public function cancel($key = null)
{
$result = parent::cancel($key);
$newKey = $this->option . '.edit.category.' . substr($this->extension, 4) . '.data';
JFactory::getApplication()->setUserState($newKey, null);
return $result;
}
/**
* 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 CategoriesModelCategory $model */
$model = $this->getModel('Category');
// Preset the redirect
$this->setRedirect('index.php?option=com_categories&view=categories&extension=' . $this->extension);
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 1.6
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$append = parent::getRedirectToItemAppend($recordId);
$append .= '&extension=' . $this->extension;
return $append;
}
/**
* Gets the URL arguments to append to a list redirect.
*
* @return string The arguments to append to the redirect URL.
*
* @since 1.6
*/
protected function getRedirectToListAppend()
{
$append = parent::getRedirectToListAppend();
$append .= '&extension=' . $this->extension;
return $append;
}
/**
* 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())
{
$item = $model->getItem();
if (isset($item->params) && is_array($item->params))
{
$registry = new Registry($item->params);
$item->params = (string) $registry;
}
if (isset($item->metadata) && is_array($item->metadata))
{
$registry = new Registry($item->metadata);
$item->metadata = (string) $registry;
}
}
}
PK |!]H
registration.phpnu &1i 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 true));
return $model;
}
}
PK |!]X mail.phpnu &1i
* @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 true));
return $model;
}
}
PK |!]
u u registrations.raw.phpnu &1i 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 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 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 true));
return $model;
}
}
PK |!]")_d d registrations.phpnu &1i true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK |!]Jۄ feature.phpnu &1i view_list = 'features';
parent::__construct();
}
}
PK |!]6
index.htmlnu &1i PK }!]"Kg g
file.json.phpnu &1i
* @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('
', $errors)),
'error' => JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('
', $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 }!]xr file.phpnu &1i _savelanguage();
return $this->language();
}
function savecss(){
if(!$this->isAllowed('configuration', 'manage')) return;
acymailing_checkToken();
$file = acymailing_getVar('cmd', 'file');
if(!preg_match('#^([-a-z0-9]*)_([-_a-z0-9]*)$#i', $file, $result)){
acymailing_display('Could not load the file '.$file.' properly');
exit;
}
$type = $result[1];
$fileName = $result[2];
$path = ACYMAILING_MEDIA.'css'.DS.$type.'_'.$fileName.'.css';
$csscontent = acymailing_getVar('string', 'csscontent');
$alreadyExists = file_exists($path);
if(acymailing_writeFile($path, $csscontent)){
acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'), 'success');
$varName = acymailing_getVar('cmd', 'var');
if(!$alreadyExists){
$js = "var optn = document.createElement(\"OPTION\");
optn.text = '$fileName'; optn.value = '$fileName';
mydrop = window.top.document.getElementById('".$varName."_choice');
mydrop.options.add(optn);
lastid = 0; while(mydrop.options[lastid+1]){lastid = lastid+1;} mydrop.selectedIndex = lastid;
window.top.updateCSSLink('".$varName."','$type','$fileName');";
acymailing_addScript(true, $js);
}
$config = acymailing_config();
$newConfig = new stdClass();
$newConfig->$varName = $fileName;
$config->save($newConfig);
}else{
acymailing_enqueueMessage(acymailing_translation_sprintf('FAIL_SAVE', $path), 'error');
}
return $this->css();
}
function css(){
acymailing_setVar('layout', 'css');
return parent::display();
}
function latest(){
return $this->language();
}
function send(){
if(!$this->isAllowed('configuration', 'manage')) return;
acymailing_checkToken();
$bodyEmail = acymailing_getVar('string', 'mailbody');
$code = acymailing_getVar('cmd', 'code');
acymailing_setVar('code', $code);
if(empty($code)) return;
$config = acymailing_config();
$mailer = acymailing_get('helper.mailer');
$mailer->Subject = '[ACYMAILING LANGUAGE FILE] '.$code;
$mailer->Body = 'The website '.ACYMAILING_LIVE.' using AcyMailing '.$config->get('level').' '.$config->get('version').' sent a language file : '.$code;
$mailer->Body .= "\n"."\n"."\n".$bodyEmail;
$extrafile = acymailing_getLanguagePath(ACYMAILING_ROOT, $code).DS.$code.'.com_acymailing_custom.ini';
if(file_exists($extrafile)){
$mailer->Body .= "\n"."\n"."\n".'Custom content:'."\n".file_get_contents($extrafile);
}
$mailer->AddAddress(acymailing_currentUserEmail(), acymailing_currentUserName());
$mailer->AddAddress('translate@acyba.com', 'Acyba Translation Team');
$mailer->report = false;
$path = acymailing_cleanPath(acymailing_getLanguagePath(ACYMAILING_ROOT, $code).DS.$code.'.com_acymailing.ini');
$mailer->AddAttachment($path);
$result = $mailer->Send();
if($result){
acymailing_display(acymailing_translation('THANK_YOU_SHARING'), 'success');
acymailing_display($mailer->reportMessage, 'success');
}else{
acymailing_display($mailer->reportMessage, 'error');
}
}
function share(){
if(!$this->isAllowed('configuration', 'manage')) return;
acymailing_checkToken();
if($this->_savelanguage()){
acymailing_setVar('layout', 'share');
return parent::display();
}else{
return $this->language();
}
}
function _savelanguage(){
if(!$this->isAllowed('configuration', 'manage')) return;
acymailing_checkToken();
$code = acymailing_getVar('cmd', 'code');
acymailing_setVar('code', $code);
$content = acymailing_getVar('string', 'content', '', '', ACY_ALLOWHTML);
$content = str_replace('', '', $content);
if(empty($code) || empty($content)) return;
$path = acymailing_getLanguagePath(ACYMAILING_ROOT, $code).DS.$code.'.com_acymailing.ini';
$result = acymailing_writeFile($path, $content);
if($result){
acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'), 'success');
$js = "window.top.document.getElementById('image$code').className = 'acyicon-edit'";
acymailing_addScript(true, $js);
$updateHelper = acymailing_get('helper.update');
$updateHelper->installMenu($code);
}else{
acymailing_enqueueMessage(acymailing_translation_sprintf('FAIL_SAVE', $path), 'error');
}
$customcontent = acymailing_getVar('string', 'customcontent', '', '', ACY_ALLOWHTML);
$customcontent = str_replace('', '', $customcontent);
$custompath = acymailing_getLanguagePath(ACYMAILING_ROOT, $code).DS.$code.'.com_acymailing_custom.ini';
$customresult = acymailing_writeFile($custompath, $customcontent);
if(!$customresult) acymailing_enqueueMessage(acymailing_translation_sprintf('FAIL_SAVE', $custompath), 'error');
if($code == acymailing_getLanguageTag()) acymailing_loadLanguage();
return $result;
}
function installLanguages($ajax = true){
$messagesMethod = $ajax ? 'acymailing_display' : 'acymailing_enqueueMessage';
$languages = acymailing_getVar('string', 'languages');
ob_start();
$languagesContent = acymailing_fileGetContent(ACYMAILING_UPDATEURL.'loadLanguages&json=1&codes='.$languages);
$warnings = ob_get_clean();
if(!empty($warnings) && acymailing_isDebug()) echo $warnings;
if(empty($languagesContent)){
$messagesMethod('Could not load the language files from our server, you can update them in the AcyMailing configuration page, tab "Languages" or start your own translation and share it', 'error');
if($ajax) exit;
else return;
}
$decodedLanguages = json_decode($languagesContent, true);
$updateHelper = acymailing_get('helper.update');
$success = array();
$error = array();
foreach($decodedLanguages as $code => $content){
if(empty($content)){
$error[] = 'The language '.$code.' was not found on our server, you can start your own translation in the AcyMailing configuration page, tab "Languages" then share it';
continue;
}
if(acymailing_writeFile(acymailing_getLanguagePath(ACYMAILING_ROOT, $code).DS.$code.'.com_acymailing.ini', $content)){
$updateHelper->installMenu($code);
$success[] = 'Successfully installed language: '.$code;
}else{
$error[] = acymailing_translation_sprintf('FAIL_SAVE', $code.'.com_acymailing.ini');
}
}
if(!empty($success)) $messagesMethod($success, 'success');
if(!empty($error)) $messagesMethod($error, 'error');
if($ajax) exit;
}
function select(){
acymailing_setVar('layout', 'select');
return parent::display();
}
function downloadAcySMS(){
$headers = get_headers('https://www.acyba.com/download-area/download/component-acysms/level-express.html',1);
$package = acymailing_fileGetContent('https://www.acyba.com/download-area/download/component-acysms/level-express.html');
if(empty($headers['Content-Disposition']) || empty($package)) exit;
$fileName = strpos($headers['Content-Disposition'], '.zip') === false ? 'com_acysms.tar.gz' : 'com_acysms.zip';
if(acymailing_writeFile(ACYMAILING_ROOT.'tmp'.DS.'acysms'.DS.$fileName, $package) && acymailing_extractArchive(ACYMAILING_ROOT.'tmp'.DS.'acysms'.DS.$fileName, ACYMAILING_ROOT.'tmp'.DS.'acysms')) echo 'success';
exit;
}
function installPackage(){
if(!ACYMAILING_J16) include_once(ACYMAILING_ROOT.'libraries'.DS.'joomla'.DS.'installer'.DS.'installer.php');
$installer = JInstaller::getInstance();
if($installer->install(ACYMAILING_ROOT.'tmp'.DS.'acysms')){
acymailing_deleteFolder(ACYMAILING_ROOT.'tmp'.DS.'acysms');
echo 'success';
}
exit;
}
}
PK }!]N
folder.phpnu &1i
* @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('
', $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('
', $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('
', $errors)));
return false;
}
if (JFolder::create($object_file->filepath))
{
$data = "\n\n\n";
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!]d: menus.phpnu &1i
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The Menu List Controller
*
* @since 1.6
*/
class MenusControllerMenus extends JControllerLegacy
{
/**
* Display the 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 JController This object to support chaining.
*
* @since 1.6
*/
public function display($cachable = false, $urlparams = false)
{
}
/**
* 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 = 'Menu', $prefix = 'MenusModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Remove an item.
*
* @return void
*
* @since 1.6
*/
public function delete()
{
// Check for request forgeries
$this->checkToken();
$user = JFactory::getUser();
$app = JFactory::getApplication();
$cids = (array) $this->input->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$cids = array_filter($cids);
if (empty($cids))
{
$app->enqueueMessage(JText::_('COM_MENUS_NO_MENUS_SELECTED'), 'notice');
}
else
{
// Access checks.
foreach ($cids as $i => $id)
{
if (!$user->authorise('core.delete', 'com_menus.menu.' . (int) $id))
{
// Prune items that you can't change.
unset($cids[$i]);
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), 'error');
}
}
if (count($cids) > 0)
{
// Get the model.
$model = $this->getModel();
// Remove the items.
if (!$model->delete($cids))
{
$this->setMessage($model->getError(), 'error');
}
else
{
$this->setMessage(JText::plural('COM_MENUS_N_MENUS_DELETED', count($cids)));
}
}
}
$this->setRedirect('index.php?option=com_menus&view=menus');
}
/**
* Rebuild the menu tree.
*
* @return boolean False on failure or error, true on success.
*
* @since 1.6
*/
public function rebuild()
{
$this->checkToken();
$this->setRedirect('index.php?option=com_menus&view=menus');
$model = $this->getModel('Item');
if ($model->rebuild())
{
// Reorder succeeded.
$this->setMessage(JText::_('JTOOLBAR_REBUILD_SUCCESS'));
return true;
}
else
{
// Rebuild failed.
$this->setMessage(JText::sprintf('JTOOLBAR_REBUILD_FAILED', $model->getError()), 'error');
return false;
}
}
/**
* Temporary method. This should go into the 1.5 to 1.6 upgrade routines.
*
* @return JException|void JException instance on error
*
* @since 1.6
*/
public function resync()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$parts = null;
try
{
$query->select('element, extension_id')
->from('#__extensions')
->where('type = ' . $db->quote('component'));
$db->setQuery($query);
$components = $db->loadAssocList('element', 'extension_id');
}
catch (RuntimeException $e)
{
return JError::raiseWarning(500, $e->getMessage());
}
// Load all the component menu links
$query->select($db->quoteName('id'))
->select($db->quoteName('link'))
->select($db->quoteName('component_id'))
->from('#__menu')
->where($db->quoteName('type') . ' = ' . $db->quote('component.item'));
$db->setQuery($query);
try
{
$items = $db->loadObjectList();
}
catch (RuntimeException $e)
{
return JError::raiseWarning(500, $e->getMessage());
}
foreach ($items as $item)
{
// Parse the link.
parse_str(parse_url($item->link, PHP_URL_QUERY), $parts);
// Tease out the option.
if (isset($parts['option']))
{
$option = $parts['option'];
// Lookup the component ID
if (isset($components[$option]))
{
$componentId = $components[$option];
}
else
{
// Mismatch. Needs human intervention.
$componentId = -1;
}
// Check for mis-matched component id's in the menu link.
if ($item->component_id != $componentId)
{
// Update the menu table.
$log = "Link $item->id refers to $item->component_id, converting to $componentId ($item->link)";
echo "
$log";
$query->clear();
$query->update('#__menu')
->set('component_id = ' . $componentId)
->where('id = ' . $item->id);
try
{
$db->setQuery($query)->execute();
}
catch (RuntimeException $e)
{
return JError::raiseWarning(500, $e->getMessage());
}
}
}
}
}
}
PK D!]m6v v ajax.phpnu &1i 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 !]t5 5 level.phpnu &1i
* @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 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 "";
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('
', ''), strip_tags($oneResult));
}
$tagSurvey = implode('
', $data);
}
$replace = array();
$replace['REASON::'] = '
'.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 "";
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
* @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
* @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 !]TU notes.phpnu &1i
* @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
* @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
* @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
* @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
* @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 !]53 3 strings.json.phpnu &1i
* @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
* @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