| Current Path : /home/wuectly/www/03cbe/ |
| Current File : /home/wuectly/www/03cbe/controllers.zip |
PK �E$]�R�m m tags.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_tags
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The Tags List Controller
*
* @since 3.1
*/
class TagsControllerTags extends JControllerAdmin
{
/**
* Proxy for getModel
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config An optional associative array of configuration settings.
*
* @return JModelLegacy The model.
*
* @since 3.1
*/
public function getModel($name = 'Tag', $prefix = 'TagsModel', $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 3.1
*/
public function rebuild()
{
$this->checkToken();
$this->setRedirect(JRoute::_('index.php?option=com_tags&view=tags', false));
$model = $this->getModel();
if ($model->rebuild())
{
// Rebuild succeeded.
$this->setMessage(JText::_('COM_TAGS_REBUILD_SUCCESS'));
return true;
}
else
{
// Rebuild failed.
$this->setMessage(JText::_('COM_TAGS_REBUILD_FAILURE'));
return false;
}
}
}
PK �E$]��'� � tag.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_tags
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The Tag Controller
*
* @since 3.1
*/
class TagsControllerTag extends JControllerForm
{
/**
* Method to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 3.1
*/
protected function allowAdd($data = array())
{
$user = JFactory::getUser();
return $user->authorise('core.create', 'com_tags');
}
/**
* Method to check if you can edit a record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 3.1
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Since there is no asset tracking and no categories, revert to the component permissions.
return parent::allowEdit($data, $key);
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 3.1
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('Tag');
// Preset the redirect
$this->setRedirect('index.php?option=com_tags&view=tags');
return parent::batch($model);
}
}
PK j_$]��pn� � profile.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* 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 +`$]�*�#y y items.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
/**
* The Menu Item Controller
*
* @since 1.6
*/
class MenusControllerItems extends JControllerAdmin
{
/**
* Constructor
*
* @param array $config Optional configuration array
*
* @since 1.6
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('unsetDefault', 'setDefault');
}
/**
* 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 = 'Item', $prefix = 'MenusModel', $config = array())
{
return parent::getModel($name, $prefix, array('ignore_request' => true));
}
/**
* Rebuild the nested set 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=items');
$model = $this->getModel();
if ($model->rebuild())
{
// Reorder succeeded.
$this->setMessage(JText::_('COM_MENUS_ITEMS_REBUILD_SUCCESS'));
return true;
}
else
{
// Rebuild failed.
$this->setMessage(JText::sprintf('COM_MENUS_ITEMS_REBUILD_FAILED'), 'error');
return false;
}
}
/**
* Save the manual order inputs from the menu items list view
*
* @return void
*
* @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;
}
}
/**
* Method to set the home property for a list of items
*
* @return void
*
* @since 1.6
*/
public function setDefault()
{
// Check for request forgeries
$this->checkToken('request');
$app = JFactory::getApplication();
// Get items to publish from the request.
$cid = (array) $this->input->get('cid', array(), 'int');
$data = array('setDefault' => 1, 'unsetDefault' => 0);
$task = $this->getTask();
$value = ArrayHelper::getValue($data, $task, 0, 'int');
// 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.
$model = $this->getModel();
// Publish the items.
if (!$model->setHome($cid, $value))
{
JError::raiseWarning(500, $model->getError());
}
else
{
if ($value == 1)
{
$ntext = 'COM_MENUS_ITEMS_SET_HOME';
}
else
{
$ntext = 'COM_MENUS_ITEMS_UNSET_HOME';
}
$this->setMessage(JText::plural($ntext, count($cid)));
}
}
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list
. '&menutype=' . $app->getUserState('com_menus.items.menutype'), false
)
);
}
/**
* Method to publish a list of items
*
* @return void
*
* @since 3.6.0
*/
public function publish()
{
// Check for request forgeries
$this->checkToken();
// Get items to publish from the request.
$cid = (array) JFactory::getApplication()->input->get('cid', array(), 'int');
$data = array('publish' => 1, 'unpublish' => 0, 'trash' => -2, 'report' => -3);
$task = $this->getTask();
$value = ArrayHelper::getValue($data, $task, 0, 'int');
// Remove zero values resulting from input filter
$cid = array_filter($cid);
if (empty($cid))
{
try
{
JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
}
catch (RuntimeException $exception)
{
JFactory::getApplication()->enqueueMessage(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), 'warning');
}
}
else
{
// Get the model.
$model = $this->getModel();
// Publish the items.
try
{
$model->publish($cid, $value);
$errors = $model->getErrors();
$messageType = 'message';
if ($value == 1)
{
if ($errors)
{
$messageType = 'error';
$ntext = $this->text_prefix . '_N_ITEMS_FAILED_PUBLISHING';
}
else
{
$ntext = $this->text_prefix . '_N_ITEMS_PUBLISHED';
}
}
elseif ($value == 0)
{
$ntext = $this->text_prefix . '_N_ITEMS_UNPUBLISHED';
}
else
{
$ntext = $this->text_prefix . '_N_ITEMS_TRASHED';
}
$this->setMessage(JText::plural($ntext, count($cid)), $messageType);
}
catch (Exception $e)
{
$this->setMessage($e->getMessage(), 'error');
}
}
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list . '&menutype=' .
JFactory::getApplication()->getUserState('com_menus.items.menutype'),
false
)
);
}
/**
* Check in of one or more records.
*
* @return boolean True on success
*
* @since 3.6.0
*/
public function checkin()
{
// Check for request forgeries.
$this->checkToken();
// Read the Ids from the post data
$cid = (array) JFactory::getApplication()->input->post->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$cid = array_filter($cid);
// Run the model
$model = $this->getModel();
$return = $model->checkin($cid);
if ($return === false)
{
// Checkin failed.
$message = JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError());
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list
. '&menutype=' . JFactory::getApplication()->getUserState('com_menus.items.menutype'),
false
),
$message,
'error'
);
return false;
}
else
{
// Checkin succeeded.
$message = JText::plural($this->text_prefix . '_N_ITEMS_CHECKED_IN', count($cid));
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list
. '&menutype=' . JFactory::getApplication()->getUserState('com_menus.items.menutype'),
false
),
$message
);
return true;
}
}
}
PK +`$]�ǽ�d d
ajax.json.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\LanguageHelper;
/**
* The menu controller for ajax requests
*
* @since 3.9.0
*/
class MenusControllerAjax extends JControllerLegacy
{
/**
* Method to fetch associations of a menu item
*
* The method assumes that the following http parameters are passed in an Ajax Get request:
* token: the form token
* assocId: the id of the menu item 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('com_menus', '#__menu', 'com_menus.item', (int) $assocId, 'id', '', '');
unset($associations[$excludeLang]);
// Add the title to each of the associated records
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/tables');
$menuTable = JTable::getInstance('Menu', 'JTable', array());
foreach ($associations as $lang => $association)
{
$menuTable->load($association->id);
$associations[$lang]->title = $menuTable->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 +`$]���5 menu.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @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;
/**
* 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 +`$]lU,�� � menus.phpnu &1i� <?php
/**
* @name Slideshow CK
* @package com_slideshowck
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
*/
// No direct access
defined('CK_LOADED') or die;
use \Slideshowck\CKController;
use \Slideshowck\CKFof;
class SlideshowckControllerMenus extends CKController {
function ajaxShowMenuItems() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$parentId = $this->input->get('parentid', 0, 'int');
$menutype = $this->input->get('menutype', '', 'string');
$model = $this->getModel('Menus', 'Slideshowck', array());
$items = $model->getChildrenItems($menutype, $parentId);
$links = array();
$imagespath = SLIDESHOWCK_MEDIA_URI .'/images/';
?>
<div class="cksubfolder">
<?php
foreach ($items as $item) {
// CKFof::dump($item);
$aliasId = $item->id;
if ($item->type == 'alias') {
$itemParams = new \Joomla\Registry\Registry($item->params);
$aliasId = $itemParams->get('aliasoptions', 0);
}
$Itemid = substr($item->link,-7,7) == 'Itemid=' ? $aliasId : '&Itemid=' . $aliasId;
?>
<div class="ckfoldertree parent">
<div class="ckfoldertreetoggler <?php if ($item->rgt - $item->lft <= 1) { echo 'empty'; } ?>" onclick="ckToggleTreeSub(this, <?php echo $item->id ?>)" data-menutype="<?php echo $item->menutype; ?>"></div>
<div class="ckfoldertreename hasTip" title="<?php echo $item->link . $Itemid ?>" onclick="ckSetMenuItemUrl('<?php echo $item->link . $Itemid ?>')"><img src="<?php echo $imagespath ?>folder.png" /><?php echo $item->title; ?></div>
</div>
<?php
}
?>
</div>
<?php
exit;
}
}
PK +`$]?(�e�? �? item.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @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;
/**
* The Menu Item Controller
*
* @since 1.6
*/
class MenusControllerItem extends JControllerForm
{
/**
* Method to check if you can add a new record.
*
* Extended classes can override this if necessary.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 3.6
*/
protected function allowAdd($data = array())
{
$user = JFactory::getUser();
$menuType = JFactory::getApplication()->input->getCmd('menutype', isset($data['menutype']) ? $data['menutype'] : '');
$menutypeID = 0;
// Load menutype ID
if ($menuType)
{
$menutypeID = (int) $this->getMenuTypeId($menuType);
}
return $user->authorise('core.create', 'com_menus.menu.' . $menutypeID);
}
/**
* Method to check if you 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; default is id.
*
* @return boolean
*
* @since 3.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
$user = JFactory::getUser();
$menutypeID = 0;
if (isset($data[$key]))
{
$model = $this->getModel();
$item = $model->getItem($data[$key]);
if (!empty($item->menutype))
{
// Protected menutype, do not allow edit
if ($item->menutype == 'main')
{
return false;
}
$menutypeID = (int) $this->getMenuTypeId($item->menutype);
}
}
return $user->authorise('core.edit', 'com_menus.menu.' . (int) $menutypeID);
}
/**
* Loads the menutype ID by a given menutype string
*
* @param string $menutype The given menutype
*
* @return integer
*
* @since 3.6
*/
protected function getMenuTypeId($menutype)
{
$model = $this->getModel();
$table = $model->getTable('MenuType', 'JTable');
$table->load(array('menutype' => $menutype));
return (int) $table->id;
}
/**
* Method to add a new menu item.
*
* @return mixed True if the record can be added, a JError object if not.
*
* @since 1.6
*/
public function add()
{
$app = JFactory::getApplication();
$context = 'com_menus.edit.item';
$result = parent::add();
if ($result)
{
$app->setUserState($context . '.type', null);
$app->setUserState($context . '.link', 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();
$model = $this->getModel('Item', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_menus&view=items' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* 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)
{
$this->checkToken();
$app = JFactory::getApplication();
$context = 'com_menus.edit.item';
$result = parent::cancel();
if ($result)
{
// Clear the ancillary data from the session.
$app->setUserState($context . '.type', null);
$app->setUserState($context . '.link', null);
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend()
. '&menutype=' . $app->getUserState('com_menus.items.menutype'), false
)
);
}
return $result;
}
/**
* 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 1.6
*/
public function edit($key = null, $urlVar = null)
{
$app = JFactory::getApplication();
$result = parent::edit();
if ($result)
{
// Push the new ancillary data into the session.
$app->setUserState('com_menus.edit.item.type', null);
$app->setUserState('com_menus.edit.item.link', null);
}
return $result;
}
/**
* 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.0.1
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
if ($recordId)
{
$model = $this->getModel();
$item = $model->getItem($recordId);
$clientId = $item->client_id;
$append = '&client_id=' . $clientId . $append;
}
else
{
$app = JFactory::getApplication();
$clientId = $app->input->get('client_id', '0', 'int');
$menuType = $app->input->get('menutype', 'mainmenu', 'cmd');
$append = '&client_id=' . $clientId . ($menuType ? '&menutype=' . $menuType : '') . $append;
}
return $append;
}
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 1.6
*/
public function save($key = null, $urlVar = null)
{
// Check for request forgeries.
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel('Item', '', array());
$table = $model->getTable();
$data = $this->input->post->get('jform', array(), 'array');
$task = $this->getTask();
$context = 'com_menus.edit.item';
// Set the menutype should we need it.
if ($data['menutype'] !== '')
{
$app->input->set('menutype', $data['menutype']);
}
// 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);
// Populate the row id from the session.
$data[$key] = $recordId;
// The save2copy task needs to be handled slightly differently.
if ($task == 'save2copy')
{
// Check-in the original row.
if ($model->checkin($data['id']) === false)
{
// Check-in failed, go back to the item and display a notice.
$this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()), 'warning');
return false;
}
// Reset the ID and then treat the request as for Apply.
$data['id'] = 0;
$data['associations'] = array();
$task = 'apply';
}
// Access check.
if (!$this->allowSave($data, $key))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list
. $this->getRedirectToListAppend(), false
)
);
return false;
}
// Validate the posted data.
// This post is made up of two forms, one for the item and one for params.
$form = $model->getForm($data);
if (!$form)
{
JError::raiseError(500, $model->getError());
return false;
}
if ($data['type'] == 'url')
{
$data['link'] = str_replace(array('"', '>', '<'), '', $data['link']);
if (strstr($data['link'], ':'))
{
$segments = explode(':', $data['link']);
$protocol = strtolower($segments[0]);
$scheme = array(
'http', 'https', 'ftp', 'ftps', 'gopher', 'mailto',
'news', 'prospero', 'telnet', 'rlogin', 'tn3270', 'wais',
'mid', 'cid', 'nntp', 'tel', 'urn', 'ldap', 'file', 'fax',
'modem', 'git', 'sms',
);
if (!in_array($protocol, $scheme))
{
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'warning');
$this->setRedirect(
JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId), false)
);
return false;
}
}
}
$data = $model->validate($form, $data);
// Preprocess request fields to ensure that we remove not set or empty request params
$request = $form->getGroup('request', true);
// Check for the special 'request' entry.
if ($data['type'] == 'component' && !empty($request))
{
$removeArgs = array();
if (!isset($data['request']) || !is_array($data['request']))
{
$data['request'] = array();
}
foreach ($request as $field)
{
$fieldName = $field->getAttribute('name');
if (!isset($data['request'][$fieldName]) || $data['request'][$fieldName] == '')
{
$removeArgs[$fieldName] = '';
}
}
// Parse the submitted link arguments.
$args = array();
parse_str(parse_url($data['link'], PHP_URL_QUERY), $args);
// Merge in the user supplied request arguments.
$args = array_merge($args, $data['request']);
// Remove the unused request params
if (!empty($args) && !empty($removeArgs))
{
$args = array_diff_key($args, $removeArgs);
}
$data['link'] = 'index.php?' . urldecode(http_build_query($args, '', '&'));
unset($data['request']);
}
// 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');
}
}
// Save the data in the session.
$app->setUserState('com_menus.edit.item.data', $data);
// Redirect back to the edit screen.
$editUrl = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId);
$this->setRedirect(JRoute::_($editUrl, false));
return false;
}
// Attempt to save the data.
if (!$model->save($data))
{
// Save the data in the session.
$app->setUserState('com_menus.edit.item.data', $data);
// Redirect back to the edit screen.
$editUrl = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId);
$this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()), 'error');
$this->setRedirect(JRoute::_($editUrl, false));
return false;
}
// Save succeeded, check-in the row.
if ($model->checkin($data['id']) === false)
{
// Check-in failed, go back to the row and display a notice.
$this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()), 'warning');
$redirectUrl = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId);
$this->setRedirect(JRoute::_($redirectUrl, false));
return false;
}
$this->setMessage(JText::_('COM_MENUS_SAVE_SUCCESS'));
// Redirect the user and adjust session state based on the chosen task.
switch ($task)
{
case 'apply':
// Set the row data in the session.
$recordId = $model->getState($this->context . '.id');
$this->holdEditId($context, $recordId);
$app->setUserState('com_menus.edit.item.data', null);
$app->setUserState('com_menus.edit.item.type', null);
$app->setUserState('com_menus.edit.item.link', null);
// Redirect back to the edit screen.
$editUrl = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId);
$this->setRedirect(JRoute::_($editUrl, false));
break;
case 'save2new':
// Clear the row id and data in the session.
$this->releaseEditId($context, $recordId);
$app->setUserState('com_menus.edit.item.data', null);
$app->setUserState('com_menus.edit.item.type', null);
$app->setUserState('com_menus.edit.item.link', null);
// Redirect back to the edit screen.
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend(), false));
break;
default:
// Clear the row id and data in the session.
$this->releaseEditId($context, $recordId);
$app->setUserState('com_menus.edit.item.data', null);
$app->setUserState('com_menus.edit.item.type', null);
$app->setUserState('com_menus.edit.item.link', null);
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend()
. '&menutype=' . $app->getUserState('com_menus.items.menutype'), false
)
);
break;
}
return true;
}
/**
* Sets the type of the menu item currently being edited.
*
* @return void
*
* @since 1.6
*/
public function setType()
{
$this->checkToken();
$app = JFactory::getApplication();
// Get the posted values from the request.
$data = $this->input->post->get('jform', array(), 'array');
// Get the type.
$type = $data['type'];
$type = json_decode(base64_decode($type));
$title = isset($type->title) ? $type->title : null;
$recordId = isset($type->id) ? $type->id : 0;
$specialTypes = array('alias', 'separator', 'url', 'heading', 'container');
if (!in_array($title, $specialTypes))
{
$title = 'component';
}
else
{
// Set correct component id to ensure proper 404 messages with system links
$data['component_id'] = 0;
}
$app->setUserState('com_menus.edit.item.type', $title);
if ($title == 'component')
{
if (isset($type->request))
{
// Clean component name
$type->request->option = JFilterInput::getInstance()->clean($type->request->option, 'CMD');
$component = JComponentHelper::getComponent($type->request->option);
$data['component_id'] = $component->id;
$app->setUserState('com_menus.edit.item.link', 'index.php?' . JUri::buildQuery((array) $type->request));
}
}
// If the type is alias you just need the item id from the menu item referenced.
elseif ($title == 'alias')
{
$app->setUserState('com_menus.edit.item.link', 'index.php?Itemid=');
}
unset($data['request']);
$data['type'] = $title;
if ($this->input->get('fieldtype') == 'type')
{
$data['link'] = $app->getUserState('com_menus.edit.item.link');
}
// Save the data in the session.
$app->setUserState('com_menus.edit.item.data', $data);
$this->type = $type;
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId), false));
}
/**
* Gets the parent items of the menu location currently.
*
* @return void
*
* @since 3.2
*/
public function getParentItem()
{
$app = JFactory::getApplication();
$results = array();
$menutype = $this->input->get->get('menutype');
if ($menutype)
{
$model = $this->getModel('Items', '', array());
$model->getState();
$model->setState('filter.menutype', $menutype);
$model->setState('list.select', 'a.id, a.title, a.level');
$model->setState('list.start', '0');
$model->setState('list.limit', '0');
/** @var MenusModelItems $model */
$results = $model->getItems();
// Pad the option text with spaces using depth level as a multiplier.
for ($i = 0, $n = count($results); $i < $n; $i++)
{
$results[$i]->title = str_repeat(' - ', $results[$i]->level) . $results[$i]->title;
}
}
// Output a JSON object
echo json_encode($results);
$app->close();
}
}
PK .`$]�t��5 5 level.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User view level controller class.
*
* @since 1.6
*/
class UsersControllerLevel extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_LEVEL';
/**
* Method to check if you can save a new or existing record.
*
* Overrides JControllerForm::allowSave to check the core.admin permission.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowSave($data, $key = 'id')
{
return (JFactory::getUser()->authorise('core.admin', $this->option) && parent::allowSave($data, $key));
}
/**
* Overrides JControllerForm::allowEdit
*
* Checks that non-Super Admins are not editing Super Admins.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 3.8.8
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Get user instance
$user = JFactory::getUser();
// Check for if Super Admin can edit
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('*')
->from($db->quoteName('#__viewlevels'))
->where($db->quoteName('id') . ' = ' . (int) $data['id']);
$db->setQuery($query);
$viewlevel = $db->loadAssoc();
// Decode level groups
$groups = json_decode($viewlevel['rules']);
// If this group is super admin and this user is not super admin, canEdit is false
if (!$user->authorise('core.admin') && JAccess::checkGroup($groups[0], 'core.admin'))
{
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'));
return false;
}
return parent::allowEdit($data, $key);
}
/**
* Removes an item.
*
* Overrides JControllerAdmin::delete to check the core.admin permission.
*
* @return boolean Returns true on success, false on failure.
*
* @since 1.6
*/
public function delete()
{
// Check for request forgeries.
$this->checkToken();
$ids = (array) $this->input->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$ids = array_filter($ids);
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
elseif (empty($ids))
{
JError::raiseWarning(500, JText::_('COM_USERS_NO_LEVELS_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Remove the items.
if (!$model->delete($ids))
{
JError::raiseWarning(500, $model->getError());
}
else
{
$this->setMessage(JText::plural('COM_USERS_N_LEVELS_DELETED', count($ids)));
}
}
$this->setRedirect('index.php?option=com_users&view=levels');
}
}
PK .`$]ed��� � user.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User controller class.
*
* @since 1.6
*/
class UsersControllerUser extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_USER';
/**
* Overrides JControllerForm::allowEdit
*
* Checks that non-Super Admins are not editing Super Admins.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean True if allowed, false otherwise.
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check if this person is a Super Admin
if (JAccess::check($data[$key], 'core.admin'))
{
// If I'm not a Super Admin, then disallow the edit.
if (!JFactory::getUser()->authorise('core.admin'))
{
return false;
}
}
return parent::allowEdit($data, $key);
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True on success, false on failure
*
* @since 2.5
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('User', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_users&view=users' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Function that allows child controller access to model data after the data has been saved.
*
* @param JModelLegacy $model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 3.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
return;
}
}
PK .`$]Aj� � mail.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.5.9 2015-07-30
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Event controller class.
*/
class iCagendaControllerMail extends JControllerForm
{
function __construct()
{
$this->view_list = 'icagenda';
parent::__construct();
}
/**
* Return Ajax to load date select options
*
* @since 3.5.9
*/
function dates()
{
icagendaAjax::getOptionsEventDates('mail');
// Cut the execution short
// JFactory::getApplication()->close();
}
/**
* Send the mail
*
* @return void
*
* @since 3.5.9
*/
public function send()
{
// Check for request forgeries.
JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$jinput = $app->input;
$model = $this->getModel('Mail');
if ( ! $model->send())
{
// $msg = 'ok';
// $type = 'message';
// }
// else
// {
// $msg = 'NOT ok';
// $type = 'error';
// Get the user data.
if (version_compare(JVERSION, '3.0', 'lt'))
{
$requestData = JRequest::getVar('jform', array(), 'post');
}
else
{
$requestData = $this->input->post->get('jform', array(), 'array');
}
// Save the data in the session.
$app->setUserState('com_icagenda.mail.data', $requestData);
// Redirect back to the newsletter screen.
$this->setRedirect(JRoute::_('index.php?option=com_icagenda&view=mail&layout=edit', false));
// $this->setredirect('index.php?option=com_icagenda&view=mail&layout=edit', $msg, $type);
return false;
}
// Flush the data from the session.
$app->setUserState('com_icagenda.mail.data', null);
// $msg = $model->getError();
// Redirect back to the newsletter screen.
$this->setRedirect(JRoute::_('index.php?option=com_icagenda&view=mail&layout=edit', false));
// $this->setredirect('index.php?option=com_icagenda&view=mail&layout=edit', $msg, $type);
return true;
}
/**
* Cancel the mail
*
* @return void
*
* @since 3.5.9
*/
public function cancel($key = null)
{
// Check for request forgeries.
JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
// Flush the data from the session.
$app->setUserState('com_icagenda.mail.data', null);
$this->setRedirect(JRoute::_('index.php?option=com_icagenda', false));
}
}
PK .`$]bQ�ԧ � users.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Users list controller class.
*
* @since 1.6
*/
class UsersControllerUsers extends JControllerAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_USERS';
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @since 1.6
* @see JController
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('block', 'changeBlock');
$this->registerTask('unblock', 'changeBlock');
}
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'User', $prefix = 'UsersModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to change the block status on a record.
*
* @return void
*
* @since 1.6
*/
public function changeBlock()
{
// Check for request forgeries.
$this->checkToken();
$ids = (array) $this->input->get('cid', array(), 'int');
$values = array('block' => 1, 'unblock' => 0);
$task = $this->getTask();
$value = ArrayHelper::getValue($values, $task, 0, 'int');
// Remove zero values resulting from input filter
$ids = array_filter($ids);
if (empty($ids))
{
JError::raiseWarning(500, JText::_('COM_USERS_USERS_NO_ITEM_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Change the state of the records.
if (!$model->block($ids, $value))
{
JError::raiseWarning(500, $model->getError());
}
else
{
if ($value == 1)
{
$this->setMessage(JText::plural('COM_USERS_N_USERS_BLOCKED', count($ids)));
}
elseif ($value == 0)
{
$this->setMessage(JText::plural('COM_USERS_N_USERS_UNBLOCKED', count($ids)));
}
}
}
$this->setRedirect('index.php?option=com_users&view=users');
}
/**
* Method to activate a record.
*
* @return void
*
* @since 1.6
*/
public function activate()
{
// Check for request forgeries.
$this->checkToken();
$ids = (array) $this->input->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$ids = array_filter($ids);
if (empty($ids))
{
JError::raiseWarning(500, JText::_('COM_USERS_USERS_NO_ITEM_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Change the state of the records.
if (!$model->activate($ids))
{
JError::raiseWarning(500, $model->getError());
}
else
{
$this->setMessage(JText::plural('COM_USERS_N_USERS_ACTIVATED', count($ids)));
}
}
$this->setRedirect('index.php?option=com_users&view=users');
}
}
PK .`$]�h+�� �
levels.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User view levels list controller class.
*
* @since 1.6
*/
class UsersControllerLevels extends JControllerAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_LEVELS';
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'Level', $prefix = 'UsersModel', $config = array())
{
return parent::getModel($name, $prefix, array('ignore_request' => true));
}
}
PK .`$]T�U�� � notes.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User notes controller class.
*
* @since 2.5
*/
class UsersControllerNotes extends JControllerAdmin
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 2.5
*/
protected $text_prefix = 'COM_USERS_NOTES';
/**
* Method to get a model object, loading it if required.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 2.5
*/
public function getModel($name = 'Note', $prefix = 'UsersModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK .`$]=�-�m m group.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User view level controller class.
*
* @since 1.6
*/
class UsersControllerGroup extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_GROUP';
/**
* Method to check if you can save a new or existing record.
*
* Overrides JControllerForm::allowSave to check the core.admin permission.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowSave($data, $key = 'id')
{
return (JFactory::getUser()->authorise('core.admin', $this->option) && parent::allowSave($data, $key));
}
/**
* Overrides JControllerForm::allowEdit
*
* Checks that non-Super Admins are not editing Super Admins.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check if this group is a Super Admin
if (JAccess::checkGroup($data[$key], 'core.admin'))
{
// If I'm not a Super Admin, then disallow the edit.
if (!JFactory::getUser()->authorise('core.admin'))
{
return false;
}
}
return parent::allowEdit($data, $key);
}
}
PK .`$]�U� �
groups.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User groups list controller class.
*
* @since 1.6
*/
class UsersControllerGroups extends JControllerAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_GROUPS';
/**
* Proxy for getModel.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'Group', $prefix = 'UsersModel', $config = array())
{
return parent::getModel($name, $prefix, array('ignore_request' => true));
}
/**
* Removes an item.
*
* Overrides JControllerAdmin::delete to check the core.admin permission.
*
* @return boolean Returns true on success, false on failure.
*
* @since 1.6
*/
public function delete()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::delete();
}
/**
* Method to publish a list of records.
*
* Overrides JControllerAdmin::publish to check the core.admin permission.
*
* @return void
*
* @since 1.6
*/
public function publish()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::publish();
}
/**
* Changes the order of one or more records.
*
* Overrides JControllerAdmin::reorder to check the core.admin permission.
*
* @return boolean True on success
*
* @since 1.6
*/
public function reorder()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::reorder();
}
/**
* Method to save the submitted ordering values for records.
*
* Overrides JControllerAdmin::saveorder to check the core.admin permission.
*
* @return boolean True on success
*
* @since 1.6
*/
public function saveorder()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::saveorder();
}
/**
* Check in of one or more records.
*
* Overrides JControllerAdmin::checkin to check the core.admin permission.
*
* @return boolean True on success
*
* @since 1.6
*/
public function checkin()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option))
{
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::checkin();
}
}
PK .`$]ҋ��S S note.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User note controller class.
*
* @since 2.5
*/
class UsersControllerNote extends JControllerForm
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 2.5
*/
protected $text_prefix = 'COM_USERS_NOTE';
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $key The name of the primary key variable.
*
* @return string The arguments to append to the redirect URL.
*
* @since 2.5
*/
protected function getRedirectToItemAppend($recordId = null, $key = 'id')
{
$append = parent::getRedirectToItemAppend($recordId, $key);
$userId = JFactory::getApplication()->input->get('u_id', 0, 'int');
if ($userId)
{
$append .= '&u_id=' . $userId;
}
return $append;
}
}
PK :`$]"��Kg g
file.json.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
/**
* File Media Controller
*
* @since 1.6
*/
class MediaControllerFile extends JControllerLegacy
{
/**
* Upload a file
*
* @return void
*
* @since 1.5
*/
public function upload()
{
$params = JComponentHelper::getParams('com_media');
// Check for request forgeries
if (!JSession::checkToken('request'))
{
$response = array(
'status' => '0',
'message' => JText::_('JINVALID_TOKEN'),
'error' => JText::_('JINVALID_TOKEN')
);
echo json_encode($response);
return;
}
// Get the user
$user = JFactory::getUser();
JLog::addLogger(array('text_file' => 'upload.error.php'), JLog::ALL, array('upload'));
// Get some data from the request
$file = $this->input->files->get('Filedata', '', 'array');
$folder = $this->input->get('folder', '', 'path');
// Instantiate the media helper
$mediaHelper = new JHelperMedia;
if ($_SERVER['CONTENT_LENGTH'] > ($params->get('upload_maxsize', 0) * 1024 * 1024)
|| $_SERVER['CONTENT_LENGTH'] > $mediaHelper->toBytes(ini_get('upload_max_filesize'))
|| $_SERVER['CONTENT_LENGTH'] > $mediaHelper->toBytes(ini_get('post_max_size'))
|| $_SERVER['CONTENT_LENGTH'] > $mediaHelper->toBytes(ini_get('memory_limit')))
{
$response = array(
'status' => '0',
'message' => JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'),
'error' => JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE')
);
echo json_encode($response);
return;
}
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
if (isset($file['name']))
{
// Make the filename safe
$file['name'] = JFile::makeSafe($file['name']);
// We need a URL safe name
$fileparts = pathinfo(COM_MEDIA_BASE . '/' . $folder . '/' . $file['name']);
// Transform filename to punycode
$fileparts['filename'] = JStringPunycode::toPunycode($fileparts['filename']);
$tempExt = !empty($fileparts['extension']) ? strtolower($fileparts['extension']) : '';
// Transform filename to punycode, then neglect other than non-alphanumeric characters & underscores. Also transform extension to lowercase
$safeFileName = preg_replace(array("/[\\s]/", '/[^a-zA-Z0-9_\-]/'), array('_', ''), $fileparts['filename']) . '.' . $tempExt;
// Create filepath with safe-filename
$files['final'] = $fileparts['dirname'] . DIRECTORY_SEPARATOR . $safeFileName;
$file['name'] = $safeFileName;
$filepath = JPath::clean($files['final']);
if (!$mediaHelper->canUpload($file, 'com_media')
|| strpos(realpath($fileparts['dirname']), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
try
{
JLog::add('Invalid: ' . $filepath, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'message' => JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE'),
'error' => JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE')
);
echo json_encode($response);
return;
}
// Trigger the onContentBeforeSave event.
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$object_file = new JObject($file);
$object_file->filepath = $filepath;
$result = $dispatcher->trigger('onContentBeforeSave', array('com_media.file', &$object_file, true));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
try
{
JLog::add(
'Errors before save: ' . $object_file->filepath . ' : ' . implode(', ', $object_file->getErrors()),
JLog::INFO,
'upload'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'message' => JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors)),
'error' => JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors))
);
echo json_encode($response);
return;
}
if (JFile::exists($object_file->filepath))
{
// File exists
try
{
JLog::add('File exists: ' . $object_file->filepath . ' by user_id ' . $user->id, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'message' => JText::_('COM_MEDIA_ERROR_FILE_EXISTS'),
'error' => JText::_('COM_MEDIA_ERROR_FILE_EXISTS'),
'location' => str_replace(JPATH_ROOT, '', $filepath)
);
echo json_encode($response);
return;
}
elseif (!$user->authorise('core.create', 'com_media'))
{
// File does not exist and user is not authorised to create
try
{
JLog::add('Create not permitted: ' . $object_file->filepath . ' by user_id ' . $user->id, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'error' => JText::_('COM_MEDIA_ERROR_CREATE_NOT_PERMITTED'),
'message' => JText::_('COM_MEDIA_ERROR_CREATE_NOT_PERMITTED')
);
echo json_encode($response);
return;
}
if (!JFile::upload($object_file->tmp_name, $object_file->filepath))
{
// Error in upload
try
{
JLog::add('Error on upload: ' . $object_file->filepath, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$response = array(
'status' => '0',
'message' => JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE'),
'error' => JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE')
);
echo json_encode($response);
return;
}
else
{
// Trigger the onContentAfterSave event.
$dispatcher->trigger('onContentAfterSave', array('com_media.file', &$object_file, true));
try
{
JLog::add($folder, JLog::INFO, 'upload');
}
catch (RuntimeException $exception)
{
// Informational log only
}
$returnUrl = str_replace(JPATH_ROOT, '', $object_file->filepath);
$response = array(
'status' => '1',
'message' => JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', $returnUrl),
'error' => JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', $returnUrl),
'location' => str_replace('\\', '/', $returnUrl)
);
echo json_encode($response);
return;
}
}
else
{
$response = array(
'status' => '0',
'error' => JText::_('COM_MEDIA_ERROR_BAD_REQUEST'),
'message' => JText::_('COM_MEDIA_ERROR_BAD_REQUEST')
);
echo json_encode($response);
return;
}
}
}
PK :`$]���) ) file.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
/**
* Media File Controller
*
* @since 1.5
*/
class MediaControllerFile extends JControllerLegacy
{
/**
* The folder we are uploading into
*
* @var string
*/
protected $folder = '';
/**
* Upload one or more files
*
* @return boolean
*
* @since 1.5
*/
public function upload()
{
// Check for request forgeries
$this->checkToken('request');
$params = JComponentHelper::getParams('com_media');
// Get some data from the request
$files = $this->input->files->get('Filedata', array(), 'array');
$return = JFactory::getSession()->get('com_media.return_url');
$this->folder = $this->input->get('folder', '', 'path');
// Instantiate the media helper
$mediaHelper = new JHelperMedia;
// Don't redirect to an external URL.
if (!JUri::isInternal($return))
{
$return = '';
}
// Set the redirect
if ($return)
{
$this->setRedirect($return . '&folder=' . $this->folder);
}
else
{
$this->setRedirect('index.php?option=com_media&folder=' . $this->folder);
}
// First check against unfiltered input.
if (!$this->input->files->get('Filedata', null, 'RAW'))
{
// Total length of post back data in bytes.
$contentLength = $this->input->server->get('CONTENT_LENGTH', 0, 'INT');
// Maximum allowed size of post back data in MB.
$postMaxSize = $mediaHelper->toBytes(ini_get('post_max_size'));
// Maximum allowed size of script execution in MB.
$memoryLimit = $mediaHelper->toBytes(ini_get('memory_limit'));
// Check for the total size of post back data.
if (($postMaxSize > 0 && $contentLength > $postMaxSize)
|| ($memoryLimit != -1 && $contentLength > $memoryLimit))
{
// Files are too large.
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNUPLOADTOOLARGE'));
return false;
}
// No files were provided.
$this->setMessage(JText::_('COM_MEDIA_ERROR_UPLOAD_INPUT'), 'warning');
return false;
}
if (!$files)
{
// Files were provided but are unsafe to upload.
$this->setMessage(JText::_('COM_MEDIA_ERROR_WARNFILENOTSAFE'), 'error');
return false;
}
// Authorize the user
if (!$this->authoriseUser('create'))
{
return false;
}
$uploadMaxSize = $params->get('upload_maxsize', 0) * 1024 * 1024;
$uploadMaxFileSize = $mediaHelper->toBytes(ini_get('upload_max_filesize'));
// Perform basic checks on file info before attempting anything
foreach ($files as &$file)
{
// Make the filename safe
$file['name'] = JFile::makeSafe($file['name']);
// We need a url safe name
$fileparts = pathinfo(COM_MEDIA_BASE . '/' . $this->folder . '/' . $file['name']);
if (strpos(realpath($fileparts['dirname']), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER'));
return false;
}
// Transform filename to punycode, check extension and transform it to lowercase
$fileparts['filename'] = JStringPunycode::toPunycode($fileparts['filename']);
$tempExt = !empty($fileparts['extension']) ? strtolower($fileparts['extension']) : '';
// Neglect other than non-alphanumeric characters, hyphens & underscores.
$safeFileName = preg_replace(array("/[\\s]/", '/[^a-zA-Z0-9_\-]/'), array('_', ''), $fileparts['filename']) . '.' . $tempExt;
$file['name'] = $safeFileName;
$file['filepath'] = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $this->folder, $file['name'])));
if (($file['error'] == 1)
|| ($uploadMaxSize > 0 && $file['size'] > $uploadMaxSize)
|| ($uploadMaxFileSize > 0 && $file['size'] > $uploadMaxFileSize))
{
// File size exceed either 'upload_max_filesize' or 'upload_maxsize'.
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'));
return false;
}
if (JFile::exists($file['filepath']))
{
// A file with this name already exists
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_FILE_EXISTS'));
return false;
}
if (!isset($file['name']))
{
// No filename (after the name was cleaned by JFile::makeSafe)
$this->setRedirect('index.php', JText::_('COM_MEDIA_INVALID_REQUEST'), 'error');
return false;
}
}
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
foreach ($files as &$file)
{
// The request is valid
$err = null;
if (!MediaHelper::canUpload($file, $err))
{
// The file can't be uploaded
return false;
}
// Trigger the onContentBeforeSave event.
$object_file = new JObject($file);
$result = $dispatcher->trigger('onContentBeforeSave', array('com_media.file', &$object_file, true));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors)));
return false;
}
if (!JFile::upload($object_file->tmp_name, $object_file->filepath))
{
// Error in upload
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE'));
return false;
}
// Trigger the onContentAfterSave event.
$dispatcher->trigger('onContentAfterSave', array('com_media.file', &$object_file, true));
$this->setMessage(JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
return true;
}
/**
* Check that the user is authorized to perform this action
*
* @param string $action - the action to be performed (create or delete)
*
* @return boolean
*
* @since 1.6
*/
protected function authoriseUser($action)
{
if (!JFactory::getUser()->authorise('core.' . strtolower($action), 'com_media'))
{
// User is not authorised
JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_' . strtoupper($action) . '_NOT_PERMITTED'));
return false;
}
return true;
}
/**
* Deletes paths from the current path
*
* @return boolean
*
* @since 1.5
*/
public function delete()
{
$this->checkToken('request');
$user = JFactory::getUser();
// Get some data from the request
$tmpl = $this->input->get('tmpl');
$paths = $this->input->get('rm', array(), 'array');
$folder = $this->input->get('folder', '', 'path');
$redirect = 'index.php?option=com_media&folder=' . $folder;
if ($tmpl == 'component')
{
// We are inside the iframe
$redirect .= '&view=mediaList&tmpl=component';
}
$this->setRedirect($redirect);
// Just return if there's nothing to do
if (empty($paths))
{
$this->setMessage(JText::_('JERROR_NO_ITEMS_SELECTED'), 'error');
return true;
}
if (!$user->authorise('core.delete', 'com_media'))
{
// User is not authorised to delete
JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'));
return false;
}
// Need this to enqueue messages.
$app = JFactory::getApplication();
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$ret = true;
$safePaths = array_intersect($paths, array_map(array('JFile', 'makeSafe'), $paths));
foreach ($safePaths as $key => $path)
{
$fullPath = implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path));
if (strpos(realpath($fullPath), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
unset($safePaths[$key]);
}
}
$unsafePaths = array_diff($paths, $safePaths);
foreach ($unsafePaths as $path)
{
$path = JPath::clean(implode(DIRECTORY_SEPARATOR, array($folder, $path)));
$path = htmlspecialchars($path, ENT_COMPAT, 'UTF-8');
$app->enqueueMessage(JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FILE_WARNFILENAME', $path), 'error');
}
foreach ($safePaths as $path)
{
$fullPath = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path)));
$object_file = new JObject(array('filepath' => $fullPath));
if (is_file($object_file->filepath))
{
// Trigger the onContentBeforeDelete event.
$result = $dispatcher->trigger('onContentBeforeDelete', array('com_media.file', &$object_file));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
$errors = $object_file->getErrors();
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors), implode('<br />', $errors)));
continue;
}
$ret &= JFile::delete($object_file->filepath);
// Trigger the onContentAfterDelete event.
$dispatcher->trigger('onContentAfterDelete', array('com_media.file', &$object_file));
$app->enqueueMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
elseif (is_dir($object_file->filepath))
{
$contents = JFolder::files($object_file->filepath, '.', true, false, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html'));
if (!empty($contents))
{
// This makes no sense...
$folderPath = substr($object_file->filepath, strlen(COM_MEDIA_BASE));
JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_NOT_EMPTY', $folderPath));
continue;
}
// Trigger the onContentBeforeDelete event.
$result = $dispatcher->trigger('onContentBeforeDelete', array('com_media.folder', &$object_file));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
$errors = $object_file->getErrors();
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors), implode('<br />', $errors)));
continue;
}
$ret &= !JFolder::delete($object_file->filepath);
// Trigger the onContentAfterDelete event.
$dispatcher->trigger('onContentAfterDelete', array('com_media.folder', &$object_file));
$app->enqueueMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
}
return $ret;
}
}
PK :`$]��N� �
folder.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
/**
* Folder Media Controller
*
* @since 1.5
*/
class MediaControllerFolder extends JControllerLegacy
{
/**
* Deletes paths from the current path
*
* @return boolean
*
* @since 1.5
*/
public function delete()
{
$this->checkToken('request');
$user = JFactory::getUser();
// Get some data from the request
$tmpl = $this->input->get('tmpl');
$paths = $this->input->get('rm', array(), 'array');
$folder = $this->input->get('folder', '', 'path');
$redirect = 'index.php?option=com_media&folder=' . $folder;
if ($tmpl == 'component')
{
// We are inside the iframe
$redirect .= '&view=mediaList&tmpl=component';
}
$this->setRedirect($redirect);
// Just return if there's nothing to do
if (empty($paths))
{
$this->setMessage(JText::_('JERROR_NO_ITEMS_SELECTED'), 'error');
return true;
}
if (!$user->authorise('core.delete', 'com_media'))
{
// User is not authorised to delete
JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'));
return false;
}
// Need this to enqueue messages.
$app = JFactory::getApplication();
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$ret = true;
$safePaths = array_intersect($paths, array_map(array('JFile', 'makeSafe'), $paths));
$unsafePaths = array_diff($paths, $safePaths);
foreach ($unsafePaths as $path)
{
$path = JPath::clean(implode(DIRECTORY_SEPARATOR, array($folder, $path)));
$path = htmlspecialchars($path, ENT_COMPAT, 'UTF-8');
$app->enqueueMessage(JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FILE_WARNFILENAME', $path), 'error');
}
foreach ($safePaths as $path)
{
$fullPath = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path)));
if (strpos(realpath($fullPath), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER'));
continue;
}
$object_file = new JObject(array('filepath' => $fullPath));
if (is_file($object_file->filepath))
{
// Trigger the onContentBeforeDelete event.
$result = $dispatcher->trigger('onContentBeforeDelete', array('com_media.file', &$object_file));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
$errors = $object_file->getErrors();
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors), implode('<br />', $errors)));
continue;
}
$ret &= JFile::delete($object_file->filepath);
// Trigger the onContentAfterDelete event.
$dispatcher->trigger('onContentAfterDelete', array('com_media.file', &$object_file));
$app->enqueueMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
elseif (is_dir($object_file->filepath))
{
$contents = JFolder::files($object_file->filepath, '.', true, false, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html'));
if (!empty($contents))
{
// This makes no sense...
$folderPath = substr($object_file->filepath, strlen(COM_MEDIA_BASE));
JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_NOT_EMPTY', $folderPath));
continue;
}
// Trigger the onContentBeforeDelete event.
$result = $dispatcher->trigger('onContentBeforeDelete', array('com_media.folder', &$object_file));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
$errors = $object_file->getErrors();
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors), implode('<br />', $errors)));
continue;
}
$ret &= !JFolder::delete($object_file->filepath);
// Trigger the onContentAfterDelete event.
$dispatcher->trigger('onContentAfterDelete', array('com_media.folder', &$object_file));
$app->enqueueMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
}
return $ret;
}
/**
* Create a folder
*
* @return boolean
*
* @since 1.5
*/
public function create()
{
// Check for request forgeries
$this->checkToken();
$user = JFactory::getUser();
$folder = $this->input->get('foldername', '');
$folderCheck = (string) $this->input->get('foldername', null, 'raw');
$parent = $this->input->get('folderbase', '', 'path');
$this->setRedirect('index.php?option=com_media&folder=' . $parent . '&tmpl=' . $this->input->get('tmpl', 'index'));
if (strlen($folder) > 0)
{
if (!$user->authorise('core.create', 'com_media'))
{
// User is not authorised to create
JError::raiseWarning(403, JText::_('COM_MEDIA_ERROR_CREATE_NOT_PERMITTED'));
return false;
}
// Set FTP credentials, if given
JClientHelper::setCredentialsFromRequest('ftp');
$this->input->set('folder', $parent);
if (($folderCheck !== null) && ($folder !== $folderCheck))
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_MEDIA_ERROR_UNABLE_TO_CREATE_FOLDER_WARNDIRNAME'), 'warning');
return false;
}
$path = JPath::clean(COM_MEDIA_BASE . '/' . $parent . '/' . $folder);
if (strpos(realpath(COM_MEDIA_BASE . '/' . $parent), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_MEDIA_ERROR_WARNINVALID_FOLDER'), 'error');
return false;
}
if (!is_dir($path) && !is_file($path))
{
// Trigger the onContentBeforeSave event.
$object_file = new JObject(array('filepath' => $path));
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$result = $dispatcher->trigger('onContentBeforeSave', array('com_media.folder', &$object_file, true));
if (in_array(false, $result, true))
{
// There are some errors in the plugins
JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('<br />', $errors)));
return false;
}
if (JFolder::create($object_file->filepath))
{
$data = "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($object_file->filepath . '/index.html', $data);
// Trigger the onContentAfterSave event.
$dispatcher->trigger('onContentAfterSave', array('com_media.folder', &$object_file, true));
$this->setMessage(JText::sprintf('COM_MEDIA_CREATE_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
}
$this->input->set('folder', ($parent) ? $parent . '/' . $folder : $folder);
}
else
{
// File name is of zero length (null).
JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_UNABLE_TO_CREATE_FOLDER_WARNDIRNAME'));
return false;
}
return true;
}
}
PK �`$]�;(� � history.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_contenthistory
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Contenthistory list controller class.
*
* @since 3.2
*/
class ContenthistoryControllerHistory extends JControllerAdmin
{
/**
* Deletes and returns correctly.
*
* @return void
*
* @since 3.2
*/
public function delete()
{
$this->checkToken();
// Get items to remove from the request.
$cid = (array) $this->input->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$cid = array_filter($cid);
if (empty($cid))
{
JError::raiseWarning(500, JText::_('COM_CONTENTHISTORY_NO_ITEM_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Remove the items.
if ($model->delete($cid))
{
$this->setMessage(JText::plural('COM_CONTENTHISTORY_N_ITEMS_DELETED', count($cid)));
}
else
{
$this->setMessage($model->getError());
}
}
$this->setRedirect(
JRoute::_(
'index.php?option=com_contenthistory&view=history&layout=modal&tmpl=component&item_id='
. $this->input->getInt('item_id') . '&type_id=' . $this->input->getInt('type_id')
. '&type_alias=' . $this->input->getCmd('type_alias') . '&' . JSession::getFormToken() . '=1', false
)
);
}
/**
* Proxy for getModel.
*
* @param string $name The name of the model
* @param string $prefix The prefix for the model
* @param array $config An additional array of parameters
*
* @return JModelLegacy The model
*
* @since 3.2
*/
public function getModel($name = 'History', $prefix = 'ContenthistoryModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Toggles the keep forever value for one or more history rows. If it was Yes, changes to No. If No, changes to Yes.
*
* @return void
*
* @since 3.2
*/
public function keep()
{
$this->checkToken();
// Get items to remove from the request.
$cid = (array) $this->input->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$cid = array_filter($cid);
if (empty($cid))
{
JError::raiseWarning(500, JText::_('COM_CONTENTHISTORY_NO_ITEM_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Remove the items.
if ($model->keep($cid))
{
$this->setMessage(JText::plural('COM_CONTENTHISTORY_N_ITEMS_KEEP_TOGGLE', count($cid)));
}
else
{
$this->setMessage($model->getError());
}
}
$this->setRedirect(
JRoute::_(
'index.php?option=com_contenthistory&view=history&layout=modal&tmpl=component&item_id='
. $this->input->getInt('item_id') . '&type_id=' . $this->input->getInt('type_id')
. '&type_alias=' . $this->input->getCmd('type_alias') . '&' . JSession::getFormToken() . '=1', false
)
);
}
}
PK �`$]���Y Y preview.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_contenthistory
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Contenthistory list controller class.
*
* @since 3.2
*/
class ContenthistoryControllerPreview extends JControllerLegacy
{
/**
* Proxy for getModel.
*
* @param string $name The name of the model
* @param string $prefix The prefix for the model
* @param array $config An additional array of parameters
*
* @return JModelLegacy The model
*
* @since 3.2
*/
public function getModel($name = 'Preview', $prefix = 'ContenthistoryModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK �b$]�3� � links.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_redirect
*
* @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;
/**
* Redirect link list controller class.
*
* @since 1.6
*/
class RedirectControllerLinks extends JControllerAdmin
{
/**
* Method to update 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_REDIRECT_NO_ITEM_SELECTED'));
}
else
{
$newUrl = $this->input->getString('new_url');
$comment = $this->input->getString('comment');
// Get the model.
$model = $this->getModel();
// Remove the items.
if (!$model->activate($ids, $newUrl, $comment))
{
JError::raiseWarning(500, $model->getError());
}
else
{
$this->setMessage(JText::plural('COM_REDIRECT_N_LINKS_UPDATED', count($ids)));
}
}
$this->setRedirect('index.php?option=com_redirect&view=links');
}
/**
* Method to duplicate URLs in records.
*
* @return void
*
* @since 3.6.0
*/
public function duplicateUrls()
{
// 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_REDIRECT_NO_ITEM_SELECTED'));
}
else
{
$newUrl = $this->input->getString('new_url');
$comment = $this->input->getString('comment');
// Get the model.
$model = $this->getModel();
// Remove the items.
if (!$model->duplicateUrls($ids, $newUrl, $comment))
{
JError::raiseWarning(500, $model->getError());
}
else
{
$this->setMessage(JText::plural('COM_REDIRECT_N_LINKS_UPDATED', count($ids)));
}
}
$this->setRedirect('index.php?option=com_redirect&view=links');
}
/**
* Proxy for getModel.
*
* @param string $name The name of the model.
* @param string $prefix The prefix of the model.
* @param array $config An array of settings.
*
* @return JModel instance
*
* @since 1.6
*/
public function getModel($name = 'Link', $prefix = 'RedirectModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Executes the batch process to add URLs to the database
*
* @return void
*/
public function batch()
{
// Check for request forgeries.
$this->checkToken();
$batch_urls_request = $this->input->post->get('batch_urls', array(), 'array');
$batch_urls_lines = array_map('trim', explode("\n", $batch_urls_request[0]));
$batch_urls = array();
foreach ($batch_urls_lines as $batch_urls_line)
{
if (!empty($batch_urls_line))
{
$params = JComponentHelper::getParams('com_redirect');
$separator = $params->get('separator', '|');
// Basic check to make sure the correct separator is being used
if (!\Joomla\String\StringHelper::strpos($batch_urls_line, $separator))
{
$this->setMessage(JText::sprintf('COM_REDIRECT_NO_SEPARATOR_FOUND', $separator), 'error');
$this->setRedirect('index.php?option=com_redirect&view=links');
return false;
}
$batch_urls[] = array_map('trim', explode($separator, $batch_urls_line));
}
}
// Set default message on error - overwrite if successful
$this->setMessage(JText::_('COM_REDIRECT_NO_ITEM_ADDED'), 'error');
if (!empty($batch_urls))
{
$model = $this->getModel('Links');
// Execute the batch process
if ($model->batchProcess($batch_urls))
{
$this->setMessage(JText::plural('COM_REDIRECT_N_LINKS_ADDED', count($batch_urls)));
}
}
$this->setRedirect('index.php?option=com_redirect&view=links');
}
/**
* Clean out the unpublished links.
*
* @return void
*
* @since 3.5
*/
public function purge()
{
// Check for request forgeries.
$this->checkToken();
$model = $this->getModel('Links');
if ($model->purge())
{
$message = JText::_('COM_REDIRECT_CLEAR_SUCCESS');
}
else
{
$message = JText::_('COM_REDIRECT_CLEAR_FAIL');
}
$this->setRedirect('index.php?option=com_redirect&view=links', $message);
}
}
PK �b$]>���� � link.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_redirect
*
* @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;
/**
* Redirect link controller class.
*
* @since 1.6
*/
class RedirectControllerLink extends JControllerForm
{
// Parent class access checks are sufficient for this controller.
}
PK c$]�8�:Y Y message.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_postinstall
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* 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 c$]���Yl l messages.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Messages list controller class.
*
* @since 1.6
*/
class MessagesControllerMessages extends JControllerAdmin
{
/**
* Method to get a model object, loading it if required.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'Message', $prefix = 'MessagesModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK c$]�n|F� �
config.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Messages Component Message Model
*
* @since 1.6
*/
class MessagesControllerConfig extends JControllerLegacy
{
/**
* Method to save a record.
*
* @return boolean
*
* @since 1.6
*/
public function save()
{
// Check for request forgeries.
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel('Config', 'MessagesModel');
$data = $this->input->post->get('jform', array(), 'array');
// Validate the posted data.
$form = $model->getForm();
if (!$form)
{
JError::raiseError(500, $model->getError());
return false;
}
$data = $model->validate($form, $data);
// Check for validation errors.
if ($data === false)
{
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
{
if ($errors[$i] instanceof Exception)
{
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
}
else
{
$app->enqueueMessage($errors[$i], 'warning');
}
}
// Redirect back to the main list.
$this->setRedirect(JRoute::_('index.php?option=com_messages&view=messages', false));
return false;
}
// Attempt to save the data.
if (!$model->save($data))
{
// Redirect back to the main list.
$this->setMessage(JText::sprintf('JERROR_SAVE_FAILED', $model->getError()), 'warning');
$this->setRedirect(JRoute::_('index.php?option=com_messages&view=messages', false));
return false;
}
// Redirect to the list screen.
$this->setMessage(JText::_('COM_MESSAGES_CONFIG_SAVED'));
$this->setRedirect(JRoute::_('index.php?option=com_messages&view=messages', false));
return true;
}
}
PK k$]m�6�v v ajax.phpnu &1i� <?php
/**
* @name Slideshow CK
* @package com_slideshowck
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
*/
// No direct access
defined('CK_LOADED') or die;
use \Slideshowck\CKController;
use \Slideshowck\CKFof;
use \Slideshowck\CKText;
class SlideshowckControllerAjax extends CKController {
function __construct() {
// security check
if (! CKFof::checkAjaxToken()) exit;
parent::__construct();
$plugin = $this->input->get('plugin', '', 'cmd');
$task = $this->input->get('task', '', 'cmd');
if ($plugin) {
if (file_exists(SLIDESHOWCK_PLUGINS_PATH . '/' . $plugin . '/helper/helper_' . $plugin . '.php')) {
require_once(SLIDESHOWCK_PLUGINS_PATH . '/' . $plugin . '/helper/helper_' . $plugin . '.php');
$className = 'SlideshowckHelpersource' . ucfirst($plugin);
//SlideshowckHelpersourceArticles
$class = new $className();
if (method_exists($class, $task)) {
$class::$task();
exit;
}
}
}
die;
}
}
PK k$]T�z� �
browse.phpnu &1i� <?php
/**
* @name Slideshow CK
* @package com_slideshowck
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
*/
// No direct access
defined('CK_LOADED') or die;
use Slideshowck\CKController;
use Slideshowck\CKFof;
require_once SLIDESHOWCK_PATH . '/helpers/ckbrowse.php';
class SlideshowckControllerBrowse extends CKController {
public function getFiles() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$folder = $this->input->get('folder', '', 'string');
$type = $this->input->get('type', '', 'string');
$filetypes = CKBrowse::getFileTypes($type);
$files = CKBrowse::getImagesInFolder(JPATH_SITE . '/' . $folder, implode('|', $filetypes));
if ($type == 'folder') {
$pathway = str_replace('/', '</span><span class="ckfoldertreepath">', $folder);
?>
<div id="ckfoldertreelistfolderselection">
<div class="ckbutton ckbutton-primary" style="font-size:20px;padding: 10px 20px;" onclick="ckSelectFolder('<?php echo ($folder) ?>')"><i class="fas fa-check-square"></i> <?php echo \Joomla\CMS\Language\Text::_('CK_SELECT_FOLDER') ?><br /><small><?php echo $pathway ?></small></div>
</div>
<?php }
if (empty($files)) {
echo \Joomla\CMS\Language\Text::_('CK_NO_IMAGE_FOUND');
} else {
foreach($files as $file) {
?>
<div class="ckfoldertreefile" data-type="<?php echo $type ?>" onclick="ckSelectFile(this)" data-path="<?php echo iconv('ISO-8859-1', 'UTF-8', $folder) ?>" data-filename="<?php echo iconv('ISO-8859-1', 'UTF-8', $file) ?>">
<img src="<?php echo \Joomla\CMS\Uri\Uri::root(true) . '/' . iconv('ISO-8859-1', 'UTF-8', $folder) . '/' . iconv('ISO-8859-1', 'UTF-8', $file) ?>" title="<?php echo iconv('ISO-8859-1', 'UTF-8', $file); ?>" loading="lazy">
<div class="ckimagetitle"><?php echo iconv('ISO-8859-1', 'UTF-8', $file); ?></div>
</div>
<?php
}
}
exit;
}
}
PK k$]�Yr�� �
styles.phpnu &1i� <?php
/**
* @name Slider CK
* @package com_slideshowck
* @copyright Copyright (C) 2016. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr
*/
// No direct access.
defined('_JEXEC') or die;
jimport('joomla.application.component.controlleradmin');
/**
* Pages list controller class.
*/
class SlideshowckControllerStyles extends \Joomla\CMS\MVC\Controller\AdminController {
/**
* Proxy for getModel.
* @since 1.6
*/
public function getModel($name = 'style', $prefix = 'SlideshowckModel', $config = array()) {
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}PK k$]wtW�
index.htmlnu &1i� <html><body></body></html>PK k$]�Ym m style.phpnu &1i� <?php
/**
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr
*/
// No direct access
defined('_JEXEC') or die;
use \Slideshowck\CKController;
use \Slideshowck\CKFof;
class SlideshowckControllerStyle extends CKController {
// public function add() {
// $this->edit(0);
// Redirect to the edit screen.
// CKFof::redirect(SLIDESHOWCK_ADMIN_URL . '&view=style&layout=edit&id=0&tmpl=component&layout=modal');
// }
// public function edit($id = null, $appendUrl = '') {
// parent::edit($id, '&layout=modal&tmpl=component');
// }
//
// public function copy() {
// parent::edit('&layout=modal&tmpl=component');
// }
/*
* Generate the CSS styles from the settings
*/
public function save() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$id = $this->input->get('id', 0, 'int');
$model = $this->getModel();
$row = $model->getItem($id);
// get data
$fields = $this->input->get('fields', '', 'raw');
$name = $this->input->get('name', '', 'string');
if (! $name) $name = 'style' . $id;
$layoutcss = trim($this->input->get('layoutcss', '', 'html'));
// set data
$row->params = $fields;
$row->name = $name;
$row->layoutcss = $layoutcss;
if (! $id = $model->save($row)) {
echo "{'result': '0', 'id': '" . $row->id . "', 'message': 'Error : Can not save the Styles !'}";
echo($this->_db->getErrorMsg());
exit;
}
echo '{"result": "1", "id": "' . $id . '", "message": "Styles saved successfully"}';
exit;
}
/**
* copy an existing page
* @return void
*/
// function copy() {
// $model = $this->getModel();
// $cid = $this->input->get('cid', '', 'array');
// $this->input->set('id', (int) $cid[0]);
// if (!$model->copy()) {
// $msg = \Joomla\CMS\Language\Text::_('CK_COPY_ERROR');
// $type = 'error';
// } else {
// $msg = \Joomla\CMS\Language\Text::_('CK_COPY_SUCCESS');
// $type = 'message';
// }
//
// $this->setRedirect('index.php?option=com_slideshowck&view=styles', $msg, $type);
// }
/*
* Generate the CSS styles from the settings
*/
public function ajaxRenderCss() {
$fields = $this->input->get('fields', '', 'raw');
$fields = json_decode($fields);
$customstyles = stripslashes( $this->input->get('customstyles', '', 'string'));
$customstyles = json_decode($customstyles);
$customcss = $this->input->get('customcss', '', 'html');
$css = $this->renderCss($fields, $customstyles);
echo $css . $customcss;
exit();
}
/*
* Render the CSS from the settings
*/
public function renderCss($fields, $customstyles) {
include_once SLIDESHOWCK_PATH . '/helpers/ckstyles.php';
$ckstyles = new \Slideshowck\CKStyles();
$css = $ckstyles->create($fields, $customstyles);
return $css;
}
/**
* Ajax method to save the json data into the .mmck file
*
* @return boolean - true on success for the file creation
*
*/
public function exportParams() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
// create a backup file with all fields stored in it
$fields = $this->input->get('jsonfields', '', 'string');
$backupfile_path = SLIDESHOWCK_PATH . '/export/exportParamsSlideshowckStyle'. $this->input->get('styleid',0,'int') .'.mmck';
if (file_put_contents($backupfile_path, $fields)) {
echo '1';
} else {
echo '0';
}
exit();
}
/**
* Ajax method to import the .mmck file into the interface
*
* @return boolean - true on success for the file creation
*
*/
public function uploadParamsFile() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$file = $this->input->files->get('file', '', 'array');
if (!is_array($file))
exit();
$filename = \Joomla\CMS\Filesystem\File::makeSafe($file['name']);
// check if the file exists
if (\Joomla\CMS\Filesystem\File::getExt($filename) != 'mmck') {
$msg = \Joomla\CMS\Language\Text::_('CK_NOT_MMCK_FILE', true);
echo json_encode(array('error'=> $msg));
exit();
}
//Set up the source and destination of the file
$src = $file['tmp_name'];
// check if the file exists
if (!$src || !\Joomla\CMS\Filesystem\File::exists($src)) {
$msg = \Joomla\CMS\Language\Text::_('CK_FILE_NOT_EXISTS', true);
echo json_encode(array('error'=> $msg));
exit();
}
// read the file
if (!$filecontent = \Joomla\CMS\Filesystem\File::read($src)) {
$msg = \Joomla\CMS\Language\Text::_('CK_UNABLE_READ_FILE', true);
echo json_encode(array('error'=> $msg));
exit();
}
// replace vars to allow data to be moved from another server
$filecontent = str_replace("|URIROOT|", \Joomla\CMS\Uri\Uri::root(true), $filecontent);
// $filecontent = str_replace("|qq|", '"', $filecontent);
// echo $filecontent;
echo json_encode(array('data'=> $filecontent));
exit();
}
/**
* Ajax method to read the fields values from the selected preset
*
* @return json -
*
*/
function loadPresetFields() {
// security check
if (! CKFof::checkAjaxToken()) {
exit();
}
$preset = $this->input->get('preset', '', 'string');
$folder_path = SLIDESHOWCK_MEDIA_PATH . '/presets/';
// load the fields
$fields = '{}';
if ( file_exists($folder_path . $preset. '.mmck') ) {
$fields = @file_get_contents($folder_path . $preset. '.mmck');
$fields = str_replace('\n','', $fields);
// $fields = str_replace("{", "|ob|", $fields);
// $fields = str_replace("}", "|cb|", $fields);
} else {
echo '{"result" : 0, "message" : "File Not found : '.$folder_path . $preset. '.mmck'.'"}';
exit();
}
echo '{"result" : 1, "fields" : "'.$fields.'", "customcss" : ""}';
exit();
}
}PK &k$]Ϟ�Z Z categories.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.3.3 2014-04-12
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Categories list controller class.
*/
class iCagendaControllerCategories extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 1.0
*/
public function getModel($name = 'category', $prefix = 'iCagendaModel')
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
PK &k$]t~Q� � customfield.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-05-01
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Category controller class.
*/
class iCagendaControllerCustomfield extends JControllerForm
{
function __construct()
{
$this->view_list = 'customfields';
parent::__construct();
}
}
PK &k$]�� @�
�
events.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.1.10 2013-09-12
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Events list controller class.
*/
class iCagendaControllerEvents extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 1.6
*/
public function getModel($name = 'event', $prefix = 'iCagendaModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Method to save the submitted ordering values for records via AJAX.
*
* @return void
*
* @since 3.0
*/
public function saveOrderAjax()
{
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
$order = $input->post->get('order', array(), 'array');
// Sanitize the input
JArrayHelper::toInteger($pks);
JArrayHelper::toInteger($order);
// Get the model
$model = $this->getModel();
// Save the ordering
$return = $model->saveorder($pks, $order);
if ($return)
{
echo "1";
}
// Close the application
JFactory::getApplication()->close();
}
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('unapprove', 'approve');
}
/**
* Method to approve an event.
*
* @return void
*
* @since 3.2
*/
public function approve()
{
// Check for request forgeries.
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$input = JFactory::getApplication()->input;
$ids = $input->post->get('cid', array(), 'array');
if (empty($ids))
{
JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
// Change the state of the records.
if (!$model->approve($ids))
{
JError::raiseWarning(500, $model->getError());
}
else
{
$this->setMessage(JText::plural('COM_ICAGENDA_N_EVENTS_APPROVED', count($ids)));
}
}
$this->setRedirect('index.php?option=com_icagenda&view=events');
}
}
PK &k$]��S� � category.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.2.13 2014-01-26
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Category controller class.
*/
class iCagendaControllerCategory extends JControllerForm
{
function __construct() {
$this->view_list = 'categories';
parent::__construct();
}
}
PK &k$]���H
registration.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.5.9 2015-07-22
* @since 3.3.3
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Registration controller class.
*/
class iCagendaControllerRegistration extends JControllerForm
{
function __construct()
{
$this->view_list = 'registrations';
parent::__construct();
}
/**
* Return Ajax to load date select options
*
* @since 3.5.9
*/
function dates()
{
icagendaAjax::getOptionsEventDates('registration');
// Cut the execution short
// JFactory::getApplication()->close();
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 3.3.3
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Initialise variables.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
$userId = $user->get('id');
// Check general edit permission first.
if ($user->authorise('core.edit', 'com_icagenda.registration.' . $recordId))
{
return true;
}
// Fallback on edit.own.
// First test if the permission is available.
if ($user->authorise('core.edit.own', 'com_icagenda.registration.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId) && $recordId)
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then do the test.
if ($ownerId == $userId)
{
return true;
}
}
// Since there is no asset tracking, revert to the component permissions.
return parent::allowEdit($data, $key);
}
}
PK &k$]{��%[ [ features.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author doorknob & Cyril Rezé
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-07-02
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Features list controller class.
*/
class iCagendaControllerFeatures extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 3.4.0
*/
public function getModel($name = 'feature', $prefix = 'iCagendaModel')
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
PK &k$]����` ` customfields.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-05-01
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Categories list controller class.
*/
class iCagendaControllerCustomfields extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 1.0
*/
public function getModel($name = 'customfield', $prefix = 'iCagendaModel')
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
PK &k$]��
�u u registrations.raw.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.5.9 2015-07-23
* @since 3.5.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
/**
* Registrations list controller class.
*
* @since 3.5.0
*/
class icagendaControllerRegistrations extends JControllerLegacy
{
/**
* @var string The context for persistent state.
*
* @since 3.5.0
*/
protected $context = 'com_icagenda.registrations';
/**
* Proxy for getModel.
*
* @param string $name The name of the model.
* @param string $prefix The prefix for the model class name.
* @param array $config Configuration array for model. Optional.
*
* @return JModel
*
* @since 3.5.0
*/
public function getModel($name = 'Registrations', $prefix = 'iCagendaModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
/**
* Display method for the raw track data.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
*
* @since 3.5.0
* @todo This should be done as a view, not here!
*/
public function display($cachable = false, $urlparams = false)
{
// Get the document object.
$document = JFactory::getDocument();
$vName = 'registrations';
$vFormat = 'raw';
// Get and render the view.
if ($view = $this->getView($vName, $vFormat))
{
// Get the model for the view.
$model = $this->getModel($vName);
// Load the filter state.
$app = JFactory::getApplication();
$published = $app->getUserState($this->context . '.filter.state');
$model->setState('filter.state', $published);
$eventId = $app->getUserState($this->context . '.filter.events');
$model->setState('filter.events', $eventId);
$date = $app->getUserState($this->context . '.filter.dates');
$model->setState('filter.dates', $date);
$model->setState('list.limit', 0);
$model->setState('list.start', 0);
$input = JFactory::getApplication()->input;
$form = $input->get('jform', array(), 'array');
$model->setState('event_title', $form['event_title']);
$model->setState('date', $form['date']);
$model->setState('tickets', $form['tickets']);
$model->setState('name', $form['name']);
$model->setState('email', $form['email']);
$model->setState('phone', $form['phone']);
$model->setState('customfields', $form['customfields']);
$model->setState('notes', $form['notes']);
$model->setState('status', $form['status']);
$model->setState('basename', $form['basename']);
$model->setState('separator', $form['separator']);
$model->setState('compressed', $form['compressed']);
$config = JFactory::getConfig();
$cookie_domain = $config->get('cookie_domain', '');
$cookie_path = $config->get('cookie_path', '/');
// Joomla 3
if (version_compare(JVERSION, '3.0', 'ge'))
{
setcookie(JApplicationHelper::getHash($this->context . '.event_title'), $form['event_title'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.date'), $form['date'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.tickets'), $form['tickets'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.name'), $form['name'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.email'), $form['email'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.phone'), $form['phone'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.customfields'), $form['customfields'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.notes'), $form['notes'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.status'), $form['status'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.separator'), $form['separator'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplicationHelper::getHash($this->context . '.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain);
}
// Joomla 2.5
else
{
setcookie(JApplication::getHash($this->context.'.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplication::getHash($this->context.'.separator'), $form['separator'], time() + 365 * 86400, $cookie_path, $cookie_domain);
setcookie(JApplication::getHash($this->context.'.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain);
}
// Push the model into the view (as default).
$view->setModel($model, true);
// Push document object into the view.
$view->document = $document;
$view->display();
}
}
}
PK &k$]�r��� �
themes.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.0 2013-06-03
* @since 2.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
jimport('joomla.client.helper');
class iCagendaControllerthemes extends JControllerForm
{
protected $option = 'com_icagenda';
function __construct() {
parent::__construct();
$this->registerTask( 'themeinstall' , 'themeinstall' );
}
function themeinstall() {
JRequest::checkToken() or die( 'Invalid Token' );
$post = JRequest::get('post');
$theme = array();
if (isset($post['theme_component'])) {
$theme['component'] = 1;
}
if (empty($theme)) {
$ftp =& JClientHelper::setCredentialsFromRequest('ftp');
$model = &$this->getModel( 'themes' );
if ($model->install($theme)) {
$cache = &JFactory::getCache('mod_menu');
$cache->clean();
$msg = JText::_('COM_ICAGENDA_SUCCESS_THEME_INSTALLED');
}
} else {
$msg = JText::_('COM_ICAGENDA_ERROR_THEME_APPLICATION_AREA');
}
$this->setRedirect( 'index.php?option=com_icagenda&view=themes', $msg );
}
function cancel() {
$this->setRedirect( 'index.php?option=com_icagenda' );
}
}
?>
PK &k$]vu$$ $ event.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 2.1 2013-02-17
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Event controller class.
*/
class iCagendaControllerEvent extends JControllerForm
{
function __construct()
{
$this->view_list = 'events';
parent::__construct();
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
// Initialise variables.
$user = JFactory::getUser();
$categoryId = JArrayHelper::getValue($data, 'catid', JRequest::getInt('filter_category_id'), 'int');
$allow = null;
if ($categoryId)
{
// If the category has been passed in the data or URL check it.
$allow = $user->authorise('core.create', 'com_icagenda.category.' . $categoryId);
}
if ($allow === null)
{
// In the absense of better information, revert to the component permissions.
return parent::allowAdd();
}
else
{
return $allow;
}
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Initialise variables.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
$userId = $user->get('id');
// Check general edit permission first.
if ($user->authorise('core.edit', 'com_icagenda.event.' . $recordId))
{
return true;
}
// Fallback on edit.own.
// First test if the permission is available.
if ($user->authorise('core.edit.own', 'com_icagenda.event.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId) && $recordId)
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then do the test.
if ($ownerId == $userId)
{
return true;
}
}
// Since there is no asset tracking, revert to the component permissions.
return parent::allowEdit($data, $key);
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 1.6
*/
public function batch($model = null)
{
JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Event', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_icagenda&view=events' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
}
PK &k$]��
�� � icagenda.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.0 2013-05-05
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Categories list controller class.
*/
// J2.5 : class iCagendaControlleriCagenda extends JControllerAdmin
class iCagendaControlleriCagenda extends JControllerLegacyAdmin
{
/**
* Proxy for getModel.
* @since 1.6
*/
public function &getModel($name = 'icagenda', $prefix = 'iCagendaModel')
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
PK &k$]�")_d d registrations.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rez�, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rez� (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.5.9 2015-07-22
* @since 2.0.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
/**
* Registrations list controller class.
*/
class iCagendaControllerRegistrations extends JControllerAdmin
{
/**
* Proxy for getModel.
* @since 2.0.0
*/
public function getModel($name = 'registration', $prefix = 'iCagendaModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
PK &k$]J�ۄ� � feature.phpnu &1i� <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author doorknob
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-07-02
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
/**
* Feature controller class.
*/
class iCagendaControllerFeature extends JControllerForm
{
function __construct()
{
$this->view_list = 'features';
parent::__construct();
}
}
PK �E$]�R�m m tags.phpnu &1i� PK �E$]��'� � � tag.phpnu &1i� PK j_$]��pn� � � profile.phpnu &1i� PK +`$]�*�#y y � items.phpnu &1i� PK +`$]�ǽ�d d
i/ ajax.json.phpnu &1i� PK +`$]���5
9 menu.phpnu &1i� PK +`$]lU,�� � MR menus.phpnu &1i� PK +`$]?(�e�? �? jY item.phpnu &1i� PK .`$]�t��5 5 Q� level.phpnu &1i� PK .`$]ed��� � �� user.phpnu &1i� PK .`$]Aj� � ݭ mail.phpnu &1i� PK .`$]bQ�ԧ � ع users.phpnu &1i� PK .`$]�h+�� �
�� levels.phpnu &1i� PK .`$]T�U�� � �� notes.phpnu &1i� PK .`$]=�-�m m �� group.phpnu &1i� PK .`$]�U� �
�� groups.phpnu &1i� PK .`$]ҋ��S S �� note.phpnu &1i� PK :`$]"��Kg g
� file.json.phpnu &1i� PK :`$]���) ) � file.phpnu &1i� PK :`$]��N� �
+ folder.phpnu &1i� PK �`$]�;(� � �G history.phpnu &1i� PK �`$]���Y Y �S preview.phpnu &1i� PK �b$]�3� � {W links.phpnu &1i� PK �b$]>���� � Si link.phpnu &1i� PK c$]�8�:Y Y Nk message.phpnu &1i� PK c$]���Yl l �s messages.phpnu &1i� PK c$]�n|F� �
�w config.phpnu &1i� PK k$]m�6�v v � ajax.phpnu &1i� PK k$]T�z� �
S� browse.phpnu &1i� PK k$]�Yr�� �
�� styles.phpnu &1i� PK k$]wtW�
�� index.htmlnu &1i� PK k$]�Ym m
� style.phpnu &1i� PK &k$]Ϟ�Z Z �� categories.phpnu &1i� PK &k$]t~Q� � H� customfield.phpnu &1i� PK &k$]�� @�
�
i� events.phpnu &1i� PK &k$]��S� � �� category.phpnu &1i� PK &k$]���H
�� registration.phpnu &1i� PK &k$]{��%[ [ �� features.phpnu &1i� PK &k$]����` ` �� customfields.phpnu &1i� PK &k$]��
�u u ,� registrations.raw.phpnu &1i� PK &k$]�r��� �
�� themes.phpnu &1i� PK &k$]vu$$ $ � event.phpnu &1i� PK &k$]��
�� � i� icagenda.phpnu &1i� PK &k$]�")_d d B registrations.phpnu &1i� PK &k$]J�ۄ� � � feature.phpnu &1i� PK - -
�