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); } } PKS|!](dJ filter.phpnu&1iadd(); } 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'); } } } } } PKS|!],Voo 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); } } PKS|!]ʼnggmaps.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); } } PKS|!]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')); PKS|!]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; } } } PKW|!]txDDtags.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(); } } PKW|!]Xtag.phpnu&1iregisterDefaultTask('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'); } } PKY|!]!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); } } PKY|!]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); } } PKZ|!]>^ٟ update.phpnu&1iregisterDefaultTask('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(); } } } PKZ|!]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:YY 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`|!]Yll 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|!]5fcategories.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~Qcustomfield.phpnu&1iview_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_pp 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&1iview_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|!]Xmail.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|!] uuregistrations.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&1iregisterTask( '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&1iview_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|!]")_ddregistrations.phpnu&1i true)) { return parent::getModel($name, $prefix, $config); } } PK|!]Jۄ feature.phpnu&1iview_list = 'features'; parent::__construct(); } } PK|!]6 index.htmlnu&1iPK}!]"Kgg 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}!]xrfile.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; } } PKD!]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()); } } } } } } PKD!]m6vvajax.phpnu&1iinput->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!]&88user.phpnu&1iregisterDefaultTask('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!]ҋSSnote.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!]533strings.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 * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Languages list actions controller. * * @since 1.6 */ class LanguagesControllerLanguage extends JControllerForm { /** * Gets the URL arguments to append to an item redirect. * * @param int $recordId The primary key id for the item. * @param string $key The name of the primary key variable. * * @return string The arguments to append to the redirect URL. * * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $key = 'lang_id') { return parent::getRedirectToItemAppend($recordId, $key); } } PK!]u || languages.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Languages controller Class. * * @since 1.6 */ class LanguagesControllerLanguages extends JControllerAdmin { /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. * * @since 1.6 */ public function getModel($name = 'Language', $prefix = 'LanguagesModel', $config = array('ignore_request' => true)) { return parent::getModel($name, $prefix, $config); } /** * Method to save the submitted ordering values for records via AJAX. * * @return void * * @since 3.1 */ public function saveOrderAjax() { // Check for request forgeries. $this->checkToken(); $pks = (array) $this->input->post->get('cid', array(), 'int'); $order = (array) $this->input->post->get('order', array(), 'int'); // Remove zero PK's and corresponding order values resulting from input filter for PK foreach ($pks as $i => $pk) { if ($pk === 0) { unset($pks[$i]); unset($order[$i]); } } // Get the model. $model = $this->getModel(); // Save the ordering. $return = $model->saveorder($pks, $order); if ($return) { echo '1'; } // Close the application. JFactory::getApplication()->close(); } } PK!]% % installed.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Languages Controller. * * @since 1.5 */ class LanguagesControllerInstalled extends JControllerLegacy { /** * Task to set the default language. * * @return void */ public function setDefault() { // Check for request forgeries. $this->checkToken(); $cid = (string) $this->input->get('cid', '', 'string'); $model = $this->getModel('installed'); if ($model->publish($cid)) { // Switching to the new administrator language for the message if ($model->getState('client_id') == 1) { $language = JFactory::getLanguage(); $newLang = JLanguage::getInstance($cid); JFactory::$language = $newLang; JFactory::getApplication()->loadLanguage($language = $newLang); $newLang->load('com_languages', JPATH_ADMINISTRATOR); } $msg = JText::_('COM_LANGUAGES_MSG_DEFAULT_LANGUAGE_SAVED'); $type = 'message'; } else { $msg = $this->getError(); $type = 'error'; } $clientId = $model->getState('client_id'); $this->setredirect('index.php?option=com_languages&view=installed&client=' . $clientId, $msg, $type); } /** * Task to switch the administrator language. * * @return void */ public function switchAdminLanguage() { // Check for request forgeries. $this->checkToken(); $cid = (string) $this->input->get('cid', '', 'string'); $model = $this->getModel('installed'); // Fetching the language name from the xx-XX.xml or langmetadata.xml respectively. $file = JPATH_ADMINISTRATOR . '/language/' . $cid . '/' . $cid . '.xml'; if (!is_file($file)) { $file = JPATH_ADMINISTRATOR . '/language/' . $cid . '/langmetadata.xml'; } $info = JInstaller::parseXMLInstallFile($file); if ($model->switchAdminLanguage($cid)) { // Switching to the new language for the message $languageName = $info['name']; $language = JFactory::getLanguage(); $newLang = JLanguage::getInstance($cid); JFactory::$language = $newLang; JFactory::getApplication()->loadLanguage($language = $newLang); $newLang->load('com_languages', JPATH_ADMINISTRATOR); $msg = JText::sprintf('COM_LANGUAGES_MSG_SWITCH_ADMIN_LANGUAGE_SUCCESS', $languageName); $type = 'message'; } else { $msg = $this->getError(); $type = 'error'; } $this->setredirect('index.php?option=com_languages&view=installed', $msg, $type); } } PK!] application.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Controller for global configuration * * @since 1.5 * @deprecated 4.0 */ class ConfigControllerApplication extends JControllerLegacy { /** * Class Constructor * * @param array $config An optional associative array of configuration settings. * * @since 1.5 * @deprecated 4.0 */ public function __construct($config = array()) { parent::__construct($config); // Map the apply task to the save method. $this->registerTask('apply', 'save'); } /** * Method to save the configuration. * * @return boolean True on success, false on failure. * * @since 1.5 * @deprecated 4.0 Use ConfigControllerApplicationSave instead. */ public function save() { try { JLog::add( sprintf('%s() is deprecated. Use ConfigControllerApplicationSave instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $controller = new ConfigControllerApplicationSave; return $controller->execute(); } /** * Cancel operation. * * @return boolean True if successful; false otherwise. * * @deprecated 4.0 Use ConfigControllerApplicationCancel instead. */ public function cancel() { try { JLog::add( sprintf('%s() is deprecated. Use ConfigControllerApplicationCancel instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $controller = new ConfigControllerApplicationCancel; return $controller->execute(); } /** * Method to remove the root property from the configuration. * * @return boolean True on success, false on failure. * * @since 1.5 * @deprecated 4.0 Use ConfigControllerApplicationRemoveroot instead. */ public function removeroot() { try { JLog::add( sprintf('%s() is deprecated. Use ConfigControllerApplicationRemoveroot instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $controller = new ConfigControllerApplicationRemoveroot; return $controller->execute(); } } PK!]- component.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Note: this view is intended only to be opened in a popup * * @since 1.5 * @deprecated 4.0 */ class ConfigControllerComponent extends JControllerLegacy { /** * Class Constructor * * @param array $config An optional associative array of configuration settings. * * @since 1.5 * @deprecated 4.0 */ public function __construct($config = array()) { parent::__construct($config); // Map the apply task to the save method. $this->registerTask('apply', 'save'); } /** * Cancel operation * * @return void * * @since 3.0 * @deprecated 4.0 Use ConfigControllerComponentCancel instead. */ public function cancel() { try { JLog::add( sprintf('%s() is deprecated. Use ConfigControllerComponentCancel instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $controller = new ConfigControllerComponentCancel; $controller->execute(); } /** * Save the configuration. * * @return boolean True if successful; false otherwise. * * @deprecated 4.0 Use ConfigControllerComponentSave instead. */ public function save() { try { JLog::add( sprintf('%s() is deprecated. Use ConfigControllerComponentSave instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } $controller = new ConfigControllerComponentSave; return $controller->execute(); } } PK&!]Ymm style.phpnu&1iedit(0); // Redirect to the edit screen. // CKFof::redirect(SLIDESHOWCK_ADMIN_URL . '&view=style&layout=edit&id=0&tmpl=component&layout=modal'); // } // public function edit($id = null, $appendUrl = '') { // parent::edit($id, '&layout=modal&tmpl=component'); // } // // public function copy() { // parent::edit('&layout=modal&tmpl=component'); // } /* * Generate the CSS styles from the settings */ public function save() { // security check if (! CKFof::checkAjaxToken()) { exit(); } $id = $this->input->get('id', 0, 'int'); $model = $this->getModel(); $row = $model->getItem($id); // get data $fields = $this->input->get('fields', '', 'raw'); $name = $this->input->get('name', '', 'string'); if (! $name) $name = 'style' . $id; $layoutcss = trim($this->input->get('layoutcss', '', 'html')); // set data $row->params = $fields; $row->name = $name; $row->layoutcss = $layoutcss; if (! $id = $model->save($row)) { echo "{'result': '0', 'id': '" . $row->id . "', 'message': 'Error : Can not save the Styles !'}"; echo($this->_db->getErrorMsg()); exit; } echo '{"result": "1", "id": "' . $id . '", "message": "Styles saved successfully"}'; exit; } /** * copy an existing page * @return void */ // function copy() { // $model = $this->getModel(); // $cid = $this->input->get('cid', '', 'array'); // $this->input->set('id', (int) $cid[0]); // if (!$model->copy()) { // $msg = \Joomla\CMS\Language\Text::_('CK_COPY_ERROR'); // $type = 'error'; // } else { // $msg = \Joomla\CMS\Language\Text::_('CK_COPY_SUCCESS'); // $type = 'message'; // } // // $this->setRedirect('index.php?option=com_slideshowck&view=styles', $msg, $type); // } /* * Generate the CSS styles from the settings */ public function ajaxRenderCss() { $fields = $this->input->get('fields', '', 'raw'); $fields = json_decode($fields); $customstyles = stripslashes( $this->input->get('customstyles', '', 'string')); $customstyles = json_decode($customstyles); $customcss = $this->input->get('customcss', '', 'html'); $css = $this->renderCss($fields, $customstyles); echo $css . $customcss; exit(); } /* * Render the CSS from the settings */ public function renderCss($fields, $customstyles) { include_once SLIDESHOWCK_PATH . '/helpers/ckstyles.php'; $ckstyles = new \Slideshowck\CKStyles(); $css = $ckstyles->create($fields, $customstyles); return $css; } /** * Ajax method to save the json data into the .mmck file * * @return boolean - true on success for the file creation * */ public function exportParams() { // security check if (! CKFof::checkAjaxToken()) { exit(); } // create a backup file with all fields stored in it $fields = $this->input->get('jsonfields', '', 'string'); $backupfile_path = SLIDESHOWCK_PATH . '/export/exportParamsSlideshowckStyle'. $this->input->get('styleid',0,'int') .'.mmck'; if (file_put_contents($backupfile_path, $fields)) { echo '1'; } else { echo '0'; } exit(); } /** * Ajax method to import the .mmck file into the interface * * @return boolean - true on success for the file creation * */ public function uploadParamsFile() { // security check if (! CKFof::checkAjaxToken()) { exit(); } $file = $this->input->files->get('file', '', 'array'); if (!is_array($file)) exit(); $filename = \Joomla\CMS\Filesystem\File::makeSafe($file['name']); // check if the file exists if (\Joomla\CMS\Filesystem\File::getExt($filename) != 'mmck') { $msg = \Joomla\CMS\Language\Text::_('CK_NOT_MMCK_FILE', true); echo json_encode(array('error'=> $msg)); exit(); } //Set up the source and destination of the file $src = $file['tmp_name']; // check if the file exists if (!$src || !\Joomla\CMS\Filesystem\File::exists($src)) { $msg = \Joomla\CMS\Language\Text::_('CK_FILE_NOT_EXISTS', true); echo json_encode(array('error'=> $msg)); exit(); } // read the file if (!$filecontent = \Joomla\CMS\Filesystem\File::read($src)) { $msg = \Joomla\CMS\Language\Text::_('CK_UNABLE_READ_FILE', true); echo json_encode(array('error'=> $msg)); exit(); } // replace vars to allow data to be moved from another server $filecontent = str_replace("|URIROOT|", \Joomla\CMS\Uri\Uri::root(true), $filecontent); // $filecontent = str_replace("|qq|", '"', $filecontent); // echo $filecontent; echo json_encode(array('data'=> $filecontent)); exit(); } /** * Ajax method to read the fields values from the selected preset * * @return json - * */ function loadPresetFields() { // security check if (! CKFof::checkAjaxToken()) { exit(); } $preset = $this->input->get('preset', '', 'string'); $folder_path = SLIDESHOWCK_MEDIA_PATH . '/presets/'; // load the fields $fields = '{}'; if ( file_exists($folder_path . $preset. '.mmck') ) { $fields = @file_get_contents($folder_path . $preset. '.mmck'); $fields = str_replace('\n','', $fields); // $fields = str_replace("{", "|ob|", $fields); // $fields = str_replace("}", "|cb|", $fields); } else { echo '{"result" : 0, "message" : "File Not found : '.$folder_path . $preset. '.mmck'.'"}'; exit(); } echo '{"result" : 1, "fields" : "'.$fields.'", "customcss" : ""}'; exit(); } }PK&!]I< < template.phpnu&1iget($tempid); header("Content-type: text/css"); echo $class->buildCSS($template->styles, $template->stylesheet); exit; } function applyareas(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; $class = acymailing_get('class.template'); $tempid = acymailing_getVar('int', 'tempid'); if(empty($tempid)) exit; $template = $class->get($tempid); $class->applyAreas($template->body); $class->save($template); $class->createTemplateFile($tempid); acymailing_enqueueMessage(acymailing_translation('ACYEDITOR_ADDAREAS_DONE')); if(acymailing_isNoTemplate()){ $js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = '".acymailing_completeLink('template')."'; }"; acymailing_addScript(true, $js); }else{ return $this->listing(); } } function remove(){ if(!$this->isAllowed($this->aclCat, 'delete')) return; acymailing_checkToken(); acymailing_isAdmin() or die('Only from the back-end'); $cids = acymailing_getVar('array', 'cid', array(), ''); $class = acymailing_get('class.template'); $num = $class->delete($cids); acymailing_enqueueMessage(acymailing_translation_sprintf('SUCC_DELETE_ELEMENTS', $num), 'message'); return $this->listing(); } function copy(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_checkToken(); $cids = acymailing_getVar('array', 'cid', array(), ''); $time = time(); acymailing_arrayToInteger($cids); $query = 'INSERT IGNORE INTO `#__acymailing_template` (`name`, `description`, `body`, `altbody`, `created`, `published`, `premium`, `ordering`, `namekey`, `styles`, `subject`,`stylesheet`,`fromname`,`fromemail`,`replyname`,`replyemail`,`thumb`,`readmore`,`category`)'; $query .= " SELECT CONCAT('copy_',`name`), `description`, `body`, `altbody`, $time, `published`, 0, `ordering`, CONCAT('$time',`tempid`,`namekey`), `styles`, `subject`,`stylesheet`,`fromname`,`fromemail`,`replyname`,`replyemail`,`thumb`,`readmore`,`category` FROM `#__acymailing_template` WHERE `tempid` IN (".implode(',', $cids).')'; acymailing_query($query); $orderClass = acymailing_get('helper.order'); $orderClass->pkey = 'tempid'; $orderClass->table = 'template'; $orderClass->reOrder(); return $this->listing(); } function store(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_checkToken(); acymailing_isAdmin() or die('Only from the back-end'); $templateClass = acymailing_get('class.template'); $status = $templateClass->saveForm(); if($status){ acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'), 'message'); $templateClass->proposeApplyAreas(acymailing_getVar('int', 'tempid')); }else{ acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error'); if(!empty($templateClass->errors)){ foreach($templateClass->errors as $oneError){ acymailing_enqueueMessage($oneError, 'error'); } } } } function theme(){ if(!$this->isAllowed($this->aclCat, 'view')) return; acymailing_setVar('layout', 'theme'); return parent::display(); } function upload(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_setVar('layout', 'upload'); return parent::display(); } function doupload(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_checkToken(); $templateClass = acymailing_get('class.template'); $statusUpload = $templateClass->doupload(); if($statusUpload){ if(!$templateClass->proposedAreas){ acymailing_setNoTemplate(false); $js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = '".acymailing_completeLink('template', false, true)."'; }"; acymailing_addScript(true, $js); } return; }else{ return $this->upload(); } } function export(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_checkToken(); $cids = acymailing_getVar('array', 'cid', array(), ''); acymailing_arrayToInteger($cids); $templateClass = acymailing_get('class.template'); $resExport = $templateClass->export($cids[0]); if(!empty($resExport)) acymailing_enqueueMessage(acymailing_translation_sprintf('ACYTEMPLATE_EXPORTED', '', ''), 'success'); return $this->listing(); } function test(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; $this->store(); $tempid = acymailing_getCID('tempid'); $test_selection = acymailing_getVar('string', 'test_selection', '', ''); if(empty($tempid) OR empty($test_selection)) return; $mailer = acymailing_get('helper.mailer'); $mailer->report = true; $config = acymailing_config(); $subscriberClass = acymailing_get('class.subscriber'); $userHelper = acymailing_get('helper.user'); acymailing_importPlugin('acymailing'); $receivers = array(); if($test_selection == 'users'){ $receiverEntry = acymailing_getVar('string', 'test_emails', '', ''); if(!empty($receiverEntry)){ if(substr_count($receiverEntry, '@') > 1){ $receivers = explode(',', trim(preg_replace('# +#', '', $receiverEntry))); }else{ $receivers[] = trim($receiverEntry); } } }else{ $gid = acymailing_getVar('int', 'test_group', '-1'); if($gid == -1) return false; if(!ACYMAILING_J16){ $receivers = acymailing_loadResultArray('SELECT '.$this->cmsUserVars->email.' AS email FROM '.acymailing_table($this->cmsUserVars->table, false).' WHERE gid = '.intval($gid)); }else{ $receivers = acymailing_loadResultArray('SELECT u.'.$this->cmsUserVars->email.' AS email FROM '.acymailing_table($this->cmsUserVars->table, false).' AS u JOIN '.acymailing_table('user_usergroup_map', false).' AS ugm ON u.'.$this->cmsUserVars->id.' = ugm.user_id WHERE ugm.group_id = '.intval($gid)); } } if(empty($receivers)){ acymailing_enqueueMessage(acymailing_translation('NO_SUBSCRIBER'), 'notice'); return $this->edit(); } $classTemplate = acymailing_get('class.template'); $myTemplate = $classTemplate->get($tempid); $myTemplate->sendHTML = 1; $myTemplate->mailid = 0; $myTemplate->template = $myTemplate; if(empty($myTemplate->subject)) $myTemplate->subject = $myTemplate->name; if(empty($myTemplate->altBody)) $myTemplate->altbody = $mailer->textVersion($myTemplate->body); acymailing_trigger('acymailing_replacetags', array(&$myTemplate, true)); $myTemplate->body = acymailing_absoluteURL($myTemplate->body); $result = true; foreach($receivers as $receiveremail){ $copy = $myTemplate; $mailer->clearAll(); $mailer->setFrom($copy->fromemail, $copy->fromname); if(!empty($copy->replyemail)){ $replyToName = $config->get('add_names', true) ? $mailer->cleanText($copy->replyname) : ''; $mailer->AddReplyTo($mailer->cleanText($copy->replyemail), $replyToName); } $receiver = $subscriberClass->get($receiveremail); if(empty($receiver->subid)){ if($userHelper->validEmail($receiveremail)){ $newUser = new stdClass(); $newUser->email = $receiveremail; $subscriberClass->sendConf = false; $subid = $subscriberClass->save($newUser); $receiver = $subscriberClass->get($subid); } if(empty($receiver->subid)) continue; } $addedName = $config->get('add_names', true) ? $mailer->cleanText($receiver->name) : ''; $mailer->AddAddress($mailer->cleanText($receiver->email), $addedName); acymailing_trigger('acymailing_replaceusertags', array(&$copy, &$receiver, true)); $mailer->isHTML(true); $mailer->Body = $copy->body; $mailer->Subject = $copy->subject; if($config->get('multiple_part', false)){ $mailer->AltBody = $copy->altbody; } $mailer->send(); } return $this->edit(); } } PK&!]Yr styles.phpnu&1i true)); return $model; } }PK\!])WF&F& request.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Request management controller class. * * @since 3.9.0 */ class PrivacyControllerRequest extends JControllerForm { /** * Method to complete a request. * * @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 * * @since 3.9.0 */ public function complete($key = null, $urlVar = null) { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); /** @var PrivacyModelRequest $model */ $model = $this->getModel(); /** @var PrivacyTableRequest $table */ $table = $model->getTable(); // Determine the name of the primary key for the data. if (empty($key)) { $key = $table->getKeyName(); } // To avoid data collisions the urlVar may be different from the primary key. if (empty($urlVar)) { $urlVar = $key; } $recordId = $this->input->getInt($urlVar); $item = $model->getItem($recordId); // Ensure this record can transition to the requested state if (!$this->canTransition($item, '2')) { $this->setError(\JText::_('COM_PRIVACY_ERROR_COMPLETE_TRANSITION_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect( \JRoute::_( 'index.php?option=com_privacy&view=request&id=' . $recordId, false ) ); return false; } // Build the data array for the update $data = array( $key => $recordId, 'status' => '2', ); // Access check. if (!$this->allowSave($data, $key)) { $this->setError(\JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect( \JRoute::_( 'index.php?option=com_privacy&view=request&id=' . $recordId, false ) ); return false; } // Attempt to save the data. if (!$model->save($data)) { // 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=com_privacy&view=request&id=' . $recordId, false ) ); return false; } // Log the request completed $model->logRequestCompleted($recordId); $this->setMessage(\JText::_('COM_PRIVACY_REQUEST_COMPLETED')); $url = 'index.php?option=com_privacy&view=requests'; // Check if there is a return value $return = $this->input->get('return', null, 'base64'); if (!is_null($return) && \JUri::isInternal(base64_decode($return))) { $url = base64_decode($return); } // Redirect to the list screen. $this->setRedirect(\JRoute::_($url, false)); return true; } /** * Method to email the data export for a request. * * @return boolean * * @since 3.9.0 */ public function emailexport() { // Check for request forgeries. $this->checkToken('get'); /** @var PrivacyModelExport $model */ $model = $this->getModel('Export'); $recordId = $this->input->getUint('id'); if (!$model->emailDataExport($recordId)) { // Redirect back to the edit screen. $this->setError(\JText::sprintf('COM_PRIVACY_ERROR_EXPORT_EMAIL_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); } else { $this->setMessage(\JText::_('COM_PRIVACY_EXPORT_EMAILED')); } $url = 'index.php?option=com_privacy&view=requests'; // Check if there is a return value $return = $this->input->get('return', null, 'base64'); if (!is_null($return) && \JUri::isInternal(base64_decode($return))) { $url = base64_decode($return); } // Redirect to the list screen. $this->setRedirect(\JRoute::_($url, false)); return true; } /** * Method to invalidate a request. * * @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 * * @since 3.9.0 */ public function invalidate($key = null, $urlVar = null) { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); /** @var PrivacyModelRequest $model */ $model = $this->getModel(); /** @var PrivacyTableRequest $table */ $table = $model->getTable(); // Determine the name of the primary key for the data. if (empty($key)) { $key = $table->getKeyName(); } // To avoid data collisions the urlVar may be different from the primary key. if (empty($urlVar)) { $urlVar = $key; } $recordId = $this->input->getInt($urlVar); $item = $model->getItem($recordId); // Ensure this record can transition to the requested state if (!$this->canTransition($item, '-1')) { $this->setError(\JText::_('COM_PRIVACY_ERROR_INVALID_TRANSITION_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect( \JRoute::_( 'index.php?option=com_privacy&view=request&id=' . $recordId, false ) ); return false; } // Build the data array for the update $data = array( $key => $recordId, 'status' => '-1', ); // Access check. if (!$this->allowSave($data, $key)) { $this->setError(\JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect( \JRoute::_( 'index.php?option=com_privacy&view=request&id=' . $recordId, false ) ); return false; } // Attempt to save the data. if (!$model->save($data)) { // 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=com_privacy&view=request&id=' . $recordId, false ) ); return false; } // Log the request invalidated $model->logRequestInvalidated($recordId); $this->setMessage(\JText::_('COM_PRIVACY_REQUEST_INVALIDATED')); $url = 'index.php?option=com_privacy&view=requests'; // Check if there is a return value $return = $this->input->get('return', null, 'base64'); if (!is_null($return) && \JUri::isInternal(base64_decode($return))) { $url = base64_decode($return); } // Redirect to the list screen. $this->setRedirect(\JRoute::_($url, false)); return true; } /** * Method to remove the user data for a privacy remove request. * * @return boolean * * @since 3.9.0 */ public function remove() { // Check for request forgeries. $this->checkToken('request'); /** @var PrivacyModelRemove $model */ $model = $this->getModel('Remove'); $recordId = $this->input->getUint('id'); if (!$model->removeDataForRequest($recordId)) { // Redirect back to the edit screen. $this->setError(\JText::sprintf('COM_PRIVACY_ERROR_REMOVE_DATA_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); $this->setRedirect( \JRoute::_( 'index.php?option=com_privacy&view=request&id=' . $recordId, false ) ); return false; } $this->setMessage(\JText::_('COM_PRIVACY_DATA_REMOVED')); $url = 'index.php?option=com_privacy&view=requests'; // Check if there is a return value $return = $this->input->get('return', null, 'base64'); if (!is_null($return) && \JUri::isInternal(base64_decode($return))) { $url = base64_decode($return); } // Redirect to the list screen. $this->setRedirect(\JRoute::_($url, false)); return true; } /** * 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.9.0 */ protected function postSaveHook(\JModelLegacy $model, $validData = array()) { // This hook only processes new items if (!$model->getState($model->getName() . '.new', false)) { return; } if (!$model->logRequestCreated($model->getState($model->getName() . '.id'))) { if ($error = $model->getError()) { JFactory::getApplication()->enqueueMessage($error, 'warning'); } } if (!$model->notifyUserAdminCreatedRequest($model->getState($model->getName() . '.id'))) { if ($error = $model->getError()) { JFactory::getApplication()->enqueueMessage($error, 'warning'); } } else { JFactory::getApplication()->enqueueMessage(JText::_('COM_PRIVACY_MSG_CONFIRM_EMAIL_SENT_TO_USER')); } } /** * Method to determine if an item can transition to the specified status. * * @param object $item The item being updated. * @param string $newStatus The new status of the item. * * @return boolean * * @since 3.9.0 */ private function canTransition($item, $newStatus) { switch ($item->status) { case '0': // A pending item can only move to invalid through this controller due to the requirement for a user to confirm the request return $newStatus === '-1'; case '1': // A confirmed item can be marked completed or invalid return in_array($newStatus, array('-1', '2'), true); // An item which is already in an invalid or complete state cannot transition, likewise if we don't know the state don't change anything case '-1': case '2': default: return false; } } } PKl!]n4 archive.phpnu&1icountReturn = false; $statsClass->saveStats(); $printEnabled = acymailing_getVar('none', 'print', 0); if($printEnabled){ $js = "setTimeout(function(){ if(document.getElementById('iframepreview')){ document.getElementById('iframepreview').contentWindow.focus(); document.getElementById('iframepreview').contentWindow.print(); }else{ window.print(); } },2000);"; acymailing_addScript(true, $js); } acymailing_setVar('layout', 'view'); return parent::display(); } } PKl!]2Z@A@Asub.phpnu&1i_checkRedirectUrl($redirectUrl); acymailing_redirect($redirectUrl,'Please enable the Javascript to be able to subscribe','notice'); } return false; } function display($dummy1 = false, $dummy2 = false){ $moduleId = acymailing_getVar('int', 'formid'); if(empty($moduleId)) return; if(acymailing_getVar('int', 'interval') > 0) setcookie('acymailingSubscriptionState', true, time() + acymailing_getVar('int', 'interval'), '/'); $module = acymailing_loadObject('SELECT * FROM #__modules WHERE id = '.intval($moduleId).' AND `module` LIKE \'%acymailing%\' AND published = 1 LIMIT 1'); if(empty($module)){ echo 'No module found'; exit; } $module->user = substr( $module->module, 0, 4 ) == 'mod_' ? 0 : 1; $module->name = $module->user ? $module->title : substr( $module->module, 4 ); $module->style = null; $module->module = preg_replace('/[^A-Z0-9_\.-]/i', '', $module->module); $params = array(); if(acymailing_getVar('int', 'autofocus', 0)){ $js = " window.addEventListener('load', function(){ this.focus(); var moduleInputs = document.getElementsByTagName('input'); if(moduleInputs){ var i = 0; while(moduleInputs[i].disabled == true){ i++; } if(moduleInputs[i]) moduleInputs[i].focus(); } });"; acymailing_addScript(true, $js); } echo JModuleHelper::renderModule($module, $params); } function optin(){ acymailing_checkRobots(); $config = acymailing_config(); if(!acymailing_getVar('cmd', 'acy_source') && !empty($_GET['user'])){ acymailing_setVar('acy_source','url'); } $ajax = acymailing_getVar('int', 'ajax', 0); if($ajax){ @ob_end_clean(); header("Content-type:text/html; charset=utf-8"); } $currentUserid = acymailing_currentUserId(); if((int) $config->get('allow_visitor',1) != 1 && empty($currentUserid)){ if($ajax){ echo '{"message":"'.str_replace('"','\"',acymailing_translation('ONLY_LOGGED')).'","type":"error","code":"0"}'; exit; }else{ acymailing_askLog(false, 'ONLY_LOGGED'); return; } } $userClass = acymailing_get('class.subscriber'); $userClass->geolocRight = true; $redirectUrl = urldecode(acymailing_getVar('string', 'redirect', '', '')); $user = new stdClass(); $formData = acymailing_getVar('array', 'user', array(), ''); if(!empty($formData)){ $userClass->checkFields($formData,$user); } $allowUserModifications = (bool) ($config->get('allow_modif','data') == 'all'); $allowSubscriptionModifications = (bool) ($config->get('allow_modif','data') != 'none'); if(empty($user->email)){ $connectedUser = $userClass->identify(true); if(!empty($connectedUser->email)){ $user->email = $connectedUser->email; $allowUserModifications = true; $allowSubscriptionModifications = true; } } $user->email = trim($user->email); $userHelper = acymailing_get('helper.user'); if(empty($user->email) || !$userHelper->validEmail($user->email,true)){ if ($ajax) echo '{"message":"'.str_replace('"','\"',acymailing_translation('VALID_EMAIL')).'","type":"error","code":"0"}'; else echo ""; exit; } if(!empty($user->email)) $user->email = acymailing_punycode($user->email); $alreadyExists = $userClass->get($user->email); if(!empty($alreadyExists->subid)){ if(!empty($alreadyExists->userid)) unset($user->name); $user->subid = $alreadyExists->subid; $currentSubscription = $userClass->getSubscriptionStatus($alreadyExists->subid); }else{ $allowSubscriptionModifications = true; $allowUserModifications = true; $currentSubscription = array(); } $user->accept = 1; if($allowUserModifications){ $userClass->recordHistory = true; $user->subid = $userClass->save($user); } $myuser = $userClass->get($user->subid); if(empty($myuser->subid)){ if ($ajax) echo '{"message":"Could not save the user","type":"error","code":"1"}'; else echo ""; exit; } if(empty($myuser->accept)){ $myuser->accept = 1; $userClass->save($myuser); } if(!$allowUserModifications && !empty($myuser->subid) && empty($myuser->confirmed)){ $userClass->sendConf($myuser->subid); } $statusAdd = (empty($myuser->confirmed) AND $config->get('require_confirmation',false)) ? 2 : 1; $addlists = array(); $updatelists = array(); $hiddenlistsstring = acymailing_getVar('string', 'hiddenlists', '', ''); if(!empty($hiddenlistsstring)){ $hiddenlists = explode(',',$hiddenlistsstring); acymailing_arrayToInteger($hiddenlists); foreach($hiddenlists as $id => $idOneList){ if(!isset($currentSubscription[$idOneList])){ $addlists[$statusAdd][] = $idOneList; continue; } if($currentSubscription[$idOneList]->status == $statusAdd || $currentSubscription[$idOneList]->status == 1) continue; $updatelists[$statusAdd][] = $idOneList; } } $visibleSubscription = acymailing_getVar('array', 'subscription', '', ''); if(!empty($visibleSubscription)){ foreach($visibleSubscription as $idOneList){ if(empty($idOneList)) continue; if(!isset($currentSubscription[$idOneList])){ $addlists[$statusAdd][] = $idOneList; continue; } if($currentSubscription[$idOneList]->status == $statusAdd || $currentSubscription[$idOneList]->status == 1) continue; $updatelists[$statusAdd][] = $idOneList; } } $visiblelistsstring = acymailing_getVar('string', 'visiblelists', '', ''); if(!empty($visiblelistsstring)){ $visiblelist = explode(',',$visiblelistsstring); acymailing_arrayToInteger($visiblelist); foreach($visiblelist as $idList){ if(!in_array($idList,$visibleSubscription) AND !empty($currentSubscription[$idList]) AND $currentSubscription[$idList]->status != '-1'){ $updatelists['-1'][] = $idList; } } } $listsubClass = acymailing_get('class.listsub'); $status = true; $updateMessage = false; $insertMessage = false; if($allowSubscriptionModifications){ if(!empty($updatelists)){ $status = $listsubClass->updateSubscription($myuser->subid,$updatelists) && $status; $updateMessage = true; } if(!empty($addlists)){ $status = $listsubClass->addSubscription($myuser->subid,$addlists) && $status; $insertMessage = true; } }else{ $mailClass = acymailing_get('helper.mailer'); $mailClass->checkConfirmField = false; $mailClass->checkEnabled = false; $mailClass->report = false; $modifySubscriptionSuccess = $mailClass->sendOne('modif',$myuser->subid); $modifySubscriptionError = $mailClass->reportMessage; } $userClass->sendNotification(); if($config->get('subscription_message',1) || $ajax){ if($allowSubscriptionModifications){ if($statusAdd == 2){ if($userClass->confirmationSentSuccess){ $msg = 'CONFIRMATION_SENT'; $code = 2; $msgtype = 'success'; }else{ $msg = $userClass->confirmationSentError; $code = 7; $msgtype = 'error'; } }else{ if($insertMessage){ $msg = 'SUBSCRIPTION_OK'; $code = 3; $msgtype = 'success'; }elseif($updateMessage){ $msg = 'SUBSCRIPTION_UPDATED_OK'; $code = 4; $msgtype = 'success'; }else{ $msg = 'ALREADY_SUBSCRIBED'; $code = 5; $msgtype = 'success'; } } }else{ if($modifySubscriptionSuccess){ $msg = 'IDENTIFICATION_SENT'; $code = 6; $msgtype = 'warning'; }else{ $msg = $modifySubscriptionError; $code = 8; $msgtype = 'error'; } } if($msg == strtoupper($msg)){ $source = acymailing_getVar('cmd', 'acy_source'); if(strpos($source, 'module_') !== false){ $moduleId = '_'.strtoupper($source); if(acymailing_translation($msg.$moduleId) != $msg.$moduleId) $msg = $msg.$moduleId; } $msg = acymailing_translation($msg); } $replace = array(); $replace['{list:name}'] = ''; foreach($myuser as $oneProp => $oneVal){ $replace['{user:'.$oneProp.'}'] = $oneVal; } $msg = str_replace(array_keys($replace),$replace,$msg); if($config->get('redirect_tags', 0) == 1) $redirectUrl = str_replace(array_keys($replace),$replace,$redirectUrl); if($ajax){ $msg = str_replace(array("\n","\r",'"','\\'),array(' ',' ',"'",'\\\\'),$msg); echo '{"message":"'.$msg.'","type":"'.($msgtype == 'warning' ? 'success' : $msgtype).'","code":"'.$code.'"}'; }elseif(empty($redirectUrl)){ acymailing_enqueueMessage($msg,$msgtype == 'success' ? 'info' : $msgtype); }else{ if(strlen($msg)>0){ if($msgtype == 'success') acymailing_enqueueMessage($msg); elseif($msgtype == 'warning') acymailing_enqueueMessage($msg,'notice'); else acymailing_enqueueMessage($msg,'error'); } } } $notifContact = $config->get('notification_contact'); if(!empty($notifContact)){ $mailer = acymailing_get('helper.mailer'); $mailer->autoAddUser = true; $mailer->checkConfirmField = false; $mailer->report = false; foreach($user as $field => $value) $mailer->addParam('user:'.$field,$value); $mailer->addParam('user:subscription',$listsubClass->getSubscriptionString($user->subid)); $mailer->addParam('user:subscriptiondates',$listsubClass->getSubscriptionString($user->subid, true)); $mailer->addParam('user:ip',$userHelper->getIP()); if(!empty($userClass->geolocData)){ foreach($userClass->geolocData as $map=>$value){ $mailer->addParam('geoloc:notif_'.$map,$value); } } $mailer->addParamInfo(); $allUsers = explode(' ',trim(str_replace(array(';',','),' ',$notifContact))); foreach($allUsers as $oneUser){ if(empty($oneUser)) continue; $mailer->sendOne('notification_contact',$oneUser); } } if ($ajax) exit; $this->_closepop($redirectUrl); if(!empty($redirectUrl)) acymailing_redirect($redirectUrl); if('joomla' == 'wordpress') acymailing_redirect(acymailing_rootURI()); return true; } private function _closepop($redirectUrl){ $this->_checkRedirectUrl($redirectUrl); if(empty($redirectUrl)) return; if(!acymailing_getVar('int', 'closepop')) acymailing_redirect($redirectUrl); echo ''; $app = JFactory::getApplication(); $messages = $app->getMessageQueue(); if(!empty($messages)){ $session = JFactory::getSession(); $session->set('application.queue', $messages); } exit; } function optout(){ acymailing_checkRobots(); $config = acymailing_config(); $userClass = acymailing_get('class.subscriber'); $userClass->geolocRight = true; $ajax = acymailing_getVar('int', 'ajax', 0); if($ajax){ @ob_end_clean(); header("Content-type:text/html; charset=utf-8"); } $redirectUrl = urldecode(acymailing_getVar('string', 'redirectunsub')); $formData = acymailing_getVar('array', 'user', array(), ''); $email = trim(strip_tags(@$formData['email'])); $currentEmail = acymailing_currentUserEmail(); if(empty($email) && !empty($currentEmail)){ $email = $currentEmail; } $userHelper = acymailing_get('helper.user'); if(empty($email) || !$userHelper->validEmail($email)){ if ($ajax) echo '{"message":"'.str_replace('"','\"',acymailing_translation('VALID_EMAIL')).'","type":"error","code":"7"}'; else echo ""; exit; } $alreadyExists = $userClass->get($email); if(empty($alreadyExists->subid)){ if ($ajax){ echo '{"message":"'.str_replace('"','\"',acymailing_translation_sprintf('NOT_IN_LIST',''.$email.'')).'","type":"error","code":"8"}'; exit; } if(empty($redirectUrl)) acymailing_enqueueMessage(acymailing_translation_sprintf('NOT_IN_LIST',''.$email.''),'warning'); else acymailing_enqueueMessage(acymailing_translation_sprintf('NOT_IN_LIST',''.$email.''),'notice'); return $this->_closepop($redirectUrl); } $currentEmail = acymailing_currentUserEmail(); if($config->get('allow_modif','data') == 'none' AND (empty($currentEmail) || $currentEmail != $email)){ $mailClass = acymailing_get('helper.mailer'); $mailClass->checkConfirmField = false; $mailClass->checkEnabled = false; $mailClass->report = false; $mailClass->sendOne('modif',$alreadyExists->subid); if ($ajax){ echo '{"message":"'.str_replace('"','\"',acymailing_translation('IDENTIFICATION_SENT')).'","type":"success","code":"9"}'; exit; } if(empty($redirectUrl)) acymailing_enqueueMessage(acymailing_translation( 'IDENTIFICATION_SENT' ),'warning'); else acymailing_enqueueMessage(acymailing_translation( 'IDENTIFICATION_SENT' ), 'notice'); return $this->_closepop($redirectUrl); } $visibleSubscription = acymailing_getVar('array', 'subscription', '', ''); $currentSubscription = $userClass->getSubscriptionStatus($alreadyExists->subid); $hiddenSubscription = explode(',',acymailing_getVar('string', 'hiddenlists', '', '')); $updatelists = array(); $removeSubscription = array_merge($visibleSubscription,$hiddenSubscription); foreach($removeSubscription as $idList){ if(!empty($currentSubscription[$idList]) AND $currentSubscription[$idList]->status != '-1'){ $updatelists[-1][] = $idList; } } if(!empty($updatelists)){ $listsubClass = acymailing_get('class.listsub'); $listsubClass->updateSubscription($alreadyExists->subid,$updatelists); if($config->get('unsubscription_message',1)){ if ($ajax){ echo '{"message":"'.str_replace('"','\"',acymailing_translation('UNSUBSCRIPTION_OK')).'","type":"success","code":"10"}'; exit; } if(empty($redirectUrl)) acymailing_enqueueMessage(acymailing_translation('UNSUBSCRIPTION_OK'),'info'); else{ if(strlen(acymailing_translation('UNSUBSCRIPTION_OK'))>0){ acymailing_enqueueMessage(acymailing_translation('UNSUBSCRIPTION_OK')); } } } }elseif($config->get('unsubscription_message',1) || $ajax){ if ($ajax){ echo '{"message":"'.str_replace('"','\"',acymailing_translation('UNSUBSCRIPTION_NOT_IN_LIST')).'","type":"success","code":"11"}'; exit; } if(empty($redirectUrl)) acymailing_enqueueMessage(acymailing_translation('UNSUBSCRIPTION_NOT_IN_LIST'),'info'); else acymailing_enqueueMessage(acymailing_translation('UNSUBSCRIPTION_NOT_IN_LIST')); } if ($ajax) exit; return $this->_closepop($redirectUrl); } function _checkRedirectUrl($redirectUrl){ $config = acymailing_config(); $regex = trim(preg_replace('#[^a-z0-9\|\.]#i','',$config->get('module_redirect')),'|'); if(empty($regex) || $regex == 'all' || empty($redirectUrl) || 'joomla' != 'joomla') return; preg_match('#^(https?://)?(www.)?([^/]*)#i',$redirectUrl,$resultsurl); $domainredirect = preg_replace('#[^a-z0-9\.]#i','',@$resultsurl[3]); if(preg_match('#^'.$regex.'$#i',$domainredirect)) return; $regex .= '|'.$domainredirect; echo ""; exit; } function listing(){ $errorMsg = "You shouldn't see this page. If you come from an external subscription form, maybe the URL in the form action is not valid."; if(!empty($_SERVER['HTTP_HOST'])) $errorMsg .= "
Host: ".htmlspecialchars($_SERVER['HTTP_HOST'],ENT_COMPAT, 'UTF-8'); if(!empty($_SERVER['REQUEST_URI'])) $errorMsg .= "
URI: ".htmlspecialchars($_SERVER['REQUEST_URI'],ENT_COMPAT, 'UTF-8'); if(!empty($_SERVER['HTTP_REFERER'])) $errorMsg .= "
Referer: ".htmlspecialchars($_SERVER['HTTP_REFERER'],ENT_COMPAT, 'UTF-8'); acymailing_display($errorMsg, 'error'); } } PKl!]Oaastatistics.phpnu&1isaveStats(); header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', false ); header( 'Pragma: no-cache' ); header("Expires: Wed, 17 Sep 1975 21:32:10 GMT"); ob_end_clean(); acymailing_importPlugin('acymailing'); $results = acymailing_trigger('acymailing_getstatpicture'); $picture = reset($results); if(empty($picture)) $picture = 'media/com_acymailing/images/statpicture.png'; $picture = ltrim(str_replace(array('\\','/'),DS,$picture),DS); $imagename = ACYMAILING_ROOT.$picture; $handle = fopen($imagename, 'r'); if(!$handle) exit; header("Content-type: image/png"); $contents = fread($handle, filesize($imagename)); fclose($handle); echo $contents; exit; } } PKl!]뾎qqfrontemail.phpnu&1iget('acl_lists_manage', 'all'))) die('You are not allowed to access this page'); include(ACYMAILING_BACK.'controllers'.DS.'email.php'); class FrontemailController extends EmailController{ } PKl!]44 frontlist.phpnu&1iget('acl_lists_manage', 'all'))) die(acymailing_translation('ACY_NOTALLOWED')); include(ACYMAILING_BACK.'controllers'.DS.'list.php'); class FrontlistController extends ListController{ function __construct($config = array()){ parent::__construct($config); $listClass = acymailing_get('class.list'); $lists = $listClass->getFrontendLists('listid'); $listid = acymailing_getVar('int', 'listid', 0); if(empty($lists) || (!empty($listid) && !in_array($listid, array_keys($lists)))) { acymailing_redirect('index.php', acymailing_translation('ACY_NOTALLOWED'), 'error'); return false; } } function remove(){ $cids = acymailing_getVar('array', 'cid', array(), ''); acymailing_arrayToInteger($cids); if(empty($cids)) acymailing_redirect('index.php?option=com_acymailing&ctrl=frontlist'); $lists = acymailing_loadObjectList('SELECT * FROM `#__acymailing_list` WHERE listid IN ('.implode(',', $cids).')'); foreach($lists as $list){ if(acymailing_currentUserId() != $list->userid){ acymailing_enqueueMessage(acymailing_translation_sprintf('ACY_NO_ACCESS_LIST', $list->listid), 'error'); array_splice($cids, array_search($list->listid, $cids), 1); } } acymailing_setVar('cid', $cids); return parent::remove(); } function form(){ return $this->edit(); } function edit(){ acymailing_setVar('layout', 'form'); return parent::display(); } } PKl!]]Pb 1 1 stats.phpnu&1iisAllowed('statistics','manage')) return; acymailing_setVar( 'layout', 'detaillisting' ); return parent::display(); } function unsubscribed(){ if(!$this->isAllowed('statistics','manage')) return; acymailing_setVar( 'layout', 'unsubscribed' ); return parent::display(); } function forward(){ if(!$this->isAllowed('statistics','manage')) return; acymailing_setVar( 'layout', 'forward' ); return parent::display(); } function unsubchart(){ if(!$this->isAllowed('statistics','manage')) return; acymailing_setVar( 'layout', 'unsubchart' ); return parent::display(); } function mailinglist(){ if(!$this->isAllowed('statistics','manage')) return; acymailing_setVar( 'layout', 'mailinglist' ); return parent::display(); } function remove(){ if(!$this->isAllowed('statistics','delete')) return; acymailing_checkToken(); $cids = acymailing_getVar('array', 'cid', array(), ''); $class = acymailing_get('class.stats'); $num = $class->delete($cids); acymailing_enqueueMessage(acymailing_translation_sprintf('SUCC_DELETE_ELEMENTS',$num), 'message'); return $this->listing(); } function export(){ $selectedMail = acymailing_getVar('int', 'filter_mail', 0); $selectedStatus = acymailing_getVar('string', 'filter_status', ''); $selectedBounce = acymailing_getVar('string', 'filter_bounce', ''); $filters = array(); if(!empty($selectedMail)) $filters[] = 'userstats.mailid = '.$selectedMail; if(!empty($selectedStatus)){ if($selectedStatus == 'bounce') $filters[] = 'userstats.bounce > 0'; elseif($selectedStatus == 'open') $filters[] = 'userstats.open > 0'; elseif($selectedStatus == 'notopen') $filters[] = 'userstats.open < 1'; elseif($selectedStatus == 'failed') $filters[] = 'userstats.fail > 0'; } if(!empty($selectedStatus) && $selectedStatus == 'bounce' && !empty($selectedBounce)) $filters[] = "userstats.bouncerule = ".acymailing_escapeDB($selectedBounce); $query = 'FROM `#__acymailing_userstats` as userstats JOIN `#__acymailing_subscriber` as s ON s.subid = userstats.subid'; if(!empty($filters)) $query .= ' WHERE ('.implode(') AND (',$filters).')'; acymailing_session(); $_SESSION['acymailing']['acyexportquery'] = $query; acymailing_redirect(acymailing_completeLink((acymailing_isAdmin() ? '' : 'front').'data&task=export&sessionquery=1', acymailing_isNoTemplate(),true)); } public function exportUnsubscribed(){ return $this->exportData('unsubscribed'); } public function exportForward(){ return $this->exportData('forward'); } private function exportData($action){ $selectedMail = acymailing_getVar('int', 'filter_mail', 0); $filters = array(); $filters[] = "hist.action = ".acymailing_escapeDB($action); if(!empty($selectedMail)) $filters[] = 'hist.mailid = '.intval($selectedMail); $query = 'FROM #__acymailing_history as hist JOIN #__acymailing_mail as b on hist.mailid = b.mailid JOIN #__acymailing_subscriber as s on hist.subid = s.subid'; if(!empty($filters)) $query .= ' WHERE ('.implode(') AND (',$filters).')'; acymailing_session(); $_SESSION['acymailing']['acyexportquery'] = $query; acymailing_redirect(acymailing_completeLink((acymailing_isAdmin() ? '' : 'front').'data&task=export&sessionquery=1',true,true)); } function exportglobal(){ $extraJoin = ''; $nlCondition = array(); $cids = acymailing_getVar('none', 'cid'); acymailing_arrayToInteger($cids); if(!empty($cids)){ $nlCondition[] = 'a.mailid IN (' . implode(', ', $cids) . ')'; }elseif (!acymailing_isAdmin()) { $listClass = acymailing_get('class.list'); $lists = $listClass->getFrontendLists('listid'); $frontListsIds = array_keys($lists); $extraJoin = " JOIN #__acymailing_listmail AS lm ON a.mailid = lm.mailid"; $filters[] = 'lm.listid IN (' . implode(',', $frontListsIds) . ')'; } $query = 'SELECT b.subject, a.senddate, a.* , a.bouncedetails FROM #__acymailing_stats AS a JOIN #__acymailing_mail AS b ON a.mailid = b.mailid '.$extraJoin; if(!empty($nlCondition)) $query .= ' WHERE '.implode(' AND ', $nlCondition); $query .= ' ORDER BY a.senddate DESC'; $mydata = acymailing_loadObjectList($query); $exportHelper = acymailing_get('helper.export'); $config = acymailing_config(); $encodingClass = acymailing_get('helper.encoding'); $exportHelper->addHeaders('globalStatistics_' . date('m_d_y')); $eol= "\r\n"; $before = '"'; $separator = '"'.str_replace(array('semicolon','comma'),array(';',','), $config->get('export_separator',';')).'"'; $exportFormat = $config->get('export_format','UTF-8'); $after = '"'; $forwardEnabled = $config->get('forward', 0); $titles = array(acymailing_translation( 'JOOMEXT_SUBJECT'), acymailing_translation( 'SEND_DATE' ), acymailing_translation( 'OPEN_UNIQUE' ), acymailing_translation('OPEN_TOTAL'), acymailing_translation('OPEN').' (%)'); if(acymailing_level(1)) array_push($titles, acymailing_translation('UNIQUE_HITS'), acymailing_translation('TOTAL_HITS'), acymailing_translation( 'CLICKED_LINK' ).' (%)'); array_push($titles, acymailing_translation( 'UNSUBSCRIBE' ), acymailing_translation( 'UNSUBSCRIBE' ).' (%)'); if(acymailing_level(1) && $forwardEnabled == 1) array_push($titles, acymailing_translation( 'FORWARDED' )); array_push($titles, acymailing_translation( 'SENT_HTML' ), acymailing_translation( 'SENT_TEXT' )); if(acymailing_level(3)) array_push($titles,acymailing_translation( 'BOUNCES' ), acymailing_translation( 'BOUNCES' ).' (%)'); array_push($titles, acymailing_translation( 'FAILED' ), acymailing_translation( 'ACY_ID' )); $titleLine = $before.implode($separator, $titles).$after.$eol; echo $titleLine; foreach($mydata as $nl){ $line = $nl->subject . $separator; $line.= acymailing_getDate($nl->senddate) . $separator; $line.= $nl->openunique . $separator; $line.= $nl->opentotal . $separator; $cleanSent = $nl->senthtml + $nl->senttext; if(acymailing_level(3)) $cleanSent = $cleanSent - $nl->bounceunique; $prct = (!empty($cleanSent)? round($nl->openunique/$cleanSent*100,2):'-'); $line.= $prct . '%' . $separator; if(acymailing_level(1)){ $line.= $nl->clickunique . $separator; $line.= $nl->clicktotal . $separator; $prct = (!empty($cleanSent)? round($nl->clickunique/$cleanSent*100,2):'-'); $line.= $prct . '%' . $separator; } $line.= $nl->unsub . $separator; $prct = (!empty($cleanSent)? round($nl->unsub/$cleanSent*100,2):'-'); $line.= $prct . '%' . $separator; if(acymailing_level(1) && $forwardEnabled == 1){ $line.= $nl->forward . $separator; } $line.= $nl->senthtml . $separator; $line.= $nl->senttext . $separator; if(acymailing_level(3)){ $line.= $nl->bounceunique . $separator; $prct = (!empty($nl->senthtml)? round($nl->bounceunique/($nl->senthtml+$nl->senttext)*100,2):'-'); $line.= $prct . '%' . $separator; } $line.= $nl->fail . $separator; $line.= $nl->mailid; $line = $before.$encodingClass->change($line, 'UTF-8', $exportFormat).$after.$eol; echo $line; } exit; } function compare(){ if(!$this->isAllowed('statistics','manage')) return; $ids = acymailing_getVar('array', 'cid', array(), ''); acymailing_arrayToInteger($ids); if(empty($_SESSION['acycomparison'])){ $_SESSION['acycomparison'] = $ids; }else{ $_SESSION['acycomparison'] = array_unique(array_merge($_SESSION['acycomparison'], $ids)); } if(count($_SESSION['acycomparison']) > 5){ acymailing_enqueueMessage(acymailing_translation('ACY_MAX_COMPARE'), 'warning'); $_SESSION['acycomparison'] = array_slice($_SESSION['acycomparison'], 0, 5); }elseif(count($_SESSION['acycomparison']) < 2){ acymailing_enqueueMessage(acymailing_translation('ACY_MIN_COMPARE'), 'info'); acymailing_setVar( 'layout', 'listing' ); return parent::display(); } acymailing_setVar( 'layout', 'compare' ); return parent::display(); } function addcompare(){ if(!$this->isAllowed('statistics','manage')) return; $ids = acymailing_getVar('array', 'cid', array(), ''); acymailing_arrayToInteger($ids); if(empty($_SESSION['acycomparison'])){ $_SESSION['acycomparison'] = $ids; }else{ $_SESSION['acycomparison'] = array_unique(array_merge($_SESSION['acycomparison'], $ids)); } if(count($_SESSION['acycomparison']) > 5){ acymailing_enqueueMessage(acymailing_translation('ACY_MAX_COMPARE'), 'warning'); $_SESSION['acycomparison'] = array_slice($_SESSION['acycomparison'], 0, 5); }elseif(count($_SESSION['acycomparison']) < 2){ acymailing_enqueueMessage(acymailing_translation('ACY_MIN_COMPARE'), 'info'); } acymailing_setVar( 'layout', 'listing' ); return parent::display(); } function resetcompare(){ if(!$this->isAllowed('statistics','manage')) return; $_SESSION['acycomparison'] = array(); acymailing_setVar( 'layout', 'listing' ); return parent::display(); } function opendays(){ $tags = acymailing_getVar('string', 'tags', ''); if(empty($tags)){ $intoQuery = 'SELECT opendate FROM ' . acymailing_table('userstats') . ' WHERE opendate > 0 LIMIT 5000'; $statsDays = acymailing_loadObjectList('SELECT COUNT(*) AS nb, FROM_UNIXTIME(opendate,\'%w\') AS day FROM ('.$intoQuery.') AS a GROUP BY day', 'day'); }else{ $tags = explode(',', $tags); acymailing_arrayToInteger($tags); $tagsData = acymailing_loadObjectList('SELECT * FROM ' . acymailing_table('tagmail') . ' WHERE tagid IN ('.implode(',', $tags).')'); $mails = array(); foreach($tagsData as $oneData){ $mails[$oneData->mailid][] = $oneData->tagid; } foreach($mails as $i => $oneMail){ foreach($tags as $oneTag) { if(!in_array($oneTag, $oneMail)){ unset($mails[$i]); break; } } } $eligibleMails = array_keys($mails); if(empty($eligibleMails)){ $statsDays = array(); }else { $intoQuery = 'SELECT opendate FROM ' . acymailing_table('userstats') . ' WHERE opendate > 0 AND mailid IN (' . implode(',', $eligibleMails) . ') LIMIT 5000'; $statsDays = acymailing_loadObjectList('SELECT COUNT(*) AS nb, FROM_UNIXTIME(opendate,\'%w\') AS day FROM ('.$intoQuery.') AS a GROUP BY day', 'day'); } } $total = 0; foreach ($statsDays as $oneDay) { $total += $oneDay->nb; } if(!empty($statsDays[0])){ $statsDays[7] = $statsDays[0]; unset($statsDays[0]); } $days = array('ACY_MONDAY', 'ACY_TUESDAY', 'ACY_WEDNESDAY', 'ACY_THURSDAY', 'ACY_FRIDAY', 'ACY_SATURDAY', 'ACY_SUNDAY'); foreach($days as $i => &$text){ $text = "['".acymailing_translation($text, true)."', ".(empty($statsDays[$i+1]) ? 0 : intval($statsDays[$i+1]->nb * 100 / $total))."]"; } ?>
get('security_key') != acymailing_getVar('string', 'seckey')) die('wrong key'); acymailing_query("REPLACE INTO `#__acymailing_config` (`namekey`,`value`) VALUES ('max_execution_time','5'), ('last_maxexec_check','".time()."')"); @ini_set('max_execution_time',600); @ignore_user_abort(true); $i = 0; while($i < 480){ sleep(8); $i += 10; acymailing_query("UPDATE `#__acymailing_config` SET `value` = '".intval($i)."' WHERE `namekey` = 'max_execution_time'"); acymailing_query("UPDATE `#__acymailing_config` SET `value` = '".time()."' WHERE `namekey` = 'last_maxexec_check'"); sleep(2); } exit; } } PKl!]Rҹfrontbounces.phpnu&1iget('acl_statistics_manage', 'all'))) die(acymailing_translation('ACY_NOTALLOWED')); include(ACYMAILING_BACK.'controllers'.DS.'bounces.php'); class FrontbouncesController extends BouncesController{ function __construct($config = array()){ parent::__construct($config); $task = acymailing_getVar('cmd', 'task'); if($task != 'chart') die(acymailing_translation('ACY_NOTALLOWED')); } function chart(){ acymailing_setVar('layout', 'chart'); return parent::display(); } } PKl!]url.phpnu&1iregisterDefaultTask('click'); } function sef(){ $urls = acymailing_getVar('array', 'urls', array(), ''); $result = array(); $uri = acymailing_rootURI(); foreach($urls as $url){ $url = base64_decode($url); $link = acymailing_route($url, false); if(!empty($uri) && strpos($link, $uri) === 0) $link = substr($link, strlen($uri)); $link = ltrim($link, '/'); $mainurl = acymailing_mainURL($link); $result[$url] = $mainurl.$link; } echo json_encode($result); exit; } } PKl!]GG lists.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Modules list controller class. * * @since 1.6 */ class ModulesControllerModules extends JControllerAdmin { /** * Method to clone an existing module. * * @return void * * @since 1.6 */ public function duplicate() { // Check for request forgeries $this->checkToken(); $pks = (array) $this->input->post->get('cid', array(), 'int'); // Remove zero values resulting from input filter $pks = array_filter($pks); try { if (empty($pks)) { throw new Exception(JText::_('COM_MODULES_ERROR_NO_MODULES_SELECTED')); } $model = $this->getModel(); $model->duplicate($pks); $this->setMessage(JText::plural('COM_MODULES_N_MODULES_DUPLICATED', count($pks))); } catch (Exception $e) { JError::raiseWarning(500, $e->getMessage()); } $this->setRedirect('index.php?option=com_modules&view=modules'); } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. * * @since 1.6 */ public function getModel($name = 'Module', $prefix = 'ModulesModel', $config = array('ignore_request' => true)) { return parent::getModel($name, $prefix, $config); } } PK%!]c(#U module.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Module controller class. * * @since 1.6 */ class ModulesControllerModule extends JControllerForm { /** * Override parent add method. * * @return mixed True if the record can be added, a JError object if not. * * @since 1.6 */ public function add() { $app = JFactory::getApplication(); // Get the result of the parent method. If an error, just return it. $result = parent::add(); if ($result instanceof Exception) { return $result; } // Look for the Extension ID. $extensionId = $app->input->get('eid', 0, 'int'); if (empty($extensionId)) { $redirectUrl = 'index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit'; $this->setRedirect(JRoute::_($redirectUrl, false)); return JError::raiseWarning(500, JText::_('COM_MODULES_ERROR_INVALID_EXTENSION')); } $app->setUserState('com_modules.add.module.extension_id', $extensionId); $app->setUserState('com_modules.add.module.params', null); // Parameters could be coming in for a new item, so let's set them. $params = $app->input->get('params', array(), 'array'); $app->setUserState('com_modules.add.module.params', $params); } /** * Override parent cancel method to reset the add module state. * * @param string $key The name of the primary key of the URL variable. * * @return boolean True if access level checks pass, false otherwise. * * @since 1.6 */ public function cancel($key = null) { $app = JFactory::getApplication(); $result = parent::cancel(); $app->setUserState('com_modules.add.module.extension_id', null); $app->setUserState('com_modules.add.module.params', null); return $result; } /** * Override parent allowSave method. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key. * * @return boolean * * @since 1.6 */ protected function allowSave($data, $key = 'id') { // Use custom position if selected if (isset($data['custom_position'])) { if (empty($data['position'])) { $data['position'] = $data['custom_position']; } unset($data['custom_position']); } return parent::allowSave($data, $key); } /** * Method override to check if you can edit an existing record. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key. * * @return boolean * * @since 3.2 */ protected function allowEdit($data = array(), $key = 'id') { // Initialise variables. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $user = JFactory::getUser(); // Zero record (id:0), return component edit permission by calling parent controller method if (!$recordId) { return parent::allowEdit($data, $key); } // Check edit on the record asset (explicit or inherited) if ($user->authorise('core.edit', 'com_modules.module.' . $recordId)) { return true; } return false; } /** * Method to run batch operations. * * @param string $model The model * * @return boolean True on success. * * @since 1.7 */ public function batch($model = null) { $this->checkToken(); // Set the model $model = $this->getModel('Module', '', array()); // Preset the redirect $redirectUrl = 'index.php?option=com_modules&view=modules' . $this->getRedirectToListAppend(); $this->setRedirect(JRoute::_($redirectUrl, false)); return parent::batch($model); } /** * Function that allows child controller access to model data after the data has been saved. * * @param JModelLegacy $model The data model object. * @param array $validData The validated data. * * @return void * * @since 1.6 */ protected function postSaveHook(JModelLegacy $model, $validData = array()) { $app = JFactory::getApplication(); $task = $this->getTask(); switch ($task) { case 'save2new': $app->setUserState('com_modules.add.module.extension_id', $model->getState('module.extension_id')); break; default: $app->setUserState('com_modules.add.module.extension_id', null); break; } $app->setUserState('com_modules.add.module.params', null); } /** * Method to save a record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key * * @return boolean True if successful, false otherwise. */ public function save($key = null, $urlVar = null) { $this->checkToken(); if (JFactory::getDocument()->getType() == 'json') { $model = $this->getModel(); $data = $this->input->post->get('jform', array(), 'array'); $item = $model->getItem($this->input->get('id')); $properties = $item->getProperties(); if (isset($data['params'])) { unset($properties['params']); } // Replace changed properties $data = array_replace_recursive($properties, $data); if (!empty($data['assigned'])) { $data['assigned'] = array_map('abs', $data['assigned']); } // Add new data to input before process by parent save() $this->input->post->set('jform', $data); // Add path of forms directory JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_modules/models/forms'); } parent::save($key, $urlVar); } /** * Method to get the other modules in the same position * * @return string The data for the Ajax request. * * @since 3.6.3 */ public function orderPosition() { $app = JFactory::getApplication(); // Send json mime type. $app->mimeType = 'application/json'; $app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet); $app->sendHeaders(); // Check if user token is valid. if (!JSession::checkToken('get')) { $app->enqueueMessage(JText::_('JINVALID_TOKEN_NOTICE'), 'error'); echo new JResponseJson; $app->close(); } $jinput = $app->input; $clientId = $jinput->getValue('client_id'); $position = $jinput->getValue('position'); $moduleId = $jinput->getValue('module_id'); // Access check. if (!JFactory::getUser()->authorise('core.create', 'com_modules') && !JFactory::getUser()->authorise('core.edit.state', 'com_modules') && ($moduleId && !JFactory::getUser()->authorise('core.edit.state', 'com_modules.module.' . $moduleId))) { $app->enqueueMessage(\JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 'error'); echo new JResponseJson; $app->close(); } $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('position, ordering, title') ->from('#__modules') ->where('client_id = ' . (int) $clientId . ' AND position = ' . $db->q($position)) ->order('ordering'); $db->setQuery($query); try { $orders = $db->loadObjectList(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); return ''; } $orders2 = array(); $n = count($orders); if ($n > 0) { for ($i = 0, $n; $i < $n; $i++) { if (!isset($orders2[$orders[$i]->position])) { $orders2[$orders[$i]->position] = 0; } $orders2[$orders[$i]->position]++; $ord = $orders2[$orders[$i]->position]; $title = JText::sprintf('COM_MODULES_OPTION_ORDER_POSITION', $ord, htmlspecialchars($orders[$i]->title, ENT_QUOTES, 'UTF-8')); $html[] = $orders[$i]->position . ',' . $ord . ',' . $title; } } else { $html[] = $position . ',' . 1 . ',' . JText::_('JNONE'); } echo new JResponseJson($html); $app->close(); } } PKI!]RR fields.phpnu&1isetTitle(acymailing_translation('EXTRA_FIELDS'), 'fields'); $acyToolbar->help('customfields'); $acyToolbar->display(); $config = acymailing_config(); $level = $config->get('level'); $url = ACYMAILING_HELPURL.'fields-paidversion&utm_source=acymailing-'.$level.'&utm_medium=back-end&utm_content=customfields-display&utm_campaign=upgrade'; $iFrame = ""; echo $iFrame.'
'; return; } return parent::listing(); } } PKI!]0W   field.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\Registry\Registry; /** * The Field controller * * @since 3.7.0 */ class FieldsControllerField extends JControllerForm { private $internalContext; private $component; /** * The prefix to use with controller messages. * * @var string * @since 3.7.0 */ protected $text_prefix = 'COM_FIELDS_FIELD'; /** * Class constructor. * * @param array $config A named array of configuration variables. * * @since 3.7.0 */ public function __construct($config = array()) { parent::__construct($config); $this->internalContext = JFactory::getApplication()->getUserStateFromRequest('com_fields.fields.context', 'context', 'com_content.article', 'CMD'); $parts = FieldsHelper::extract($this->internalContext); $this->component = $parts ? $parts[0] : null; } /** * Method override to check if you can add a new record. * * @param array $data An array of input data. * * @return boolean * * @since 3.7.0 */ protected function allowAdd($data = array()) { return JFactory::getUser()->authorise('core.create', $this->component); } /** * Method override to check if you can edit an existing record. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key. * * @return boolean * * @since 1.6 */ protected function allowEdit($data = array(), $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $user = JFactory::getUser(); // Zero record (id:0), return component edit permission by calling parent controller method if (!$recordId) { return parent::allowEdit($data, $key); } // Check edit on the record asset (explicit or inherited) if ($user->authorise('core.edit', $this->component . '.field.' . $recordId)) { return true; } // Check edit own on the record asset (explicit or inherited) if ($user->authorise('core.edit.own', $this->component . '.field.' . $recordId)) { // Existing record already has an owner, get it $record = $this->getModel()->getItem($recordId); if (empty($record)) { return false; } // Grant if current user is owner of the record return $user->id == $record->created_user_id; } return false; } /** * Method to run batch operations. * * @param object $model The model. * * @return boolean True if successful, false otherwise and internal error is set. * * @since 3.7.0 */ public function batch($model = null) { $this->checkToken(); // Set the model $model = $this->getModel('Field'); // Preset the redirect $this->setRedirect('index.php?option=com_fields&view=fields&context=' . $this->internalContext); return parent::batch($model); } /** * Gets the URL arguments to append to an item redirect. * * @param integer $recordId The primary key id for the item. * @param string $urlVar The name of the URL variable for the id. * * @return string The arguments to append to the redirect URL. * * @since 3.7.0 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { return parent::getRedirectToItemAppend($recordId) . '&context=' . $this->internalContext; } /** * Gets the URL arguments to append to a list redirect. * * @return string The arguments to append to the redirect URL. * * @since 3.7.0 */ protected function getRedirectToListAppend() { return parent::getRedirectToListAppend() . '&context=' . $this->internalContext; } /** * Function that allows child controller access to model data after the data has been saved. * * @param JModelLegacy $model The data model object. * @param array $validData The validated data. * * @return void * * @since 3.7.0 */ protected function postSaveHook(JModelLegacy $model, $validData = array()) { $item = $model->getItem(); if (isset($item->params) && is_array($item->params)) { $registry = new Registry; $registry->loadArray($item->params); $item->params = (string) $registry; } return; } } PKk!]Tz browse.phpnu&1iinput->get('folder', '', 'string'); $type = $this->input->get('type', '', 'string'); $filetypes = CKBrowse::getFileTypes($type); $files = CKBrowse::getImagesInFolder(JPATH_SITE . '/' . $folder, implode('|', $filetypes)); if ($type == 'folder') { $pathway = str_replace('/', '', $folder); ?>

. * */ // No direct access. defined('_JEXEC') or die; jimport('joomla.application.component.controlleradmin'); class DJImageSliderControllerItems extends JControllerAdmin { public function getModel($name = 'Item', $prefix = 'DJImageSliderModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } }PK!]5  menu.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * The Menu Type Controller * * @since 1.6 */ class MenusControllerMenu extends JControllerForm { /** * Dummy method to redirect back to standard controller * * @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.5 */ public function display($cachable = false, $urlparams = false) { $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menus', false)); } /** * Method to save a menu item. * * @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 1.6 */ public function save($key = null, $urlVar = null) { // Check for request forgeries. $this->checkToken(); $app = JFactory::getApplication(); $data = $this->input->post->get('jform', array(), 'array'); $context = 'com_menus.edit.menu'; $task = $this->getTask(); $recordId = $this->input->getInt('id'); // Prevent using 'main' as menutype as this is reserved for backend menus if (strtolower($data['menutype']) == 'main') { $msg = JText::_('COM_MENUS_ERROR_MENUTYPE'); JFactory::getApplication()->enqueueMessage($msg, 'error'); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit' . $this->getRedirectToItemAppend($recordId), false)); return false; } // Populate the row id from the session. $data['id'] = $recordId; // Get the model and attempt to validate the posted data. $model = $this->getModel('Menu'); $form = $model->getForm(); if (!$form) { JError::raiseError(500, $model->getError()); return false; } $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=com_menus&view=menu&layout=edit' . $this->getRedirectToItemAppend($recordId), false)); return false; } if (isset($validData['preset'])) { $preset = trim($validData['preset']) ?: null; unset($validData['preset']); } // 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->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit' . $this->getRedirectToItemAppend($recordId), false)); return false; } // Import the preset selected if (isset($preset) && $data['client_id'] == 1) { try { MenusHelper::installPreset($preset, $data['menutype']); $this->setMessage(JText::_('COM_MENUS_PRESET_IMPORT_SUCCESS')); } catch (Exception $e) { // Save was successful but the preset could not be loaded. Let it through with just a warning $this->setMessage(JText::sprintf('COM_MENUS_PRESET_IMPORT_FAILED', $e->getMessage())); } } else { $this->setMessage(JText::_('COM_MENUS_MENU_SAVE_SUCCESS')); } // Redirect the user and adjust session state based on the chosen task. switch ($task) { case 'apply': // Set the record data in the session. $recordId = $model->getState($this->context . '.id'); $this->holdEditId($context, $recordId); $app->setUserState($context . '.data', null); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit' . $this->getRedirectToItemAppend($recordId), false)); break; case 'save2new': // Clear the record id and data from the session. $this->releaseEditId($context, $recordId); $app->setUserState($context . '.data', null); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit', false)); break; default: // Clear the record id and data from the session. $this->releaseEditId($context, $recordId); $app->setUserState($context . '.data', null); // Redirect to the list screen. $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menus', false)); break; } } /** * Method to display a menu as preset xml. * * @return boolean True if successful, false otherwise. * * @since 3.8.0 */ public function exportXml() { // Check for request forgeries. $this->checkToken(); $cid = (array) $this->input->get('cid', array(), 'int'); // We know the first element is the one we need because we don't allow multi selection of rows $id = empty($cid) ? 0 : reset($cid); if ($id === 0) { $this->setMessage(JText::_('COM_MENUS_SELECT_MENU_FIRST_EXPORT'), 'warning'); $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menus', false)); return false; } $model = $this->getModel('Menu'); $item = $model->getItem($id); if (!$item->menutype) { $this->setMessage(JText::_('COM_MENUS_SELECT_MENU_FIRST_EXPORT'), 'warning'); $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menus', false)); return false; } $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&menutype=' . $item->menutype . '&format=xml', false)); return true; } } PK!]8Aitem.phpnu&1i. * */ // No direct access defined('_JEXEC') or die; jimport('joomla.application.component.controllerform'); class DJImageSliderControllerItem extends JControllerForm { } ?>PK8!]f7U22 toggle.phpnu&1iregisterDefaultTask('toggle'); $this->allowedTablesColumn['list'] = array('published' => 'listid', 'visible' => 'listid'); $this->allowedTablesColumn['action'] = array('published' => 'action_id'); $this->allowedTablesColumn['subscriber'] = array('confirmed' => 'subid', 'html' => 'subid', 'enabled' => 'subid'); $this->allowedTablesColumn['template'] = array('published' => 'tempid', 'premium' => 'tempid'); $this->allowedTablesColumn['mail'] = array('published' => 'mailid', 'visible' => 'mailid'); $this->allowedTablesColumn['listsub'] = array('status' => 'listid,subid'); $this->allowedTablesColumn['plugins'] = array('published' => 'id'); $this->allowedTablesColumn['followup'] = array('add' => 'mailid', 'addall' => 'mailid', 'update' => 'mailid'); $this->allowedTablesColumn['rules'] = array('published' => 'ruleid'); $this->allowedTablesColumn['filter'] = array('published' => 'filid'); $this->allowedTablesColumn['fields'] = array('published' => 'fieldid', 'required' => 'fieldid', 'frontcomp' => 'fieldid', 'backend' => 'fieldid', 'listing' => 'fieldid', 'frontlisting' => 'fieldid', 'frontjoomlaregistration' => 'fieldid', 'frontjoomlaprofile' => 'fieldid', 'joomlaprofile' => 'fieldid', 'frontform' => 'fieldid'); $this->allowedTablesColumn['config'] = array('addindex' => 'namekey', 'guessport' => 'port'); $this->deleteColumns['queue'] = array('subid', 'mailid'); $this->deleteColumns['filter'] = array('filid', 'filid'); $this->deleteColumns['rules'] = array('ruleid', 'ruleid'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); } function toggle(){ acymailing_checkToken(); $completeTask = acymailing_getVar('cmd', 'task'); $task = substr($completeTask, 0, strpos($completeTask, '_')); $elementId = substr($completeTask, strpos($completeTask, '_') + 1); $value = acymailing_getVar('int', 'value', '0', ''); $table = acymailing_getVar('word', 'table', '', ''); if(empty($this->allowedTablesColumn[$table]) || empty($this->allowedTablesColumn[$table][$task])) exit; $pkey = $this->allowedTablesColumn[$table][$task]; if(empty($pkey)) exit; $function = $table.$task; if(method_exists($this, $function)){ $this->$function($elementId, $value); }else{ acymailing_query('UPDATE '.acymailing_table($table).' SET '.$task.' = '.$value.' WHERE '.$pkey.' = '.intval($elementId).' LIMIT 1'); } $toggleClass = acymailing_get('helper.toggle'); $extra = acymailing_getVar('array', 'extra', array(), ''); if(!empty($extra)){ foreach($extra as $key => $val){ $extra[$key] = urldecode($val); } } echo $toggleClass->toggle(acymailing_getVar('cmd', 'task', ''), $value, $table, $extra); exit; } function configguessport($port, $value){ if(!function_exists('fsockopen')){ echo 'fsockopen is not enabled, please contact your hosting company to enable it'; exit; } $tests = array(25 => 'smtp.sendgrid.com', 2525 => 'smtp.sendgrid.com', 587 => 'smtp.sendgrid.com', 465 => 'ssl://smtp.sendgrid.com'); $total = 0; foreach($tests as $port => $server){ $fp = @fsockopen($server, $port, $errno, $errstr, 5); if($fp){ echo '
Port '.$port.' OK'; fclose($fp); $total++; }else{ echo '
Port '.$port.' not opened on your server '; echo " errornum: ".$errno.' : '.$errstr; echo ''; } } if(empty($total)){ } exit; } function testApiKey(){ $apiKey = acymailing_getVar('string', 'value', ''); if(empty($apiKey)){ echo 'No API key
'; exit; } $classGeoloc = acymailing_get('class.geolocation'); $test = $classGeoloc->testApiKey($apiKey); if(!empty($test) && $test->statusCode == 'OK'){ // Works fine echo 'API key OK : '.$test->countryName.' - '.$test->cityName.''; }else if(!empty($test) && $test->statusCode == 'noReturn'){ // No return from the API, displaying the IP used for test and errors if there are any echo 'Error calling IPInfoDB API with IP : '.$test->ip.'
'; if(!empty($test->errorAPI)) echo 'Details : '.$test->errorAPI.''; }else{ // There is a return from the API but with an error status: display the content received to identify the pb echo 'Error returned from the API:

'; foreach($test as $key => $value){ echo $key.' : '.$value.'
'; } echo '
'; } exit; } function configaddindex($table, $value){ $queries = array(); $queries['listsub'] = array('ALTER TABLE `#__acymailing_listsub` ADD INDEX `subidindex` ( `subid` )'); $queries['listsub'][] = 'ALTER TABLE `#__acymailing_listsub` ADD INDEX `listidstatusindex` ( `listid` , `status` )'; $queries['stats'] = array('ALTER TABLE `#__acymailing_stats` ADD INDEX `senddateindex` ( `senddate` )'); $queries['list'] = array('ALTER TABLE `#__acymailing_list` ADD INDEX `typeorderingindex` ( `type` , `ordering` ) '); $queries['list'][] = 'ALTER TABLE `#__acymailing_list` ADD INDEX `useridindex` ( `userid` ) '; $queries['list'][] = 'ALTER TABLE `#__acymailing_list` ADD INDEX `typeuseridindex` ( `type` , `userid` ) '; $queries['mail'] = array('ALTER TABLE `#__acymailing_mail` ADD INDEX `typemailidindex` ( `type` , `mailid` )'); $queries['mail'][] = 'ALTER TABLE `#__acymailing_mail` ADD INDEX `useridindex` ( `userid` )'; $queries['userstats'] = array('ALTER TABLE `#__acymailing_userstats` ADD INDEX `senddateindex` ( `senddate` )'); $queries['userstats'][] = 'ALTER TABLE `#__acymailing_userstats` ADD INDEX `subidindex` ( `subid` )'; $queries['urlclick'] = array('ALTER TABLE `#__acymailing_urlclick` ADD INDEX `dateindex` ( `date` )'); $queries['urlclick'][] = 'ALTER TABLE `#__acymailing_urlclick` ADD INDEX `mailidindex` ( `mailid` )'; $queries['urlclick'][] = 'ALTER TABLE `#__acymailing_urlclick` ADD INDEX `subidindex` ( `subid` ) '; $queries['history'] = array('ALTER TABLE `#__acymailing_history` ADD INDEX `dateindex` ( `date` )'); $queries['history'][] = 'ALTER TABLE `#__acymailing_history` ADD INDEX `actionindex` ( `action` , `mailid` ) '; $queries['template'] = array('ALTER TABLE `#__acymailing_template` ADD INDEX `orderingindex` ( `ordering` )'); $queries['queue'] = array('ALTER TABLE `#__acymailing_queue` ADD INDEX `orderingindex` ( `priority` , `senddate` , `subid` )'); $queries['queue'][] = 'ALTER TABLE `#__acymailing_queue` ADD INDEX `listingindex` ( `senddate` , `subid` )'; $queries['queue'][] = 'ALTER TABLE `#__acymailing_queue` ADD INDEX `mailidindex` ( `mailid` )'; $queries['subscriber'] = array('ALTER TABLE `#__acymailing_subscriber` ADD INDEX `queueindex` ( `enabled` , `accept` , `confirmed` )'); if(empty($queries[$table])){ echo 'No optimization found...'; exit; } $indexOk = 0; echo '| '; foreach($queries[$table] as $oneQuery){ try{ $isError = acymailing_query($oneQuery); }catch(Exception $e){ $isError = null; } if($isError === null){ echo isset($e) ? $e->getMessage() : substr(strip_tags(acymailing_getDBError()), 0, 200).'...'; }else{ $indexOk++; } } if(!empty($indexOk)) echo $indexOk.' indexes added | '; echo ''; $config = acymailing_config(); $newConfig = new stdClass(); $val = 'optimize_'.$table; $newConfig->$val = 1; $config->save($newConfig); exit; } function followupaddall($mailid, $value){ $mailClass = acymailing_get('class.mail'); $nbinserted = $mailClass->addFollowUpQueue($mailid, true); if($nbinserted !== false){ echo acymailing_translation_sprintf('ADDED_QUEUE', $nbinserted); }else{ echo implode(',', $mailClass->errors); } exit; } function followupadd($mailid, $value){ $mailClass = acymailing_get('class.mail'); $nbinserted = $mailClass->addFollowUpQueue($mailid, false); if($nbinserted !== false){ echo acymailing_translation_sprintf('ADDED_QUEUE', $nbinserted); }else{ echo implode(',', $mailClass->errors); } exit; } function followupupdate($mailid, $value){ $mailClass = acymailing_get('class.mail'); $followup = $mailClass->get($mailid); if(empty($followup->mailid)){ echo 'Could not load mailid '.$mailid; exit; } $listmailClass = acymailing_get('class.listmail'); $mycampaign = $listmailClass->getCampaign($followup->mailid); if(empty($mycampaign->listid)){ echo 'Could not get the attached campaign'; exit; } $query = 'UPDATE #__acymailing_queue as a '; $query .= 'LEFT JOIN #__acymailing_listsub as b ON a.subid = b.subid AND b.listid = '.$mycampaign->listid; $query .= ' SET a.`senddate` = b.`subdate` + '.$followup->senddate; $query .= ' WHERE a.mailid = '.$followup->mailid; $nbupdated = acymailing_query($query); if(!empty($nbupdated)){ $campaignHelper = acymailing_get('helper.campaign'); $campaignHelper->updateUnsubdate($mycampaign->listid, $followup->senddate); } echo acymailing_translation_sprintf('NB_EMAILS_UPDATED', $nbupdated); exit; } function delete(){ $value = acymailing_getVar('cmd', 'value'); if(strpos($value, '_') === false) exit; list($value1, $value2) = explode('_', $value); $table = acymailing_getVar('word', 'table', '', ''); if(empty($table)) exit; $function = 'delete'.$table; if(method_exists($this, $function)){ $this->$function($value1, $value2); exit; } if(empty($this->deleteColumns[$table])) exit; list($key1, $key2) = $this->deleteColumns[$table]; if(empty($key1) || empty($key2) || empty($value1) || empty($value2)) exit; acymailing_query('DELETE FROM '.acymailing_table($table).' WHERE '.$key1.' = '.intval($value1).' AND '.$key2.' = '.intval($value2)); exit; } function deleteconfig($namekey, $val){ $config = acymailing_config(); $newConfig = new stdClass(); $newConfig->$namekey = $val; $config->save($newConfig); } function deletefollowup($campaignid, $mailid){ acymailing_checkToken(); $mailClass = acymailing_get('class.mail'); $mailClass->delete((int)$mailid); } function deleteMail($mailid, $attachid){ acymailing_checkToken(); $mailid = intval($mailid); if(empty($mailid)) return false; $attachment = acymailing_loadResult('SELECT attach FROM '.acymailing_table('mail').' WHERE mailid = '.$mailid.' LIMIT 1'); if(empty($attachment)) return; $attach = unserialize($attachment); unset($attach[$attachid]); $attachdb = serialize($attach); return acymailing_query('UPDATE '.acymailing_table('mail').' SET attach = '.acymailing_escapeDB($attachdb).' WHERE mailid = '.$mailid.' LIMIT 1'); } function deleteFavicon($mailid, $favicon){ acymailing_checkToken(); if($favicon != 'favicon') return; $mailid = intval($mailid); if(empty($mailid)) return false; return acymailing_query('UPDATE '.acymailing_table('mail').' SET favicon = "" WHERE mailid = '.$mailid.' LIMIT 1'); } function subscriberconfirmed($subid, $value){ if(!empty($value)){ $subscriberClass = acymailing_get('class.subscriber'); $subscriberClass->confirmSubscription($subid); }else{ acymailing_query('UPDATE '.acymailing_table('subscriber').' SET confirmed = '.$value.' WHERE subid = '.intval($subid).' LIMIT 1'); } } function listsubstatus($ids, $status){ list($listid, $subid) = explode('_', $ids); $listid = (int)$listid; $subid = (int)$subid; if(empty($subid) OR empty($listid)) exit; $listSubClass = acymailing_get('class.listsub'); $lists = array(); $lists[$status] = array($listid); if($listSubClass->updateSubscription($subid, $lists)) return; echo 'error while updating the subscription'; } function pluginspublished($id, $publish){ acymailing_checkToken(); if(!ACYMAILING_J16){ acymailing_query('UPDATE '.acymailing_table('plugins', false).' SET `published` = '.intval($publish).' WHERE `id` = '.intval($id).' AND (`folder` = \'acymailing\' OR `name` LIKE \'%acymailing%\' OR `element` LIKE \'%acymailing%\') LIMIT 1'); }else{ acymailing_query('UPDATE `#__extensions` SET `enabled` = '.intval($publish).' WHERE `extension_id` = '.intval($id).' AND (`folder` = \'acymailing\' OR `name` LIKE \'%acymailing%\' OR `element` LIKE \'%acymailing%\') LIMIT 1'); } $updateHelper = acymailing_get('helper.update'); $updateHelper->cleanPluginCache(); } } PK8!]BU queue.phpnu&1iisAllowed($this->aclCat, 'delete')) return; acymailing_checkToken(); $mailid = acymailing_getVar('int', 'filter_mail', 0, 'post'); $queueClass = acymailing_get('class.queue'); $search = acymailing_getVar('string', 'search'); $filters = array(); if(!empty($search)){ $searchVal = '\'%'.acymailing_getEscaped($search, true).'%\''; $searchFields = array('b.name', 'b.email', 'c.subject', 'a.mailid', 'a.subid'); $filters[] = implode(" LIKE $searchVal OR ", $searchFields)." LIKE $searchVal"; } if(!empty($mailid)){ $filters[] = 'a.mailid = '.intval($mailid); } $total = $queueClass->delete($filters); acymailing_enqueueMessage(acymailing_translation_sprintf('SUCC_DELETE_ELEMENTS', $total), 'message'); acymailing_setVar('filter_mail', 0, 'post'); acymailing_setVar('search', '', 'post'); return $this->listing(); } function process(){ if(!$this->isAllowed($this->aclCat, 'process')) return; acymailing_setVar('layout', 'process'); return parent::display(); } function preview(){ acymailing_setVar('layout', 'preview'); return parent::display(); } function cancelNewsletter(){ if(!$this->isAllowed($this->aclCat, 'delete')) return; acymailing_checkToken(); $mailid = acymailing_getVar('int', 'mailid', 0); if(empty($mailid)){ acymailing_enqueueMessage('Mail id not found', 'error'); return; } $queueClass = acymailing_get('class.queue'); acymailing_enqueueMessage(acymailing_translation_sprintf('SUCC_DELETE_ELEMENTS', $queueClass->delete(array('a.mailid = '.$mailid))), 'info'); } } PK8!]6(AAsubscriber.phpnu&1iisAllowed('subscriber', 'view')) return; acymailing_setVar('layout', 'choose'); return parent::display(); } function export(){ if(!$this->isAllowed('subscriber', 'export')) return; $cids = acymailing_getVar('none', 'cid'); $selectedList = acymailing_getVar('int', 'filter_lists'); $_SESSION['acymailing'] = array(); $redirection = (acymailing_isAdmin() ? '' : 'front').'data&task=export'; if(!empty($cids) || !empty($selectedList)){ if(!empty($cids)){ $_SESSION['acymailing']['exportusers'] = $cids; }else{ $_SESSION['acymailing']['exportlist'] = $selectedList; $_SESSION['acymailing']['exportliststatus'] = acymailing_getVar('int', 'filter_statuslist'); } $redirection .= '&sessionvalues=1'; } acymailing_redirect(acymailing_completeLink($redirection, false, true)); } function store(){ if(!$this->isAllowed('subscriber', 'manage')) return; acymailing_checkToken(); $subscriberClass = acymailing_get('class.subscriber'); $subscriberClass->sendConf = false; $subscriberClass->sendNotif = false; $subscriberClass->sendWelcome = false; $subscriberClass->allowModif = true; $subscriberClass->checkAccess = false; $subscriberClass->triggerFilterBE = true; $subscriberClass->checkVisitor = false; $status = $subscriberClass->saveForm(); if($status){ acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'), 'message'); }else{ acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error'); if(!empty($subscriberClass->errors)){ foreach($subscriberClass->errors as $oneError){ acymailing_enqueueMessage($oneError, 'error'); } } } } function remove(){ acymailing_checkToken(); $config = acymailing_config(); $deleteBehaviour = $config->get('frontend_delete_button', 'delete'); $subscriberIds = acymailing_getVar('array', 'cid', array(), ''); if(acymailing_isAdmin() || $deleteBehaviour == 'delete'){ if(!$this->isAllowed('subscriber', 'delete')) return; $subscriberObject = acymailing_get('class.subscriber'); $num = $subscriberObject->delete($subscriberIds); acymailing_enqueueMessage(acymailing_translation_sprintf('SUCC_DELETE_ELEMENTS', $num), 'message'); }else{ if(!$this->isAllowed('subscriber', 'manage')) return; $listId = acymailing_getVar('int', 'filter_lists', 0); if(empty($listId)){ acymailing_enqueueMessage('List not found', 'error'); }else{ $listsubClass = acymailing_get('class.listsub'); foreach($subscriberIds as $subid){ $listsubClass->removeSubscription($subid, array($listId)); } $listClass = acymailing_get('class.list'); $list = $listClass->get($listId); acymailing_enqueueMessage(acymailing_translation_sprintf('IMPORT_REMOVE', count($subscriberIds), $list->name), 'message'); } } acymailing_setVar('layout', 'listing'); return parent::display(); } function getSubscribersByEmail(){ $NameSearched = acymailing_getVar('string', 'search', ''); if(empty($NameSearched) || !acymailing_isAdmin() || !$this->isAllowed('subscriber', 'view')) exit; $NameSearched = '\'%'.acymailing_getEscaped($NameSearched, true).'%\''; $users = acymailing_loadObjectList('SELECT name, email FROM #__acymailing_subscriber WHERE email LIKE '.$NameSearched.' OR name LIKE '.$NameSearched.' ORDER BY email ASC LIMIT 30'); if(empty($users)) exit; echo ''; foreach($users as $oneUser){ echo 'email).'\');">'; } echo '
'.htmlspecialchars($oneUser->name, ENT_COMPAT, 'UTF-8').''.htmlspecialchars($oneUser->email, ENT_COMPAT, 'UTF-8').'
'; exit; } } PK8!] "C;C;data.phpnu&1i_cleanImportFolder(); return $this->import(); } function import(){ if(!$this->isAllowed('subscriber', 'import')) return; acymailing_setVar('layout', 'import'); return parent::display(); } function export(){ if(!$this->isAllowed('subscriber', 'export')) return; acymailing_setVar('layout', 'export'); return parent::display(); } function loadZohoFields(){ $zohoHelper = acymailing_get('helper.zoho'); $zohoHelper->authtoken = acymailing_getVar('none', 'zoho_apikey'); $list = acymailing_getVar('none', 'zoho_list'); acymailing_setVar('layout', 'import'); $zohoFields = $zohoHelper->getFieldsRaw($list); if(!empty($zohoHelper->error)){ acymailing_enqueueMessage($zohoHelper->error, 'error'); return parent::display(); } $zohoFieldsParsed = $zohoHelper->parseXMLFields($zohoFields); if(!empty($zohoHelper->error)){ acymailing_enqueueMessage($zohoHelper->error, 'error'); return parent::display(); } $config = acymailing_config(); $newconfig = new stdClass(); $newconfig->zoho_fieldsname = implode(',', $zohoFieldsParsed); $newconfig->zoho_list = $list; $newconfig->zoho_apikey = $zohoHelper->authtoken; $config->save($newconfig); acymailing_enqueueMessage(acymailing_translation('ACY_FIELDSLOADED')); return parent::display(); } function doimport(){ if(!$this->isAllowed('subscriber', 'import')) return; acymailing_checkToken(); $function = acymailing_getVar('cmd', 'importfrom'); $importHelper = acymailing_get('helper.import'); if(!$importHelper->$function()){ return $this->import(); } if($function == 'textarea' || $function == 'file'){ if(file_exists(ACYMAILING_MEDIA.'import'.DS.acymailing_getVar('cmd', 'filename'))) $importContent = file_get_contents(ACYMAILING_MEDIA.'import'.DS.acymailing_getVar('cmd', 'filename')); if(empty($importContent)){ acymailing_enqueueMessage(acymailing_translation('ACY_IMPORT_NO_CONTENT'), 'error'); acymailing_redirect(acymailing_completeLink((acymailing_isAdmin() ? '' : 'front').'data&task=import', false, true)); }else{ acymailing_setVar('layout', 'genericimport'); return parent::display(); } }else{ acymailing_redirect(acymailing_completeLink(acymailing_isAdmin() ? 'subscriber' : 'frontsubscriber', false, true)); } } function finalizeimport(){ $importHelper = acymailing_get('helper.import'); $importHelper->finalizeImport(); acymailing_redirect(acymailing_completeLink(acymailing_isAdmin() ? 'subscriber' : 'frontsubscriber', false, true)); } function downloadimport(){ $filename = acymailing_getVar('cmd', 'filename'); if(!file_exists(ACYMAILING_MEDIA.'import'.DS.$filename.'.csv')) return; $exportHelper = acymailing_get('helper.export'); $exportHelper->addHeaders($filename); echo file_get_contents(ACYMAILING_MEDIA.'import'.DS.$filename.'.csv'); exit; } function ajaxencoding(){ acymailing_setVar('layout', 'ajaxencoding'); parent::display(); exit; } function ajaxload(){ if(!$this->isAllowed('subscriber', 'import')) return; $function = acymailing_getVar('cmd', 'importfrom').'_ajax'; $importHelper = acymailing_get('helper.import'); $importHelper->$function(); exit; } function exportError($message){ if(!acymailing_isAdmin()) die($message); acymailing_enqueueMessage($message, 'error'); if(!ACYMAILING_J40){ $menuHelper = acymailing_get('helper.acymenu'); echo '
'; echo $menuHelper->display('data'); echo '
'; } acymailing_setVar('layout', 'export'); parent::display(); if(!ACYMAILING_J40) echo '
'; return false; } function doexport(){ $assocField = 'subid'; if(!$this->isAllowed('subscriber', 'export')) return; acymailing_checkToken(); acymailing_increasePerf(); $filtersExport = acymailing_getVar('array', 'exportfilter', array(), ''); $listsToExport = acymailing_getVar('none', 'exportlists'); $fieldsToExport = acymailing_getVar('none', 'exportdata'); if(!in_array('1', array_values($fieldsToExport))) return $this->exportError('Please select at least one field to export'); $tableFields = acymailing_getColumns('#__acymailing_subscriber'); $notAllowedFields = array_diff_key($fieldsToExport, $tableFields); if(!empty($notAllowedFields)) return $this->exportError('The field '.implode(', ', array_keys($notAllowedFields)).' is not in the allowed fields: '.implode(', ', array_keys($tableFields))); $fieldsToExportList = acymailing_getVar('none', 'exportdatalist'); $notAllowedFields = array_diff(array_keys($fieldsToExportList), array('listid', 'listname')); if(!empty($notAllowedFields)) return $this->exportError('The field '.implode(', ', $notAllowedFields).' is not in the allowed fields: listid, listname'); $fieldsToExportOthers = acymailing_getVar('none', 'exportdataother'); $fieldsToExportGeoloc = acymailing_getVar('none', 'exportdatageoloc'); $tableFields = acymailing_getColumns('#__acymailing_geolocation'); $notAllowedFields = array_diff_key($fieldsToExportGeoloc, $tableFields); if(!empty($notAllowedFields)) return $this->exportError('The field '.implode(', ', array_keys($notAllowedFields)).' is not in the allowed fields: '.implode(', ', array_keys($tableFields))); $inseparator = acymailing_getVar('string', 'exportseparator'); $inseparator = str_replace(array('semicolon', 'colon', 'comma'), array(';', ',', ','), $inseparator); $exportFormat = acymailing_getVar('string', 'exportformat'); if(!in_array($inseparator, array(',', ';'))) $inseparator = ';'; $exportUnsubLists = array(); $exportWaitLists = array(); $exportLists = array(); if(!empty($filtersExport['subscribed'])){ foreach($listsToExport as $listid => $status){ if($status == -1){ $exportUnsubLists[] = (int)$listid; }elseif($status == 2) $exportWaitLists[] = (int)$listid; elseif(!empty($status)) $exportLists[] = (int)$listid; } } if(!acymailing_isAdmin() && (empty($filtersExport['subscribed']) || (empty($exportLists) && empty($exportUnsubLists) && empty($exportWaitLists)))){ $listClass = acymailing_get('class.list'); $frontLists = $listClass->getFrontendLists(); foreach($frontLists as $frontList){ $exportLists[] = (int)$frontList->listid; } } $exportFields = array(); $exportFieldsList = array(); $exportFieldsOthers = array(); $exportFieldsGeoloc = array(); foreach($fieldsToExport as $fieldName => $checked){ if(!empty($checked)) $exportFields[] = acymailing_secureField($fieldName); } foreach($fieldsToExportList as $fieldName => $checked){ if(!empty($checked)) $exportFieldsList[] = acymailing_secureField($fieldName); } if(!empty($fieldsToExportOthers)){ foreach($fieldsToExportOthers as $fieldName => $checked){ if(!empty($checked)) $exportFieldsOthers[] = acymailing_secureField($fieldName); } } if(!empty($fieldsToExportGeoloc)){ foreach($fieldsToExportGeoloc as $fieldName => $checked){ if(!empty($checked)) $exportFieldsGeoloc[] = acymailing_secureField($fieldName); } } $selectFields = 's.`'.implode('`, s.`', $exportFields).'`'; $config = acymailing_config(); $newConfig = new stdClass(); $newConfig->export_fields = implode(',', array_merge($exportFields, $exportFieldsOthers, $exportFieldsList, $exportFieldsGeoloc)); $newConfig->export_lists = implode(',', $exportLists); $newConfig->export_separator = acymailing_getVar('string', 'exportseparator'); $newConfig->export_excelsecurity = acymailing_getVar('int', 'export_excelsecurity', 0); $newConfig->export_format = $exportFormat; $filterActive = array(); foreach($filtersExport as $filterKey => $value){ if($value == 1) $filterActive[] = $filterKey; } $newConfig->export_filters = implode(',', $filterActive); $config->save($newConfig); $where = array(); if(empty($exportLists) && empty($exportUnsubLists) && empty($exportWaitLists)){ $querySelect = 'SELECT s.`subid`, '.$selectFields.' FROM '.acymailing_table('subscriber').' as s'; }else{ $querySelect = 'SELECT DISTINCT s.`subid`, '.$selectFields.' FROM '.acymailing_table('listsub').' as a JOIN '.acymailing_table('subscriber').' as s on a.subid = s.subid'; if(!empty($exportLists)) $conditions[] = 'a.status = 1 AND a.listid IN ('.implode(',', $exportLists).')'; if(!empty($exportUnsubLists)) $conditions[] = 'a.status = -1 AND a.listid IN ('.implode(',', $exportUnsubLists).')'; if(!empty($exportWaitLists)) $conditions[] = 'a.status = 2 AND a.listid IN ('.implode(',', $exportWaitLists).')'; if(count($conditions) == 1){ $where[] = $conditions[0]; }else $where[] = '('.implode(') OR (', $conditions).')'; } if(!empty($filtersExport['confirmed'])) $where[] = 's.confirmed = 1'; if(!empty($filtersExport['registered'])) $where[] = 's.userid > 0'; if(!empty($filtersExport['enabled'])) $where[] = 's.enabled = 1'; if(acymailing_getVar('int', 'sessionvalues') AND !empty($_SESSION['acymailing']['exportusers'])){ $where[] = 's.subid IN ('.implode(',', $_SESSION['acymailing']['exportusers']).')'; } if(acymailing_getVar('int', 'fieldfilters')){ foreach($_SESSION['acymailing']['fieldfilter'] as $field => $value){ $where[] = 's.'.acymailing_secureField($field).' LIKE "%'.acymailing_getEscaped($value, true).'%"'; } } $query = $querySelect; if(!empty($where)) $query .= ' WHERE ('.implode(') AND (', $where).')'; if(acymailing_getVar('int', 'sessionquery')){ $selectOthers = ''; if(!empty($exportFieldsOthers)){ foreach($exportFieldsOthers as $oneField){ $selectOthers .= ' , '.$oneField.' AS '.str_replace('.', '_', $oneField); } } acymailing_session(); $acyExportQuery = $_SESSION['acymailing']['acyexportquery']; if(strpos($acyExportQuery, 'urlclick') !== false) { $query = 'SELECT s.`subid`, '.$selectFields.$selectOthers.' '.$acyExportQuery; $assocField = ''; } else { $query = 'SELECT DISTINCT s.`subid`, '.$selectFields.$selectOthers.' '.$acyExportQuery; } } $query .= ' ORDER BY s.subid'; $encodingClass = acymailing_get('helper.encoding'); $exportHelper = acymailing_get('helper.export'); $fileName = 'export_'.date('Y-m-d'); if(!empty($exportLists) && !empty($filtersExport['subscribed'])){ $fileName = ''; $allExportedLists = acymailing_loadObjectList('SELECT name FROM #__acymailing_list WHERE listid IN ('.implode(',', $exportLists).')'); foreach($allExportedLists as $oneList){ $fileName .= '__'.$oneList->name; } $fileName = trim($fileName, '__'); } $exportHelper->addHeaders($fileName); acymailing_displayErrors(); $eol = "\r\n"; $before = '"'; $separator = '"'.$inseparator.'"'; $after = '"'; $allFields = array_merge($exportFields, $exportFieldsOthers); if(!empty($exportFieldsList)){ $allFields = array_merge($allFields, $exportFieldsList); $selectFields = 'l.`'.implode('`, l.`', $exportFieldsList).'`'; $selectFields = str_replace('listname', 'name', $selectFields); } if(!empty($exportFieldsGeoloc)){ $allFields = array_merge($allFields, $exportFieldsGeoloc); } $titleLine = $before.implode($separator, $allFields).$after.$eol; $titleLine = str_replace('listid', 'listids', $titleLine); echo $titleLine; if(acymailing_bytes(ini_get('memory_limit')) > 150000000){ $nbExport = 50000; }elseif(acymailing_bytes(ini_get('memory_limit')) > 80000000){ $nbExport = 15000; }else{ $nbExport = 5000; } if(!empty($exportFieldsList)) $nbExport = 500; $valDep = 0; $dateFields = array('created', 'confirmed_date', 'lastopen_date', 'lastclick_date', 'lastsent_date', 'userstats_opendate', 'userstats_senddate', 'urlclick_date', 'hist_date'); do{ $allData = acymailing_loadObjectList($query.' LIMIT '.$valDep.', '.$nbExport, $assocField); $valDep += $nbExport; if($allData === false){ echo $eol.$eol.'Error : '.acymailing_getDBError(); } if(empty($allData)) break; foreach($allData as $subid => &$oneUser){ if(!in_array('subid', $exportFields)) unset($allData[$subid]->subid); foreach($dateFields as &$fieldName){ if(isset($allData[$subid]->$fieldName)) $allData[$subid]->$fieldName = acymailing_getDate($allData[$subid]->$fieldName, '%Y-%m-%d %H:%M:%S'); } } if(!empty($exportFieldsList) && !empty($allData)){ $queryList = 'SELECT '.$selectFields.', s.subid FROM #__acymailing_subscriber AS s LEFT JOIN #__acymailing_listsub AS ls ON ls.subid = s.subid AND ls.status = 1 '; if(!empty($exportLists)) $queryList .= 'AND ls.listid IN ('.implode(',', $exportLists).') '; $queryList .= 'LEFT JOIN #__acymailing_list AS l ON ls.listid = l.listid WHERE s.subid IN ('.implode(',', array_keys($allData)).')'; $resList = acymailing_loadObjectList($queryList); foreach($resList as &$listsub){ if(in_array('listid', $exportFieldsList)) $allData[$listsub->subid]->listid = empty($allData[$listsub->subid]->listid) ? $listsub->listid : $allData[$listsub->subid]->listid.' - '.$listsub->listid; if(in_array('listname', $exportFieldsList)) $allData[$listsub->subid]->listname = empty($allData[$listsub->subid]->listname) ? $listsub->name : $allData[$listsub->subid]->listname.' - '.$listsub->name; } unset($resList); } if(!empty($exportFieldsGeoloc) && !empty($allData)){ $orderGeoloc = acymailing_getVar('cmd', 'exportgeolocorder'); if(strtolower($orderGeoloc) !== 'desc') $orderGeoloc = 'asc'; $resGeol = acymailing_loadObjectList('SELECT geolocation_subid,'.implode(', ', $exportFieldsGeoloc).' FROM (SELECT * FROM #__acymailing_geolocation WHERE geolocation_subid IN ('.implode(',', array_keys($allData)).') ORDER BY geolocation_id '.$orderGeoloc.') as geoloc GROUP BY geolocation_subid', 'geolocation_subid'); foreach($allData as $subid => $oneSubscriber){ foreach($exportFieldsGeoloc as $geolField){ $value = empty($resGeol[$subid]) ? '' : $resGeol[$subid]->$geolField; $allData[$subid]->$geolField = ($geolField == 'geolocation_created' ? acymailing_getDate($value, '%Y-%m-%d %H:%M:%S') : $value); } } unset($resGeol); } foreach($allData as $subid => &$oneUser){ $data = get_object_vars($oneUser); if($newConfig->export_excelsecurity == 1){ foreach ($data as &$oneData){ $firstcharacter = substr($oneData, 0, 1); if(in_array($firstcharacter, array('=', '+', '-', '@'))){ $oneData = ' '.$oneData; } } } $dataexport = implode($separator, $data); echo $before.$encodingClass->change($dataexport, 'UTF-8', $exportFormat).$after.$eol; } unset($allData); }while(true); exit; } } PK8!]I6 cpanel.phpnu&1i. * */ // No direct access defined('_JEXEC') or die; jimport('joomla.application.component.controllerform'); class DJImageSliderControllerCPanel extends JControllerLegacy { function __construct($config = array()) { parent::__construct($config); } } ?>PK8!]?chooselist.phpnu&1isetTitle(acymailing_translation('BOUNCE_HANDLING'), 'bounces'); $acyToolbar->help('bounce'); $acyToolbar->display(); $config = acymailing_config(); $level = $config->get('level'); $url = ACYMAILING_HELPURL.'bounce-paidversion&utm_source=acymailing-'.$level.'&utm_medium=back-end&utm_content=bounces-display&utm_campaign=upgrade'; $iFrame = ""; echo $iFrame.'
'; return; } return parent::listing(); } } PK8!]Mlist.phpnu&1iisAllowed($this->aclCat, 'manage')) return; acymailing_checkToken(); $listClass = acymailing_get('class.list'); $status = $listClass->saveForm(); if($status){ acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'), 'message'); if($listClass->newlist && acymailing_isAdmin()){ $listid = acymailing_getVar('int', 'listid'); acymailing_enqueueMessage(''.acymailing_translation_sprintf('SUBSCRIBE_LIST').'', 'message'); } }else{ acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error'); if(!empty($listClass->errors)){ foreach($listClass->errors as $oneError){ acymailing_enqueueMessage($oneError, 'error'); } } } } function remove(){ if(!$this->isAllowed($this->aclCat, 'delete')) return; acymailing_checkToken(); $listIds = acymailing_getVar('array', 'cid', array(), ''); $listClass = acymailing_get('class.list'); $num = $listClass->delete($listIds); acymailing_enqueueMessage(acymailing_translation_sprintf('SUCC_DELETE_ELEMENTS', $num), 'message'); acymailing_setVar('layout', 'listing'); return parent::display(); } } PK8!],v dashboard.phpnu&1iregisterTask('listing', 'display'); $this->registerDefaultTask('listing'); } function display($cachable = false, $urlparams = false){ if(!empty($this->aclCat) AND !$this->isAllowed($this->aclCat, 'manage')) return; return parent::display($cachable, $urlparams); } } PK8!])3z\\send.phpnu&1iisAllowed('newsletters', 'send')) return; acymailing_setVar('layout', 'sendconfirm'); return parent::display(); } function send(){ if(!$this->isAllowed('newsletters', 'send')) return; acymailing_checkToken(); acymailing_setNoTemplate(); $mailid = acymailing_getCID('mailid'); if(empty($mailid)) exit; $time = time(); $queueClass = acymailing_get('class.queue'); $queueClass->onlynew = acymailing_getVar('int', 'onlynew'); $queueClass->mindelay = acymailing_getVar('int', 'mindelay'); $totalSub = $queueClass->queue($mailid, $time); if(empty($totalSub)){ acymailing_display(acymailing_translation('NO_RECEIVER'), 'warning'); return; } $mailObject = new stdClass(); $mailObject->senddate = $time; $mailObject->published = 1; $mailObject->mailid = $mailid; $mailObject->sentby = acymailing_currentUserId(); acymailing_updateObject(acymailing_table('mail'), $mailObject, 'mailid'); $config = acymailing_config(); $queueType = $config->get('queue_type'); if($queueType == 'onlyauto'){ $messages = array(); $messages[] = acymailing_translation_sprintf('ADDED_QUEUE', $totalSub); $messages[] = acymailing_translation('AUTOSEND_CONFIRMATION'); acymailing_display($messages, 'success'); return; }else{ acymailing_setVar('totalsend', $totalSub); acymailing_redirect(acymailing_completeLink('send&task=continuesend&mailid='.$mailid.'&totalsend='.$totalSub, true, true)); exit; } } function continuesend(){ $config = acymailing_config(); if(acymailing_level(1) && $config->get('queue_type') == 'onlyauto'){ acymailing_setNoTemplate(); acymailing_display(acymailing_translation('ACY_ONLYAUTOPROCESS'), 'warning'); return; } $newcrontime = time() + 120; if($config->get('cron_next') < $newcrontime){ $newValue = new stdClass(); $newValue->cron_next = $newcrontime; $config->save($newValue); } $mailid = acymailing_getCID('mailid'); $totalSend = acymailing_getVar('int', 'totalsend', 0, ''); $alreadySent = acymailing_getVar('int', 'alreadysent', 0, ''); $helperQueue = acymailing_get('helper.queue'); $helperQueue->mailid = $mailid; $helperQueue->report = true; $helperQueue->total = $totalSend; $helperQueue->start = $alreadySent; $helperQueue->pause = $config->get('queue_pause'); $helperQueue->process(); acymailing_setNoTemplate(); } function spamtest(){ $mailid = acymailing_getVar('int', 'mailid'); if(empty($mailid)) return; $config = acymailing_config(); ob_start(); $urlSite = trim(base64_encode(preg_replace('#https?://(www\.)?#i', '', ACYMAILING_LIVE)), '=/'); $url = ACYMAILING_SPAMURL.'spamTestSystem&component=acymailing&level='.strtolower($config->get('level', 'starter')).'&urlsite='.$urlSite; $spamtestSystem = acymailing_fileGetContent($url, 30); $warnings = ob_get_clean(); if(empty($spamtestSystem) || $spamtestSystem === false || !empty($warnings)){ acymailing_display('Could not load your information from our server'.((!empty($warnings) && acymailing_isDebug()) ? $warnings : ''), 'error'); return; } $decodedInformation = json_decode($spamtestSystem, true); if(!empty($decodedInformation['messages']) || !empty($decodedInformation['error'])){ $msgError = (!empty($decodedInformation['messages'])) ? $decodedInformation['messages'].'
' : ''; $msgError .= (!empty($decodedInformation['error'])) ? $decodedInformation['error'] : ''; acymailing_display($msgError, 'error'); return; } if(empty($decodedInformation['email'])){ acymailing_display('Missing test mail address', 'error'); return; } $receiver = new stdClass(); $receiver->subid = 0; $receiver->email = $decodedInformation['email']; $receiver->name = $decodedInformation['name']; $receiver->html = 1; $receiver->confirmed = 1; $receiver->enabled = 1; $mailerHelper = acymailing_get('helper.mailer'); $mailerHelper->checkConfirmField = false; $mailerHelper->checkEnabled = false; $mailerHelper->checkPublished = false; $mailerHelper->checkAccept = false; $mailerHelper->loadedToSend = true; $mailerHelper->report = false; if(!$mailerHelper->sendOne($mailid, $receiver)){ acymailing_display($mailerHelper->reportMessage, 'error'); return; } acymailing_redirect($decodedInformation['displayURL']); return; } } PK8!] Hnotification.phpnu&1iisAllowed($this->aclCat, 'manage')) return; $this->store(); return $this->edit(); } function copy(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_checkToken(); $cids = acymailing_getVar('array', 'cid', array(), ''); $time = time(); $creatorId = intval(acymailing_currentUserId()); $addSendDate = ''; if(!empty($this->copySendDate)) $addSendDate = ', `senddate`'; foreach($cids as $oneMailid){ $query = 'INSERT INTO `#__acymailing_mail` (`subject`, `body`, `altbody`, `published`'.$addSendDate.', `created`, `fromname`, `fromemail`, `replyname`, `replyemail`, `bccaddresses`, `type`, `visible`, `userid`, `alias`, `attach`, `html`, `tempid`, `key`, `frequency`, `params`,`filter`,`metakey`,`metadesc`)'; $query .= " SELECT CONCAT('copy_',`subject`), `body`, `altbody`, 0".$addSendDate.", '.$time.', `fromname`, `fromemail`, `replyname`, `replyemail`, `bccaddresses`, `type`, `visible`, '.$creatorId.', `alias`, `attach`, `html`, `tempid`, ".acymailing_escapeDB(acymailing_generateKey(8)).', `frequency`, `params`,`filter`,`metakey`,`metadesc` FROM `#__acymailing_mail` WHERE `mailid` = '.(int)$oneMailid; acymailing_query($query); $newMailid = acymailing_insertID(); acymailing_query('INSERT IGNORE INTO `#__acymailing_listmail` (`listid`,`mailid`) SELECT `listid`,'.$newMailid.' FROM `#__acymailing_listmail` WHERE `mailid` = '.(int)$oneMailid); acymailing_query('INSERT IGNORE INTO `#__acymailing_tagmail` (`tagid`,`mailid`) SELECT `tagid`,'.$newMailid.' FROM `#__acymailing_tagmail` WHERE `mailid` = '.(int)$oneMailid); } return $this->listing(); } function store(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_checkToken(); header('X-XSS-Protection:0'); $mailClass = acymailing_get('class.mail'); $status = $mailClass->saveForm(); if($status){ acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'), 'message'); }else{ acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error'); if(!empty($mailClass->errors)){ foreach($mailClass->errors as $oneError){ acymailing_enqueueMessage($oneError, 'error'); } } } } function unschedule(){ if(!$this->isAllowed($this->aclCat, 'schedule')) return; acymailing_checkToken(); $mailid = acymailing_getCID('mailid'); if(empty($mailid)) die('Missing mail ID'); $mail = new stdClass(); $mail->mailid = $mailid; $mail->senddate = 0; $mail->published = 0; $mailClass = acymailing_get('class.mail'); $mailClass->save($mail); acymailing_enqueueMessage(acymailing_translation('SUCC_UNSCHED')); return $this->preview(); } function remove(){ if(!$this->isAllowed($this->aclCat, 'delete')) return; acymailing_checkToken(); $cids = acymailing_getVar('array', 'cid', array(), ''); $class = acymailing_get('class.mail'); $num = $class->delete($cids); acymailing_arrayToInteger($cids); acymailing_query('DELETE FROM `#__acymailing_listmail` WHERE `mailid` IN ('.implode(',', $cids).')'); acymailing_enqueueMessage(acymailing_translation_sprintf('SUCC_DELETE_ELEMENTS', $num), 'message'); return $this->listing(); } function savepreview(){ $this->store(); return $this->preview(); } function saveastmpl(){ $this->store(); $mailclass = acymailing_get('class.mail'); $mailclass->saveastmpl(); return $this->edit(); } function preview(){ acymailing_setVar('layout', 'preview'); return parent::display(); } function sendtest(){ $this->_sendtest(); return $this->preview(); } function _sendtest(){ acymailing_checkToken(); $mailid = acymailing_getCID('mailid'); $test_selection = acymailing_getVar('string', 'test_selection', '', ''); if(empty($mailid) OR empty($test_selection)) return false; $mailer = acymailing_get('helper.mailer'); $mailer->forceVersion = acymailing_getVar('int', 'test_html', 1, ''); $mailer->autoAddUser = true; if(acymailing_isAdmin()) $mailer->SMTPDebug = 1; $mailer->checkConfirmField = false; $comment = acymailing_getVar('string', 'commentTest', ''); if(!empty($comment)) $mailer->introtext = '
'.nl2br($comment).'
'; $receivers = array(); if($test_selection == 'users'){ $receiverEntry = acymailing_getVar('string', 'test_emails', '', ''); if(!empty($receiverEntry)){ if(substr_count($receiverEntry, '@') > 1){ $receivers = explode(',', trim(preg_replace('# +#', '', $receiverEntry))); }else{ $receivers[] = trim($receiverEntry); } } }else{ $gid = acymailing_getVar('int', 'test_group', '-1'); if($gid == -1) return false; if(!ACYMAILING_J16){ $receivers = acymailing_loadResultArray('SELECT '.$this->cmsUserVars->email.' AS email FROM '.acymailing_table($this->cmsUserVars->table, false).' WHERE gid = '.intval($gid)); }else{ $receivers = acymailing_loadResultArray('SELECT u.'.$this->cmsUserVars->email.' AS email FROM '.acymailing_table($this->cmsUserVars->table, false).' AS u JOIN '.acymailing_table('user_usergroup_map', false).' AS ugm ON u.'.$this->cmsUserVars->id.' = ugm.user_id WHERE ugm.group_id = '.intval($gid)); } } if(empty($receivers)){ acymailing_enqueueMessage(acymailing_translation('NO_SUBSCRIBER'), 'notice'); return false; } $result = true; foreach($receivers as $receiver){ $result = $mailer->sendOne($mailid, $receiver) && $result; } return $result; } function upload(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_setVar('layout', 'upload'); return parent::display(); } function abtesting(){ acymailing_setVar('layout', 'abtesting'); return parent::display(); } function abtest(){ $nbTotalReceivers = acymailing_getVar('int', 'nbTotalReceivers'); $mailids = acymailing_getVar('string', 'mailid'); $mailsArray = explode(',', $mailids); acymailing_arrayToInteger($mailsArray); $abTesting_prct = acymailing_getVar('int', 'abTesting_prct'); $abTesting_delay = acymailing_getVar('int', 'abTesting_delay'); $abTesting_action = acymailing_getVar('string', 'abTesting_action'); if(empty($abTesting_prct)){ acymailing_display(acymailing_translation('ABTESTING_NEEDVALUE'), 'warning'); $this->abtesting(); return; } $newAbTestDetail = array(); $newAbTestDetail['mailids'] = implode(',', $mailsArray); $newAbTestDetail['prct'] = (!empty($abTesting_prct) ? $abTesting_prct : ''); $newAbTestDetail['delay'] = (isset($abTesting_delay) && strlen($abTesting_delay) > 0 ? $abTesting_delay : '2'); $newAbTestDetail['action'] = (!empty($abTesting_action) ? $abTesting_action : 'manual'); $newAbTestDetail['time'] = time(); $newAbTestDetail['status'] = 'inProgress'; $mailClass = acymailing_get('class.mail'); $nbReceiversTest = $mailClass->ab_test($newAbTestDetail, $mailsArray, $nbTotalReceivers); acymailing_enqueueMessage(acymailing_translation_sprintf('ABTESTING_SUCCESSADD', $nbReceiversTest), 'info'); acymailing_setVar('validationStatus', 'abTestAdd'); $this->abtesting(); } function complete_abtest(){ $mailid = acymailing_getVar('int', 'mailToSend'); $mailClass = acymailing_get('class.mail'); $newMailid = $mailClass->complete_abtest('manual', $mailid); $finalMail = $mailClass->get($newMailid); acymailing_enqueueMessage(acymailing_translation_sprintf('ABTESTING_FINALSEND', $finalMail->subject), 'info'); acymailing_setVar('validationStatus', 'abTestFinalSend'); $this->abtesting(); } function douploadnewsletter(){ if(!$this->isAllowed($this->aclCat, 'manage')) return; acymailing_checkToken(); $templateClass = acymailing_get('class.template'); $templateClass->checkAreas = false; $statusUpload = $templateClass->doupload(); if($statusUpload){ $mailClass = acymailing_get('class.mail'); $mail = new stdClass(); $newTemplate = $templateClass->get($templateClass->templateId); $mail->subject = $newTemplate->name; $mail->body = $newTemplate->body; $mail->tempid = $templateClass->templateId; $idMailCreated = $mailClass->save($mail); if($idMailCreated){ acymailing_enqueueMessage(acymailing_translation('NEWSLETTER_INSTALLED'), 'success'); acymailing_setNoTemplate(false); $js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = '".acymailing_completeLink('newsletter&task=edit&mailid='.$idMailCreated, false, true)."'; }"; acymailing_addScript(true, $js); return; }else{ acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error'); return $this->upload(); } }else{ return $this->upload(); } } function cancelNewsletter(){ $queueController = acymailing_get('controller.queue'); $queueController->cancelNewsletter(); return $this->listing(); } function checkifedited(){ if(empty($_SESSION['timeOnModification'])) exit; $mailClass = acymailing_get('class.mail'); $mailId = acymailing_getVar('int', 'mailId'); $mail = $mailClass->get($mailId); if(!empty($mail->lastupdate) && $_SESSION['timeOnModification'] < $mail->lastupdate){ $userId = acymailing_loadResult('SELECT userlastupdate FROM #__acymailing_mail WHERE mailid = '.intval($mailId)); echo $userId.'|'.acymailing_currentUserName($userId); } exit; } function cancel(){ header('X-XSS-Protection:0'); return $this->listing(); } } PK8!]:ll editor.phpnu&1iregisterDefaultTask('browse'); } function browse(){ $this->_setCss(); $this->_setJs(); $this->_displayHTML(); } private function _setCss(){ if(acymailing_getVar('none', 'inpopup', '') == 'true'){ $height_acy_media_browser_table = 420; $height_acy_media_browser_list = 310; $width_acy_media_browser_actions = 393; $width_acy_media_browser_hidden_elements = 395; $height_acy_media_browser_image_details = 415; $width_acy_media_browser_buttons_block = 365; $width_acy_media_browser_url_input = 60; }else{ $height_acy_media_browser_table = 540; $height_acy_media_browser_list = 450; $width_acy_media_browser_actions = 522; $width_acy_media_browser_hidden_elements = 522; $height_acy_media_browser_image_details = 550; $width_acy_media_browser_buttons_block = 492; $width_acy_media_browser_url_input = 70; } $css = " #import_from_url, #upload_image { display: none; } #acy_media_browser_hidden_elements, #acy_media_browser_buttons_block, #acy_media_browser_buttons_block { transition: all 0.3s ease; } #acy_media_browser_table{ height:".$height_acy_media_browser_table."px; width:100%; margin: 0px; border: 1px solid rgb(233, 233, 233); box-shadow: 4px 4px 4px -4px rgba(0, 0, 0, 0.1); } #acy_media_browser_path_dropdown{ float:left; margin-left:15px; margin-top:15px; width:60%; } #acy_media_browser_global_create_folder{ width:28%; float:right; margin-top:15px; margin-right:10px; } #acy_media_browser_create_folder{ width:100%; } #create_folder_btn{ margin-top:0px; } #acy_media_browser_area_create_folder{ position:absolute; z-index:10; margin-top:5px; border:1px solid #e9e9e9; height:0px; width:150px; background-color:#f6f6f6; } #subFolderName{ width:80%; margin-left:7px; margin-top:5px; } #acy_media_browser_area_create_folder .btn{ float:right; margin-right:5px } #acy_media_browser_message{ height:450px; overflow:auto; margin:0px; padding:5px; border-bottom: 1px solid rgb(233, 233, 233); } #acy_media_browser_list{ height:".$height_acy_media_browser_list."px; overflow-x:hidden; margin:0px; padding:0px; border-bottom: 1px solid rgb(233, 233, 233); } .acy_media_browser_image_size{ color: #AAAAAA; } #acy_media_browser_actions{ text-align:center; box-shadow: 0px -4px 4px -4px rgba(0, 0, 0, 0.3); width:".$width_acy_media_browser_actions."px; overflow:hidden; height: 100px; } #acy_media_browser_containing_block{ height: 70px; width:522px; } #acy_media_browser_buttons_block{ padding:22px 15px 0px; width: ".$width_acy_media_browser_buttons_block."px; float:left; display:inline-block; } #acy_media_browser_hidden_elements{ width:".$width_acy_media_browser_hidden_elements."px; } #acy_media_browser_url_input{ width:".$width_acy_media_browser_url_input."%; margin:0px; } #acy_media_browser_insert_message{ margin-top:5px; } #acy_media_browser_image_details_row{ width:35%; vertical-align:top; background-color: rgb(246, 246, 246); border: 1px solid rgb(233, 233, 233); font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px; color: rgb(102, 102, 102); } #acy_media_browser_image_details{ position: relative; width: 85%; overflow-x:hidden; height: ".$height_acy_media_browser_image_details."px; padding: 15px; } #acy_media_browser_image_selected_info{ width:230px; float:left; margin-bottom:10px; } #acy_media_browser_image_selected_details label{ font-weight: bold; } #acy_media_browser_image_selected_details input { margin-bottom: 7px; } #acy_media_browser_image_selected_details select { margin-bottom: 7px; } .alert{ padding: 8px 35px 8px 14px; margin-bottom: 18px; text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5); background-color: rgb(252, 248, 227); border: 1px solid rgb(251, 238, 213); border-radius: 4px; } .alert-error{ background-color: rgb(242, 222, 222); border-color: rgb(238, 211, 215); color: rgb(185, 74, 72); } .alert-success { background-color: rgb(223, 240, 216); border-color: rgb(214, 233, 198); color: rgb(70, 136, 71); } li.acy_media_browser_images {position: relative; height: 135px; width:135px; display:inline-block; margin:14px; margin-top:7px; text-align:center; border: 1px solid #eee;} .acy_media_browser_images img{max-height:135px; width:auto; max-width:135px; vertical-align:top;} .acy_media_browser_images img.acy_media_browser_delete{height:24px; width:24px; vertical-align:top; position:absolute; right:0px; top:0px; z-index:990; cursor: pointer;} #acy_media_browser_list .acy_media_browser_image_size{color: #666; text-shadow:1px 1px 1px #ffffff; font-weight:normal} #confirmBoxMM{ width: 370px; background: rgba(255, 255, 255, 0.8); border: 1px solid #d6d6d6; padding: 5px; border-radius: 5px; box-shadow: 1px 1px 5px #dddddd; -moz-box-shadow: 1px 1px 5px #dddddd; -webkit-box-shadow: 1px 1px 5px #dddddd; position: absolute; left: 234px; top: 150px; z-index: 999; } #acy_popup_content{ background-color: #fff; padding: 20px; text-align: center; color: #706f6f; } .acy_folder_name{ color: #5e93c0 } "; if(!ACYMAILING_J30){ $css = $css."#acy_media_browser_area_create_folder .btn{ margin-top:30px; margin-right:20px; } #subFolderName{ margin-left:13px; } "; } echo ''; } private function _setJs(){ $websiteurl = rtrim(acymailing_rootURI(), '/').'/'; acymailing_addScript(false, $websiteurl.ACYMAILING_MEDIA_FOLDER.'/js/jquery/jquery-1.9.1.min.js?v='.@filemtime(ACYMAILING_ROOT.str_replace('/', DS, ACYMAILING_MEDIA_FOLDER).DS.'js'.DS.'jquery'.DS.'jquery-1.9.1.min.js')); $imageZone = acymailing_getVar('array', 'image_zone', array(), ''); if(empty($imageZone)){ $getAdditionalTags = " var selectedImageWidth = document.getElementById('acy_media_browser_image_width').value; var selectedImageHeight = document.getElementById('acy_media_browser_image_height').value; var selectedImageAlign = document.getElementById('acy_media_browser_image_align').value; var selectedImageBorder = document.getElementById('acy_media_browser_image_border').value; var selectedImageMargin = document.getElementById('acy_media_browser_image_margin').value; var width = ''; var height =''; var align=''; var border = ''; var margin = ''; if(selectedImageWidth>0) width = ' width:' + selectedImageWidth + 'px; '; if(selectedImageHeight>0) height = ' height:' + selectedImageHeight + 'px; '; if(selectedImageAlign) align = 'float:' + selectedImageAlign + ';'; if(selectedImageWidth>0 && selectedImageAlign.trim()=='center') align = 'margin:auto;'; if(selectedImageBorder) border = ' border:' + selectedImageBorder + '; '; if(selectedImageBorder>0 ) border = ' border: solid ' + selectedImageBorder + 'px; '; if(selectedImageMargin>0) margin = ' margin:' + selectedImageMargin + 'px; '; else if(selectedImageMargin) margin = ' margin:' + selectedImageMargin + '; '; var imgSize = ' height =\"' + selectedImageHeight + '\" width = \"' + selectedImageWidth + '\"'; "; $sizeAndAlignTags = " style=\"' + height + width + align + border + margin +'\" "; $insertImage = "window.parent.insertImageTag(tag, previousSelection);"; }else{ $getAdditionalTags = "var selectedImageRef = document.getElementById('acy_media_browser_image_target').value; "; $sizeAndAlignTags = ""; $insertImage = "window.parent.jInsertEditorText(tag, this.editor);"; } if(acymailing_getVar('none', 'inpopup', '') == 'true'){ $imgMaxHeight = 150; $slideValue = -395; }else{ $imgMaxHeight = 190; $slideValue = -522; } $js = " var previousSelection = window.parent.getPreviousSelection(); function checkSelected(imageZone) { if(imageZone){ var editor = window.parent.CKEDITOR.editor; o = this._getUriObject(window.self.location.href); q = this._getQueryObject(o.query); zone = decodeURIComponent(q.e_name); var html = window.parent.getSelectedHTML(zone); var parsedSelection = jQuery.parseHTML(html); if(!parsedSelection) return false; if(parsedSelection[0].tagName == 'A'){ var parsedImage = jQuery.parseHTML(parsedSelection[0].innerHTML); parsedImage = parsedImage[0]; if(parsedSelection[0].href) document.getElementById('acy_media_browser_image_target').value = parsedSelection[0].href; }else if(parsedSelection[0].tagName == 'IMG'){ var parsedImage = parsedSelection[0]; } if(!parsedImage) return false; var name = parsedImage.src.substr(parsedImage.src.lastIndexOf('/') + 1); if(parsedImage.src.substring(0,4)=='http'){ var imageUrl = parsedImage.src; }else{ var imageUrl = '".ACYMAILING_LIVE."' + parsedImage.src; } var width = parsedImage.width; var height = parsedImage.height; displayImageFromUrl(imageUrl, 'success', name, width, height); if(parsedImage.alt) document.getElementById('acy_media_browser_image_title').value = parsedImage.alt; }else{ var editor = window.parent.editor; var sel = editor.getSelection(); var ranges = sel.getRanges(); var el = new window.parent.CKEDITOR.dom.element('div'); for (var i = 0, len = ranges.length; i < len; ++i) { el.append(ranges[i].cloneContents()); } if(el.getFirst() && el.getFirst().getName() == 'a'){ var selection = el.getFirst().getHtml(); var selectedImageRef = el.getFirst().getAttribute('href'); } else{ var selection = el.getHtml(); } var parsedSelection = jQuery.parseHTML(selection); if(!parsedSelection) return false; if(parsedSelection[0].tagName == 'IMG'){ var name = parsedSelection[0].src.substr(parsedSelection[0].src.lastIndexOf('/') + 1); var width = parsedSelection[0].width; var height = parsedSelection[0].height; if($(selection).attr('src').substring(0,4) == 'http'){ var imageUrl = $(selection).attr('src'); }else{ var imageUrl = '".ACYMAILING_LIVE."' + $(selection).attr('src'); } displayImageFromUrl(imageUrl, 'success', name, width, height); if(parsedSelection[0].alt) document.getElementById('acy_media_browser_image_title').value = parsedSelection[0].alt; if(parsedSelection[0].style.width) document.getElementById('acy_media_browser_image_width').value = parsedSelection[0].style.width.slice(0,-2); if(parsedSelection[0].style.height) document.getElementById('acy_media_browser_image_height').value = parsedSelection[0].style.height.slice(0,-2); if(parsedSelection[0].style.cssFloat) document.getElementById('acy_media_browser_image_align').value = parsedSelection[0].style.cssFloat; if(parsedSelection[0].style.margin) document.getElementById('acy_media_browser_image_margin').value = parsedSelection[0].style.margin; if(parsedSelection[0].style.border) document.getElementById('acy_media_browser_image_border').value = parsedSelection[0].style.border; if(parsedSelection[0].className) document.getElementById('acy_media_browser_image_class').value = parsedSelection[0].className; if(selectedImageRef) document.getElementById('acy_media_browser_image_linkhref').value = selectedImageRef; } } } function removeAllListener(el) { var elClone = el.cloneNode(true); el.parentNode.replaceChild(elClone, el); return elClone; } function addResizeDragListener(src) { var elements = document.getElementsByClassName('drag-resize'); for(var i = 0; i < elements.length; i++) { var element = elements[i]; element = removeAllListener(element); if(navigator.userAgent.indexOf('Firefox') > 0) { var currentlyDrag = false; element.addEventListener('mousedown', function(event) { currentlyDrag = true; }); element.addEventListener('mousemove', function(event) { if(!currentlyDrag) return; var scaleValue = event.offsetX; if(scaleValue < 0) return false; preloadCanvas(src, scaleValue+50); }); document.addEventListener('mouseup', function(event) { currentlyDrag = false; }); }else{ element.addEventListener('drag', function(event) { var scaleValue = event.offsetX; if(scaleValue < 0) return false; preloadCanvas(src, scaleValue); }); element.addEventListener('dragstart', function(event) { if(typeof event.dataTransfer.setDragImage === 'function'){ var dragIcon = document.createElement('img'); event.dataTransfer.setDragImage(dragIcon, 0, 0); } }); } } } function addCropDragListener(src) { var elements = document.getElementsByClassName('drag-resize'); for(var i = 0; i < elements.length; i++) { var element = elements[i]; element = removeAllListener(element); if(navigator.userAgent.indexOf('Firefox') > 0) { var currentlyCrop = false; element.addEventListener('mousedown', function(event) { currentlyCrop = true; var coords = {x: event.offsetX, y: event.offsetY, screenX: event.screenX, screenY: event.screenY}; this.setAttribute('initial-click', JSON.stringify(coords)); }); element.addEventListener('mousemove', function(event) { if(!currentlyCrop) return; var coords = JSON.parse(this.getAttribute('initial-click')); var width = (event.screenX - coords.screenX); var height = (event.screenY - coords.screenY); drawRectangle(src, coords.x, coords.y, width, height); }); document.addEventListener('mouseup', function(event) { if(!currentlyCrop) return; currentlyCrop = false; var coords = JSON.parse(element.getAttribute('initial-click')); element.removeAttribute('initial-click'); var width = (event.screenX - coords.screenX); var height = (event.screenY - coords.screenY); if(width < 0) { width = Math.abs(width); coords.x = coords.x - width; } if (height < 0) { height = Math.abs(height); coords.y = coords.y - height; } cropImage(src, coords.x, coords.y, width, height) }); }else{ element.addEventListener('dragend', function(event) { var coords = JSON.parse(this.getAttribute('initial-click')); this.removeAttribute('initial-click'); var width = (event.screenX - coords.screenX); var height = (event.screenY - coords.screenY); if(width < 0) { width = Math.abs(width); coords.x = coords.x - width; } if (height < 0) { height = Math.abs(height); coords.y = coords.y - height; } cropImage(src, coords.x, coords.y, width, height) }); element.addEventListener('dragstart', function(event) { var coords = {x: event.offsetX, y: event.offsetY, screenX: event.screenX, screenY: event.screenY}; this.setAttribute('initial-click', JSON.stringify(coords)); if(typeof event.dataTransfer.setDragImage === 'function'){ var dragIcon = document.createElement('img'); event.dataTransfer.setDragImage(dragIcon, 0, 0); } }); element.addEventListener('drag', function(event) { var coords = JSON.parse(this.getAttribute('initial-click')); var width = (event.screenX - coords.screenX); var height = (event.screenY - coords.screenY); drawRectangle(src, coords.x, coords.y, width, height); }); } } } function roundedCorner() { var selectedImage = document.getElementById('acy_media_browser_selected_image'); if(typeof selectedImage == 'undefined') return false; var canvas = document.getElementById('edition-canvas'); var ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); var image = new Image(); image.src = selectedImage.src; canvas.width = image.width; canvas.height = image.height; image.onload = function(event) { var radius = document.getElementById('radius-image').value; roundedRectangle(0, 0, this.width, this.height, radius, ctx); ctx.clip(); ctx.drawImage(this, 0, 0, this.width, this.height); } } function roundedRectangle(x, y, width, height, radius, ctx) { ctx.beginPath(); ctx.moveTo(x + radius, y); ctx.lineTo(x + width - radius, y); ctx.quadraticCurveTo(x + width, y, x + width, y + radius); ctx.lineTo(x + width, y + height - radius); ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height); ctx.lineTo(x + radius, y + height); ctx.quadraticCurveTo(x, y + height, x, y + height - radius); ctx.lineTo(x, y + radius); ctx.quadraticCurveTo(x, y, x + radius, y); ctx.closePath(); } function cancelModification() { var selectedImage = document.getElementById('acy_media_browser_selected_image'); var imageWidth = document.getElementById('acy_media_browser_image_width').value; if(typeof selectedImage == 'undefined') return false; preloadCanvas(selectedImage.src, imageWidth); } function changeToCrop() { var selectedImage = document.getElementById('acy_media_browser_selected_image'); var imageWidth = document.getElementById('acy_media_browser_image_width').value; if(typeof selectedImage == 'undefined') return false; addCropDragListener(selectedImage.src); preloadCanvas(selectedImage.src, imageWidth); } function changeToScale() { var selectedImage = document.getElementById('acy_media_browser_selected_image'); var imageWidth = document.getElementById('acy_media_browser_image_width').value; if(typeof selectedImage == 'undefined') return false; addResizeDragListener(selectedImage.src); preloadCanvas(selectedImage.src, imageWidth); } function validateImageModification() { var canvas = document.getElementById('edition-canvas'); var dataURL = canvas.toDataURL('image/png'); document.getElementById('imagedata').value = dataURL; var form = document.getElementById('form-edition'); var queryString = form.action; var dataString = form.toQueryString(); var xhr = new XMLHttpRequest(); xhr.open('POST', queryString); xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\"); xhr.onload = function(){ closePanel(); window.location.href = window.location.href; }; xhr.send(dataString); return false; } function closePanel() { document.getElementById('image-edition').classList.add('hidden-edition'); } function drawRectangle(src, sx, sy, sw, sh) { var canvas = document.createElement('canvas'); canvas.id = 'edition-canvas'; var machin = document.getElementById('edition-canvas'); var parent = machin.parentElement; parent.removeChild(machin); parent.appendChild(canvas); canvas = document.getElementById('edition-canvas'); var ctx = canvas.getContext('2d'); var image = new Image(); image.src = src; canvas.width = image.width; canvas.height = image.height; ctx.drawImage(image, 0, 0, image.width, image.height); ctx.rect(sx, sy, sw, sh); ctx.strokeStyle='red'; ctx.stroke(); } function cropImage(src, sx, sy, sw, sh) { var canvas = document.getElementById('edition-canvas'); var ctx = canvas.getContext('2d'); var image = new Image(); image.src = src; ctx.clearRect(0, 0, canvas.width, canvas.height); canvas.width = sw; canvas.height = sh; ctx.drawImage(image, sx, sy, sw, sh, 0, 0, sw, sh); } function preloadCanvas(src, width) { var canvas = document.getElementById('edition-canvas'); var ctx = canvas.getContext('2d'); var image = new Image(); image.src = src; ctx.clearRect(0, 0, canvas.width, canvas.height); var ratio = image.width / image.height; canvas.width = width; canvas.height = (width / ratio); ctx.drawImage(image, 0, 0, width, (width / ratio)); } function displayImageEdition() { var selectedImage = document.getElementById('acy_media_browser_selected_image'); var imageWidth = document.getElementById('acy_media_browser_image_width').value; if(selectedImage == null) return false; addResizeDragListener(selectedImage.src); preloadCanvas(selectedImage.src, imageWidth); document.getElementById('pathtosave').value = document.getElementById('currentPath').value; document.getElementById('image-edition').classList.toggle('hidden-edition'); } function displayImageFromUrl(url, result, name, width, height, fromUrl){ if(result=='success'){ var infos = '
'; document.getElementById('acy_media_browser_image_selected').innerHTML=''+infos; document.getElementById('acy_media_browser_image_selected').style.display=\"\"; if(!name){ var name = url.substr(url.lastIndexOf('/') + 1); } if(width){ document.getElementById('acy_media_browser_image_selected_info').innerHTML='
'+name+'
'+width+'x'+height+'
'; var widthField = document.getElementById('acy_media_browser_image_width'); var heightField = document.getElementById('acy_media_browser_image_height'); if(widthField) widthField.value = width; if(heightField) heightField.value = height; } document.getElementById('acy_media_browser_image_selected_info').style.display=\"\"; if(fromUrl){ document.getElementById('acy_media_browser_insert_message').innerHTML='".str_replace("'", "\'", acymailing_translation('IMAGE_FOUND'))."'; } }else{ document.getElementById('acy_media_browser_image_selected').innerHTML=\"\"; document.getElementById('acy_media_browser_image_selected').style.display=\"none\"; document.getElementById('acy_media_browser_image_selected_info').innerHTML=\"\"; if(fromUrl){ if(result='error'){ document.getElementById('acy_media_browser_insert_message').innerHTML='".str_replace("'", "\'", acymailing_translation('IMAGE_NOT_FOUND'))."'; }else if(result='timeout'){ document.getElementById('acy_media_browser_insert_message').innerHTML='".str_replace("'", "\'", acymailing_translation('IMAGE_TIMEOUT'))."'; } } } } function calculateSize(newHeight, newWidth){ if((newHeight == '' && newWidth == '') || (newHeight == '' && newWidth == 0) || (newHeight == 0 && newWidth == '')) return; var img = document.getElementById('acy_media_browser_selected_image'); if(!img) return; if(newHeight == 0) document.getElementById('acy_media_browser_image_height').value = parseInt(img.naturalHeight * (newWidth / img.naturalWidth)); if(newWidth == 0) document.getElementById('acy_media_browser_image_width').value = parseInt(img.naturalWidth * (newHeight / img.naturalHeight)); } function testImage(url, callback, timeout) { timeout = timeout || 5000; var timedOut = false, timer; var img = new Image(); img.onerror = img.onabort = function() { if (!timedOut) { clearTimeout(timer); callback(url, \"error\", '', '', '',true); } }; img.onload = function() { if (!timedOut) { clearTimeout(timer); callback(url, \"success\",'','', '',true); } }; img.src = url; timer = setTimeout(function() { timedOut = true; callback(url, \"timeout\", '', '', '', true); }, timeout); } function displayAppropriateField(id){ if(id==\"import_from_url_btn\"){ document.getElementById('upload_image').style.display=\"none\"; document.getElementById('import_from_url').style.display=\"block\"; jQuery('#acy_media_browser_buttons_block').css('width', '0'); jQuery('#acy_media_browser_buttons_block').css('opacity', '0'); jQuery('#acy_media_browser_hidden_elements').css('width', '522px'); jQuery('#acy_media_browser_hidden_elements').css('opacity', '1'); }else if(id==\"upload_image_btn\"){ document.getElementById('upload_image').style.display=\"block\"; document.getElementById('import_from_url').style.display=\"none\"; jQuery('#acy_media_browser_buttons_block').css('width', '0'); jQuery('#acy_media_browser_buttons_block').css('opacity', '0'); jQuery('#acy_media_browser_hidden_elements').css('width', '522px'); jQuery('#acy_media_browser_hidden_elements').css('opacity', '1'); }else if(id == \"create_folder_btn\"){ if(document.getElementById('acy_media_browser_area_create_folder').style.display == \"none\"){ document.getElementById('acy_media_browser_area_create_folder').style.display = \"\"; jQuery('#acy_media_browser_area_create_folder').stop().animate({height: '85px'},400); }else{ document.getElementById('acy_media_browser_area_create_folder').style.display = \"none\"; jQuery('#acy_media_browser_area_create_folder').stop().animate({height: '0px'},400); } }else{ jQuery('#acy_media_browser_hidden_elements').css('width', '0'); jQuery('#acy_media_browser_hidden_elements').css('opacity', '0'); jQuery('#acy_media_browser_buttons_block').css('width', '522px'); jQuery('#acy_media_browser_buttons_block').css('opacity', '1'); } } function toggleImageInfo(id, action){ if(action==\"display\"){ document.getElementById('acy_media_browser_image_info_'+id+'').style.display = \"\"; }else{ document.getElementById('acy_media_browser_image_info_'+id+'').style.display = \"none\"; } } function _getQueryObject(q) { var vars = q.split(/[&;]/); var rs = {}; if (vars.length){ for(var i = 0 ; i'; }else{ var tag = '\"''; } if(selectedImageRef){ tag = '' + tag + ''; } ".$insertImage." return false; } function changeFolder(folderName){ var url = window.location.href; if (url.indexOf('?') > -1){ var lastParam = url.substring(url.lastIndexOf('&') + 1); if(url.indexOf('pictName') > -1){ var temp = url.split('&'); for(var i=0;i -1){ temp.splice(i, 1); i--; } } url = temp.join('&'); lastParam = url.substring(url.lastIndexOf('&') + 1); } if(lastParam == 'task=createFolder')url = url.replace(lastParam,'task=browse&e_name=ACY_NAME_AREA'); lastParam = lastParam.split('='); if(lastParam=='selected_folder') url = url.replace(lastParam, 'selected_folder='+folderName); else url += '&selected_folder='+folderName; }else{ url += '?selected_folder='+folderName; } window.location.href = url; } function confirmBox(type, pictName, originalName){ if(type == 'delete'){ document.getElementById('confirmTxtMM').innerHTML = '".acymailing_translation('ACY_VALIDDELETEITEMS')."
('+pictName+')
'; document.getElementById('textBtnAction').innerHTML = '".acymailing_translation('ACY_DELETE')."'; document.getElementById('confirmOkMM').className = 'acymailing_button acymailing_button_delete'; document.getElementById('iconAction').className = 'acyicon-delete'; }else{ document.getElementById('confirmTxtMM').innerHTML = '".acymailing_translation('ACY_REPLACE_FILE_TEXT')."
'; document.getElementById('textBtnAction').innerHTML = '".acymailing_translation('ACY_REPLACE_FILE')."'; document.getElementById('confirmOkMM').className = 'acymailing_button'; document.getElementById('iconAction').className = 'acyicon-edit'; } var divDelete = document.getElementById('confirmOkMM'); divDelete.onclick = function(){ if(type == 'delete'){ reloadAndAction(type, pictName); }else{ reloadAndAction(type, pictName, originalName); } } var divConfirm = document.getElementById('confirmBoxMM'); divConfirm.style.display = 'inline'; } function reloadAndAction(type, pictName, originalName){ var urlPict = window.location.href; var lastParam = urlPict.substring(urlPict.lastIndexOf('&') + 1); if(lastParam.indexOf('pictName=') > -1){ urlPict = urlPict.substring(0, urlPict.indexOf('pictName=')-1); } if(lastParam.indexOf('pictRename=') > -1){ urlPict = urlPict.substring(0, urlPict.indexOf('pictRename=')-1); lastParam = urlPict.substring(urlPict.lastIndexOf('&') + 1); if(lastParam.indexOf('originalName=') > -1){ urlPict = urlPict.substring(0, urlPict.indexOf('originalName=')-1); } } if(urlPict.indexOf('?') > -1){ if(type == 'delete'){ window.location.href = urlPict + '&pictName=' + pictName; }else{ window.location.href = urlPict + '&originalName=' + originalName + '&pictRename=' + pictName; } } else{ if(type == 'delete'){ window.location.href = urlPict + '?pictName=' + pictName; }else{ window.location.href = urlPict + '?originalName=' + originalName + '&pictRename=' + pictName; } } } function changeDisplay(event){ if(document.getElementById('displayPict').style.display == ''){ display('list'); }else{ display('icons'); } } function display(type){ if(type == 'list'){ document.getElementById('displayPict').style.display = 'none'; document.getElementById('displayLine').style.display = ''; document.getElementById('btn_change_display').title = '".acymailing_translation('ACY_DISPLAY_ICON')."'; document.getElementById('iconTypeDisplay').className = 'acyicon-image_view'; }else{ document.getElementById('displayPict').style.display = ''; document.getElementById('displayLine').style.display = 'none'; document.getElementById('btn_change_display').title = '".acymailing_translation('ACY_DISPLAY_NOICON')."'; document.getElementById('iconTypeDisplay').className = 'acyicon-list_view'; } } "; acymailing_addScript(true, $js); } private function _displayHTML(){ $mediaFolders = acymailing_getFilesFolder('media', true); $receivedFolder = acymailing_getUserVar(ACYMAILING_COMPONENT.".acyeditor.selected_folder", 'selected_folder', '', 'string'); $defaultFolder = reset($mediaFolders); if(!empty($receivedFolder)){ $allowed = false; foreach($mediaFolders as $oneMedia){ if(preg_match('#^'.preg_quote(rtrim($oneMedia, '/')).'[a-z_0-9\-/]*$#i', $receivedFolder)){ $allowed = true; break; } } if($allowed){ $defaultFolder = $receivedFolder; }else{ acymailing_display('You are not allowed to access this folder', 'error'); } } $uploadPath = acymailing_cleanPath(ACYMAILING_ROOT.trim(str_replace('/', DS, trim($defaultFolder)), DS)); $uploadedImage = acymailing_getVar('array', 'uploadedImage', array(), 'files'); if(!empty($uploadedImage)){ if(!empty($uploadedImage['name'])){ $this->imageName = acymailing_importFile($uploadedImage, $uploadPath, true); if(!empty($this->imageName)){ $uploadMessage = 'success'; }else $uploadMessage = 'error'; }else{ $uploadMessage = 'error'; $this->message = acymailing_translation('BROWSE_FILE'); } } if(empty($uploadedImage)){ $pictToDelete = acymailing_getVar('string', 'pictName', ''); $originalName = acymailing_getVar('string', 'originalName', ''); $pictToRename = acymailing_getVar('string', 'pictRename', ''); if(!empty($originalName) && !empty($pictToRename)){ $pictToDelete = $originalName; } if(!empty($pictToDelete) && file_exists($uploadPath.DS.$pictToDelete)){ $checkPictNews = acymailing_loadResultArray('SELECT mailid FROM #__acymailing_mail WHERE body LIKE \'%src="'.ACYMAILING_LIVE.$defaultFolder.'/'.$pictToDelete.'"%\''); $checkPictTemplate = acymailing_loadResultArray('SELECT tempid FROM #__acymailing_template WHERE body LIKE \'%src="'.ACYMAILING_LIVE.$defaultFolder.'/'.$pictToDelete.'"%\''); if(!empty($checkPictNews) || !empty($checkPictTemplate)){ foreach($checkPictNews as $k => $oneNews){ $checkPictNews[$k] = ''.$oneNews.''; } if(acymailing_isAdmin()){ foreach($checkPictTemplate as $k => $oneTmpl){ $checkPictTemplate[$k] = ''.$oneTmpl.''; } } acymailing_display(acymailing_translation_sprintf('ACY_CANT_DELETE', (!empty($checkPictNews) ? implode($checkPictNews, ', ') : '-'), (!empty($checkPictTemplate) ? implode($checkPictTemplate, ', ') : '-')), 'error'); }else{ if(acymailing_deleteFile($uploadPath.DS.$pictToDelete)){ acymailing_display(acymailing_translation('ACY_DELETED_PICT_SUCCESS'), 'success'); }else{ acymailing_display(acymailing_translation('ACY_DELETED_PICT_ERROR'), 'error'); } } } if(!empty($originalName) && !empty($pictToRename)){ if(acymailing_moveFile($uploadPath.DS.$pictToRename, $uploadPath.DS.$originalName)){ acymailing_display(acymailing_translation('ACY_REPLACED_PICT_SUCCESS'), 'success'); }else{ acymailing_display(acymailing_translation('ACY_REPLACED_PICT_ERROR'), 'error'); } } } ?>
'; echo '
'; echo '
'; $filetreeType->display($folders, $defaultFolder, 'acy_media_browser_files_path', 'changeFolder(path)'); echo '
'; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo acymailing_formToken(); echo '
'; echo '
'; echo ''; acymailing_createDir($uploadPath); $files = acymailing_getFiles($uploadPath); echo '
    '; if(!empty($uploadMessage) && !empty($this->message)){ if($uploadMessage == 'success'){ acymailing_display($this->message); }elseif($uploadMessage == 'error'){ acymailing_display($this->message, 'error'); } } $images = array(); $imagesFound = false; $lineDisplay = ''; foreach($files as $k => $file){ if(strrpos($file, '.') === false) continue; $ext = strtolower(substr($file, strrpos($file, '.') + 1)); $extensions = array('jpg', 'jpeg', 'png', 'gif'); if(!in_array($ext, $extensions)) continue; $imagesFound = true; $images[] = $file; $imageSize = getimagesize($uploadPath.DS.$file); ?>
  • ); return false;">
  • '; $lineDisplay .= ''; $lineDisplay .= ''; $lineDisplay .= ''; $lineDisplay .= ''; } $lineDisplay .= '
    '.$file.'
    '; if(!$imagesFound){ acymailing_display(acymailing_translation('NO_FILE_FOUND'), 'warning'); } echo '
'; ?>









checkSelected(true);'; }else{ echo ''; } if(isset($uploadMessage) && $uploadMessage == 'success' && file_exists(ACYMAILING_ROOT.rtrim($defaultFolder, '/').'/'.$this->imageName)){ $imageSize = getimagesize(ACYMAILING_LIVE.rtrim($defaultFolder, '/').'/'.$this->imageName); echo ''; } } public function saveImage(){ acymailing_checkToken(); $data = $_POST['imagedata']; $name = acymailing_getVar('string', 'imagename', ''); $pathtosave = acymailing_getVar('path', 'pathtosave', '', 'post'); $uri = substr($data, strpos($data, ",") + 1); file_put_contents(ACYMAILING_ROOT.$pathtosave.DS.$name.'.png', base64_decode($uri)); } public function createFolder(){ acymailing_checkToken(); $folderName = str_replace(array('.', '-'), array('', '_'), strtolower(acymailing_getVar('cmd', 'subFolderName'))); if(empty($folderName)){ $this->browse(); return false; } $directoryPath = acymailing_getVar('string', 'acy_media_browser_files_path').'/'.$folderName; $mediaFolders = acymailing_getFilesFolder('media', true); $allowed = false; foreach($mediaFolders as $oneMedia){ if(preg_match('#^'.preg_quote($oneMedia).'[a-z_0-9\-/]*$#i', $directoryPath)){ $allowed = true; break; } } if(!$allowed){ acymailing_enqueueMessage('You are not allowed to create this folder', 'error'); $this->browse(); return false; } $directoryPath = str_replace('/', DS, $directoryPath); if(is_dir(ACYMAILING_ROOT.$directoryPath)){ acymailing_enqueueMessage(acymailing_translation('FOLDER_ALREADY_EXISTS'), 'warning'); $this->browse(); return false; } if(!acymailing_createFolder(ACYMAILING_ROOT.$directoryPath)){ acymailing_enqueueMessage(acymailing_translation_sprintf('WRITABLE_FOLDER', substr(ACYMAILING_ROOT.$directoryPath, 0, strrpos(ACYMAILING_ROOT.$directoryPath, DS)), 'error')); $this->browse(); return false; } acymailing_setVar('selected_folder', acymailing_getVar('string', 'acy_media_browser_files_path').'/'.$folderName); $this->browse(); } } PK8!]>dd action.phpnu&1isetTitle(acymailing_translation('ACY_DISTRIBUTION'), 'action'); $acyToolbar->help('distributionlists#listing'); $acyToolbar->display(); $config = acymailing_config(); $level = $config->get('level'); $url = ACYMAILING_HELPURL.'paidversion&utm_source=acymailing-'.$level.'&utm_medium=back-end&utm_content=distributionlist-display&utm_campaign=upgrade'; $iFrame = ""; echo $iFrame.'
'; return; } return parent::listing(); } } PK8!]IIDy y email.phpnu&1istore(); $mailHelper = acymailing_get('helper.mailer'); $receiver = acymailing_currentUserEmail(); $mailid = acymailing_getCID('mailid'); $mailHelper->report = false; $result = $mailHelper->sendOne($mailid, $receiver); acymailing_enqueueMessage($mailHelper->reportMessage, $result ? 'success' : 'error'); return $this->edit(); } function store(){ acymailing_checkToken(); $oldMailid = acymailing_getCID('mailid'); $mailClass = acymailing_get('class.mail'); if($mailClass->saveForm()){ $data = acymailing_getVar('none', 'data'); $type = @$data['mail']['type']; if(!empty($type) AND in_array($type, array('unsub', 'welcome'))){ $subject = addslashes($data['mail']['subject']); $mailid = acymailing_getVar('int', 'mailid'); if($type == 'unsub'){ $js = "var mydrop = window.top.document.getElementById('datalistunsubmailid'); "; $js .= "var type = 'unsub';"; }else{ //type=welcome $js = "var mydrop = window.top.document.getElementById('datalistwelmailid'); "; $js .= "var type = 'welcome';"; } if(empty($oldMailid)){ $js .= 'var optn = document.createElement("OPTION");'; $js .= "optn.text = '[$mailid] $subject'; optn.value = '$mailid';"; $js .= 'mydrop.options.add(optn);'; $js .= 'lastid = 0; while(mydrop.options[lastid+1]){lastid = lastid+1;} mydrop.selectedIndex = lastid;'; $js .= 'window.top.changeMessage(type,'.$mailid.');'; }else{ $js .= "lastid = 0; notfound = true; while(notfound && mydrop.options[lastid]){if(mydrop.options[lastid].value == $mailid){mydrop.options[lastid].text = '[$mailid] $subject';notfound = false;} lastid = lastid+1;}"; } if(ACYMAILING_J30) $js .= 'window.top.jQuery("#datalist'.($type == 'unsub' ? 'unsub' : 'wel').'mailid").trigger("liszt:updated");'; acymailing_addScript(true, $js); } acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'), 'success'); }else{ acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error'); } }//endfct store function chooseListBeforeSend(){ return $this->listing(); } function sendArticle(){ $mailClass = acymailing_get('class.mail'); $listmailClass = acymailing_get('class.listmail'); $mailerHelper = acymailing_get('helper.mailer'); $query = 'SELECT * FROM #__acymailing_mail WHERE type = \'article\''; $mail = acymailing_loadObject($query); $listsids = acymailing_getVar('array', 'cid', array(), ''); acymailing_arrayToInteger($listsids); $newMailId = $mailClass->copyOneNewsletter($mail->mailid); $newMail = $mailClass->get($newMailId); $newMail->alias = ''; $newMail->senddate = time(); $newMail->published = 2; $newMail->type = 'news'; $mailerHelper->triggerTagsWithRightLanguage($newMail, false); //We replace the tags in the mail $mailid = $mailClass->save($newMail); $listmailClass->save($mailid, $listsids); $schedHelper = acymailing_get('helper.schedule'); $schedHelper->queueScheduled(); if(!empty($schedHelper->messages)) acymailing_enqueueMessage($schedHelper->messages); } }//endclass PKd!] QFRRrequest.xml.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Request management controller class. * * @since 3.9.0 */ class PrivacyControllerRequest extends JControllerLegacy { /** * Method to export the data for a request. * * @return $this * * @since 3.9.0 */ public function export() { $this->input->set('view', 'export'); return $this->display(); } } PKd!]J$zz consents.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Consents management controller class. * * @since 3.9.0 */ class PrivacyControllerConsents extends JControllerForm { /** * Method to invalidate specific consents. * * @return boolean * * @since 3.9.0 */ public function invalidate($key = null, $urlVar = null) { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $ids = (array) $this->input->get('cid', array(), 'int'); // Remove zero values resulting from input filter $ids = array_filter($ids); if (empty($ids)) { $message = JText::_('JERROR_NO_ITEMS_SELECTED'); $this->setError($message); } else { // Get the model. /** @var PrivacyModelConsents $model */ $model = $this->getModel(); // Publish the items. if (!$model->invalidate($ids)) { $this->setError($model->getError()); } $message = JText::plural('COM_PRIVACY_N_CONSENTS_INVALIDATED', count($ids)); } $this->setRedirect(JRoute::_('index.php?option=com_privacy&view=consents', false), $message); } /** * Method to invalidate all consents of a specific subject. * * @return boolean * * @since 3.9.0 */ public function invalidateAll() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $filters = $this->input->get('filter', array(), 'array'); if (isset($filters['subject']) && $filters['subject'] != '') { $subject = $filters['subject']; } else { $this->setError(JText::_('JERROR_NO_ITEMS_SELECTED')); } // Get the model. /** @var PrivacyModelConsents $model */ $model = $this->getModel(); // Publish the items. if (!$model->invalidateAll($subject)) { $this->setError($model->getError()); } $message = JText::_('COM_PRIVACY_CONSENTS_INVALIDATED_ALL'); $this->setRedirect(JRoute::_('index.php?option=com_privacy&view=consents', false), $message); } } PKd!]B requests.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Requests management controller class. * * @since 3.9.0 */ class PrivacyControllerRequests 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|boolean Model object on success; otherwise false on failure. * * @since 3.9.0 */ public function getModel($name = 'Request', $prefix = 'PrivacyModel', $config = array('ignore_request' => true)) { return parent::getModel($name, $prefix, $config); } } PKh"]pn profile.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * User profile controller class. * * @since 1.6 */ class AdminControllerProfile extends JControllerForm { /** * Method to check if you can edit a record. * * Extended classes can override this if necessary. * * @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') { return isset($data['id']) && $data['id'] == JFactory::getUser()->id; } /** * Overrides parent save method to check the submitted passwords match. * * @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.2 */ public function save($key = null, $urlVar = null) { $this->setRedirect(JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id=' . JFactory::getUser()->id, false)); $return = parent::save(); if ($this->getTask() != 'apply') { // Redirect to the main page. $this->setRedirect(JRoute::_('index.php', false)); } return $return; } /** * Method to cancel an edit. * * @param string $key The name of the primary key of the URL variable. * * @return boolean True if access level checks pass, false otherwise. * * @since 1.6 */ public function cancel($key = null) { $return = parent::cancel($key); // Redirect to the main page. $this->setRedirect(JRoute::_('index.php', false)); return $return; } } PK"][5 association.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLoader::register('AssociationsHelper', JPATH_ADMINISTRATOR . '/components/com_associations/helpers/associations.php'); /** * Association edit controller class. * * @since 3.7.0 */ class AssociationsControllerAssociation extends JControllerForm { /** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key * (sometimes required to avoid router collisions). * * @return boolean True if access level check and checkout passes, false otherwise. * * @since 3.7.0 */ public function edit($key = null, $urlVar = null) { list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string')); $id = $this->input->get('id', 0, 'int'); // Check if reference item can be edited. if (!AssociationsHelper::allowEdit($extensionName, $typeName, $id)) { JFactory::getApplication()->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_associations&view=associations', false)); return false; } return parent::display(); } /** * Method for canceling the edit action * * @param string $key The name of the primary key of the URL variable. * * @return void * * @since 3.7.0 */ public function cancel($key = null) { $this->checkToken(); list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string')); // Only check in, if component item type allows to check out. if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName)) { $ids = array(); $targetId = $this->input->get('target-id', '', 'string'); if ($targetId !== '') { $ids = array_unique(explode(',', $targetId)); } $ids[] = $this->input->get('id', 0, 'int'); foreach ($ids as $key => $id) { AssociationsHelper::getItem($extensionName, $typeName, $id)->checkin(); } } $this->setRedirect(JRoute::_('index.php?option=com_associations&view=associations', false)); } } PK"]x  associations.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLoader::register('AssociationsHelper', JPATH_ADMINISTRATOR . '/components/com_associations/helpers/associations.php'); /** * Associations controller class. * * @since 3.7.0 */ class AssociationsControllerAssociations extends JControllerAdmin { /** * The URL view list variable. * * @var string * * @since 3.7.0 */ protected $view_list = 'associations'; /** * 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 JModel|boolean * * @since 3.7.0 */ public function getModel($name = 'Associations', $prefix = 'AssociationsModel', $config = array('ignore_request' => true)) { return parent::getModel($name, $prefix, $config); } /** * Method to purge the associations table. * * @return void * * @since 3.7.0 */ public function purge() { $this->checkToken(); $this->getModel('associations')->purge(); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); } /** * Method to delete the orphans from the associations table. * * @return void * * @since 3.7.0 */ public function clean() { $this->checkToken(); $this->getModel('associations')->clean(); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); } /** * Method to check in an item from the association item overview. * * @return void * * @since 3.7.1 */ public function checkin() { // Set the redirect so we can just stop processing when we find a condition we can't process $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); // Figure out if the item supports checking and check it in $type = null; list($extensionName, $typeName) = explode('.', $this->input->get('itemtype')); $extension = AssociationsHelper::getSupportedExtension($extensionName); $types = $extension->get('types'); if (!array_key_exists($typeName, $types)) { return; } if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName) === false) { // How on earth we came to that point, eject internet return; } $cid = (array) $this->input->get('cid', array(), 'int'); if (empty($cid)) { // Seems we don't have an id to work with. return; } // We know the first element is the one we need because we don't allow multi selection of rows $id = $cid[0]; if ($id === 0) { // Seems we don't have an id to work with. return; } if (AssociationsHelper::canCheckinItem($extensionName, $typeName, $id) === true) { $item = AssociationsHelper::getItem($extensionName, $typeName, $id); $item->checkIn($id); return; } $this->setRedirect( JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list), JText::_('COM_ASSOCIATIONS_YOU_ARE_NOT_ALLOWED_TO_CHECKIN_THIS_ITEM') ); return; } } PK"]mPactionlogs.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Date\Date; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\Utilities\ArrayHelper; JLoader::register('ActionlogsHelper', JPATH_ADMINISTRATOR . '/components/com_actionlogs/helpers/actionlogs.php'); /** * Actionlogs list controller class. * * @since 3.9.0 */ class ActionlogsControllerActionlogs extends JControllerAdmin { /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @since 3.9.0 */ public function __construct(array $config = array()) { parent::__construct($config); $this->registerTask('exportSelectedLogs', 'exportLogs'); } /** * 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 3.9.0 */ public function getModel($name = 'Actionlogs', $prefix = 'ActionlogsModel', $config = array('ignore_request' => true)) { // Return the model return parent::getModel($name, $prefix, $config); } /** * Method to export logs * * @return void * * @since 3.9.0 */ public function exportLogs() { // Check for request forgeries. $this->checkToken(); $task = $this->getTask(); $pks = array(); if ($task == 'exportSelectedLogs') { // Get selected logs $pks = ArrayHelper::toInteger(explode(',', $this->input->post->getString('cids'))); } /** @var ActionlogsModelActionlogs $model */ $model = $this->getModel(); // Get the logs data $data = $model->getLogDataAsIterator($pks); if (count($data)) { try { $rows = ActionlogsHelper::getCsvData($data); } catch (InvalidArgumentException $exception) { $this->setMessage(Text::_('COM_ACTIONLOGS_ERROR_COULD_NOT_EXPORT_DATA'), 'error'); $this->setRedirect(Route::_('index.php?option=com_actionlogs&view=actionlogs', false)); return; } // Destroy the iterator now unset($data); $date = new Date('now', new DateTimeZone('UTC')); $filename = 'logs_' . $date->format('Y-m-d_His_T'); $csvDelimiter = ComponentHelper::getComponent('com_actionlogs')->getParams()->get('csv_delimiter', ','); $app = Factory::getApplication(); $app->setHeader('Content-Type', 'application/csv', true) ->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '.csv"', true) ->setHeader('Cache-Control', 'must-revalidate', true) ->sendHeaders(); $output = fopen("php://output", "w"); foreach ($rows as $row) { fputcsv($output, $row, $csvDelimiter); } fclose($output); $app->triggerEvent('onAfterLogExport', array()); $app->close(); } else { $this->setMessage(Text::_('COM_ACTIONLOGS_NO_LOGS_TO_EXPORT')); $this->setRedirect(Route::_('index.php?option=com_actionlogs&view=actionlogs', false)); } } /** * Clean out the logs * * @return void * * @since 3.9.0 */ public function purge() { // Check for request forgeries. $this->checkToken(); $model = $this->getModel(); if ($model->purge()) { $message = Text::_('COM_ACTIONLOGS_PURGE_SUCCESS'); } else { $message = Text::_('COM_ACTIONLOGS_PURGE_FAIL'); } $this->setRedirect(Route::_('index.php?option=com_actionlogs&view=actionlogs', false), $message); } } PK"]( HH sitemaps.phpnu&1iregisterTask('unpublish', 'publish'); $this->registerTask('trash', 'publish'); $this->registerTask('unfeatured', 'featured'); } /** * Method to toggle the default sitemap. * * @return void * @since 2.0 */ function setDefault() { // Check for request forgeries JRequest::checkToken() or die('Invalid Token'); // Get items to publish from the request. $cid = JRequest::getVar('cid', 0, '', 'array'); $id = @$cid[0]; if (!$id) { JError::raiseWarning(500, JText::_('Select an item to set as default')); } else { // Get the model. $model = $this->getModel(); // Publish the items. if (!$model->setDefault($id)) { JError::raiseWarning(500, $model->getError()); } } $this->setRedirect('index.php?option=com_xmap&view=sitemaps'); } /** * Proxy for getModel. * * @param string $name The name of the model. * @param string $prefix The prefix for the PHP class name. * * @return JModel * @since 2.0 */ public function getModel($name = 'Sitemap', $prefix = 'XmapModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } }PK"]=IM++ sitemap.phpnu&1iauthorise('core.edit', 'com_xmap.sitemap.'.$recordId); } }PK; "]V֧ff plugins.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Plugins list controller class. * * @since 1.6 */ class PluginsControllerPlugins 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 = 'Plugin', $prefix = 'PluginsModel', $config = array('ignore_request' => true)) { return parent::getModel($name, $prefix, $config); } } PK; "]byy plugin.phpnu&1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Plugin controller class. * * @since 1.6 */ class PluginsControllerPlugin extends JControllerForm { } PK!] article.phpnu&1iPK!]غ * ajax.json.phpnu&1iPK!]J featured.phpnu&1iPK!]f3 3 articles.phpnu&1iPKS|!](dJ ],filter.phpnu&1iPKS|!],Voo {7filters.phpnu&1iPKS|!]ʼngg%;maps.phpnu&1iPKS|!]nͿ))>indexer.json.phpnu&1iPKS|!]E:: hindex.phpnu&1iPKW|!]txDD6otags.phpnu&1iPKW|!]Xttag.phpnu&1iPKY|!]!i= {contact.phpnu&1iPKY|!]T contacts.phpnu&1iPKZ|!]>^ٟ uupdate.phpnu&1iPKZ|!]y/ Isearches.phpnu&1iPK]|!]O   0client.phpnu&1iPK]|!]c tbanner.phpnu&1iPK]|!]2Ʒ banners.phpnu&1iPK]|!]F tracks.phpnu&1iPK]|!](U clients.phpnu&1iPK]|!]@v v tracks.raw.phpnu&1iPK`|!]8:YY message.phpnu&1iPK`|!]Yll Kmessages.phpnu&1iPK`|!]n|F config.phpnu&1iPK|!]ID newsfeed.phpnu&1iPK|!]g (newsfeeds.phpnu&1iPK|!]5f1categories.phpnu&1iPK|!]t~Qcustomfield.phpnu&1iPK|!]@ events.phpnu&1iPK|!]e_pp F"category.phpnu&1iPK|!]H  8registration.phpnu&1iPK|!]{%[[ ACfeatures.phpnu&1iPK|!]XGmail.phpnu&1iPK|!]``Mcustomfields.phpnu&1iPK|!] uuQregistrations.raw.phpnu&1iPK|!]r qithemes.phpnu&1iPK|!]vu$$$ pevent.phpnu&1iPK|!]  ~icagenda.phpnu&1iPK|!]")_dd̓registrations.phpnu&1iPK|!]Jۄ rfeature.phpnu&1iPK|!]6 iindex.htmlnu&1iPK}!]"Kgg file.json.phpnu&1iPK}!]xrefile.phpnu&1iPK}!]N folder.phpnu&1iPKD!]d: kmenus.phpnu&1iPKD!]m6vvlajax.phpnu&1iPK!]t5 5 level.phpnu&1iPK!]&88 user.phpnu&1iPK!]bQԧ Busers.phpnu&1iPK!]h+ Olevels.phpnu&1iPK!]TU Snotes.phpnu&1iPK!]$ Wgroup.phpnu&1iPK!]A egroups.phpnu&1iPK!]ҋSS@jnote.phpnu&1iPK!] noverrides.phpnu&1iPK!]533ustrings.json.phpnu&1iPK!]d  hyoverride.phpnu&1iPK!]Qdd 5action.phpnu&1iPK8!]IIDy y email.phpnu&1iPKd!] QFRRrequest.xml.phpnu&1iPKd!]J$zz consents.phpnu&1iPKd!]B requests.phpnu&1iPKh"]pn profile.phpnu&1iPK"][5 association.phpnu&1iPK"]x  Wassociations.phpnu&1iPK"]mPactionlogs.phpnu&1iPK"]( HH sitemaps.phpnu&1iPK"]=IM++ sitemap.phpnu&1iPK; "]V֧ff #plugins.phpnu&1iPK; "]byy $'plugin.phpnu&1iPKoo (