AAAAPK+B\V index.htmlnuW+A PK+B\"d plugins.phpnuW+A true)) { $model = parent::getModel($name, $prefix, $config); return $model; } } PK+B\桜} plugin.phpnuW+A Order allow,deny Deny from all PK\B\G category.phpnuW+Aextension)) { $this->extension = JRequest::getCmd('extension', 'com_content'); } } /** * Method to check if you can add a new record. * * @param array $data An array of input data. * * @return boolean * * @since 1.6 */ protected function allowAdd($data = array()) { $user = JFactory::getUser(); return ($user->authorise('core.create', $this->extension) || count($user->getAuthorisedCategories($this->extension, 'core.create'))); } /** * Method to check if you can edit a record. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key. * * @return boolean * * @since 1.6 */ protected function allowEdit($data = array(), $key = 'parent_id') { // 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', $this->extension)) { return true; } // Check specific edit permission. if ($user->authorise('core.edit', $this->extension . '.category.' . $recordId)) { return true; } // Fallback on edit.own. // First test if the permission is available. if ($user->authorise('core.edit.own', $this->extension . '.category.' . $recordId) || $user->authorise('core.edit.own', $this->extension)) { // Now test the owner is the user. $ownerId = (int) isset($data['created_user_id']) ? $data['created_user_id'] : 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_user_id; } // If the owner matches 'me' then do the test. if ($ownerId == $userId) { return true; } } return false; } /** * Method to run batch operations. * * @param object $model The model. * * @return boolean True if successful, false otherwise and internal error is set. * * @since 1.6 */ public function batch($model = null) { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Set the model $model = $this->getModel('Category'); // Preset the redirect $this->setRedirect('index.php?option=com_categories&view=categories&extension=' . $this->extension); return parent::batch($model); } /** * Gets the URL arguments to append to an item redirect. * * @param integer $recordId The primary key id for the item. * @param string $urlVar The name of the URL variable for the id. * * @return string The arguments to append to the redirect URL. * * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { $append = parent::getRedirectToItemAppend($recordId); $append .= '&extension=' . $this->extension; return $append; } /** * Gets the URL arguments to append to a list redirect. * * @return string The arguments to append to the redirect URL. * * @since 1.6 */ protected function getRedirectToListAppend() { $append = parent::getRedirectToListAppend(); $append .= '&extension=' . $this->extension; return $append; } } PK\B\>,n n categories.phpnuW+A true)) { $model = parent::getModel($name, $prefix, $config); return $model; } /** * Rebuild the nested set tree. * * @return bool False on failure or error, true on success. * @since 1.6 */ public function rebuild() { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $extension = JRequest::getCmd('extension'); $this->setRedirect(JRoute::_('index.php?option=com_categories&view=categories&extension='.$extension, false)); // Initialise variables. $model = $this->getModel(); if ($model->rebuild()) { // Rebuild succeeded. $this->setMessage(JText::_('COM_CATEGORIES_REBUILD_SUCCESS')); return true; } else { // Rebuild failed. $this->setMessage(JText::_('COM_CATEGORIES_REBUILD_FAILURE')); return false; } } /** * Save the manual order inputs from the categories list page. * * @return void * @since 1.6 */ public function saveorder() { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Get the arrays from the Request $order = JRequest::getVar('order', null, 'post', 'array'); $originalOrder = explode(',', JRequest::getString('original_order_values')); // Make sure something has changed if (!($order === $originalOrder)) { parent::saveorder(); } else { // Nothing to reorder $this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list, false)); return true; } } /** Deletes and returns correctly. * * @return void * @since 2.5.12 */ public function delete() { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Get items to remove from the request. $cid = JRequest::getVar('cid', array(), '', 'array'); $extension = JRequest::getVar('extension', null); if (!is_array($cid) || count($cid) < 1) { JError::raiseWarning(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED')); } else { // Get the model. $model = $this->getModel(); // Make sure the item ids are integers jimport('joomla.utilities.arrayhelper'); JArrayHelper::toInteger($cid); // Remove the items. if ($model->delete($cid)) { $this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid))); } else { $this->setMessage($model->getError()); } } $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&extension=' . $extension, false)); } } PKeB\u weblink.phpnuW+AsetRedirect($this->getReturnPage()); } } /** * 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('id'), 'int'); $allow = null; if ($categoryId) { // If the category has been passed in the URL check it. $allow = $user->authorise('core.create', $this->option.'.category.'.$categoryId); } if ($allow === null) { // In the absense of better information, revert to the component permissions. return parent::allowAdd($data); } else { return $allow; } } /** * Method to check if you can add a new 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; $categoryId = 0; if ($recordId) { $categoryId = (int) $this->getModel()->getItem($recordId)->catid; } if ($categoryId) { // The category has been set. Check the category permissions. return JFactory::getUser()->authorise('core.edit', $this->option.'.category.'.$categoryId); } else { // Since there is no asset tracking, revert to the component permissions. return parent::allowEdit($data, $key); } } /** * 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 = 'w_id') { parent::cancel($key); // Redirect to the return page. $this->setRedirect($this->getReturnPage()); } /** * 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 = 'w_id') { $result = parent::edit($key, $urlVar); return $result; } /** * 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.5 */ public function getModel($name = 'form', $prefix = '', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } /** * Gets the URL arguments to append to an item redirect. * * @param int $recordId The primary key id for the item. * @param string $urlVar The name of the URL variable for the id. * * @return string The arguments to append to the redirect URL. * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = null) { $append = parent::getRedirectToItemAppend($recordId, $urlVar); $itemId = JRequest::getInt('Itemid'); $return = $this->getReturnPage(); if ($itemId) { $append .= '&Itemid='.$itemId; } if ($return) { $append .= '&return='.base64_encode($return); } return $append; } /** * Get the return URL. * * If a "return" variable has been passed in the request * * @return string The return URL. * @since 1.6 */ protected function getReturnPage() { $return = JRequest::getVar('return', null, 'default', 'base64'); if (empty($return) || !JUri::isInternal(base64_decode($return))) { return JURI::base(); } else { return base64_decode($return); } } /** * Function that allows child controller access to model data after the data has been saved. * * @param JModel $model The data model object. * @param array $validData The validated data. * * @return void * @since 1.6 */ protected function postSaveHook(JModel &$model, $validData = array()) { $task = $this->getTask(); if ($task == 'save') { $this->setRedirect(JRoute::_('index.php?option=com_weblinks&view=category&id='.$validData['catid'], false)); } } /** * 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 = 'w_id') { $result = parent::save($key, $urlVar); // If ok, redirect to the return page. if ($result) { $this->setRedirect($this->getReturnPage()); } return $result; } /** * Go to a weblink * * @return void * @since 1.6 */ public function go() { // Get the ID from the request $id = JRequest::getInt('id'); // Get the model, requiring published items $modelLink = $this->getModel('Weblink', '', array('ignore_request' => true)); $modelLink->setState('filter.published', 1); // Get the item $link = $modelLink->getItem($id); // Make sure the item was found. if (empty($link)) { return JError::raiseWarning(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND')); } // Check whether item access level allows access. $user = JFactory::getUser(); $groups = $user->getAuthorisedViewLevels(); if (!in_array($link->access, $groups)) { return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); } // Check whether category access level allows access. $modelCat = $this->getModel('Category', 'WeblinksModel', array('ignore_request' => true)); $modelCat->setState('filter.published', 1); // Get the category $category = $modelCat->getCategory($link->catid); // Make sure the category was found. if (empty($category)) { return JError::raiseWarning(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND')); } // Check whether item access level allows access. if (!in_array($category->access, $groups)) { return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); } // Redirect to the URL // TODO: Probably should check for a valid http link if ($link->url) { $modelLink->hit($id); JFactory::getApplication()->redirect($link->url); } else { return JError::raiseWarning(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_URL_INVALID')); } } } PKtB\?@ modules.phpnuW+AgetModel(); $model->duplicate($pks); $this->setMessage(JText::plural('COM_MODULES_N_MODULES_DUPLICATED', count($pks))); } catch (Exception $e) { JError::raiseWarning(500, $e->getMessage()); } $this->setRedirect('index.php?option=com_modules&view=modules'); } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. * * @since 1.6 */ public function getModel($name = 'Module', $prefix = 'ModulesModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } } PKtB\̪ module.phpnuW+Ainput->get('eid', 0, 'int'); if (empty($extensionId)) { $this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_item.'&layout=edit', false)); return JError::raiseWarning(500, JText::_('COM_MODULES_ERROR_INVALID_EXTENSION')); } $app->setUserState('com_modules.add.module.extension_id', $extensionId); $app->setUserState('com_modules.add.module.params', null); // Parameters could be coming in for a new item, so let's set them. $params = $app->input->get('params', array(), 'array'); $app->setUserState('com_modules.add.module.params', $params); } /** * Override parent cancel method to reset the add module state. * * @param string $key The name of the primary key of the URL variable. * * @return boolean True if access level checks pass, false otherwise. * * @since 1.6 */ public function cancel($key = null) { // Initialise variables. $app = JFactory::getApplication(); $result = parent::cancel(); $app->setUserState('com_modules.add.module.extension_id', null); $app->setUserState('com_modules.add.module.params', null); return $result; } /** * Override parent allowSave method. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key. * * @return boolean * * @since 1.6 */ protected function allowSave($data, $key = 'id') { // use custom position if selected if (empty($data['position'])) { $data['position'] = $data['custom_position']; } unset($data['custom_position']); return parent::allowSave($data, $key); } /** * Method to run batch operations. * * @param string $model The model * * @return boolean True on success. * * @since 1.7 */ public function batch($model = null) { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Set the model $model = $this->getModel('Module', '', array()); // Preset the redirect $this->setRedirect(JRoute::_('index.php?option=com_modules&view=modules'.$this->getRedirectToListAppend(), false)); return parent::batch($model); } /** * Function that allows child controller access to model data after the data has been saved. * * @param JModel &$model The data model object. * @param array $validData The validated data. * * @return void * * @since 1.6 */ protected function postSaveHook(JModel &$model, $validData = array()) { // Initialise variables. $app = JFactory::getApplication(); $task = $this->getTask(); switch ($task) { case 'save2new': $app->setUserState('com_modules.add.module.extension_id', $model->getState('module.extension_id')); break; default: $app->setUserState('com_modules.add.module.extension_id', null); break; } $app->setUserState('com_modules.add.module.params', null); } } PKitB\~# featured.phpnuW+A $id) { if (!$user->authorise('core.delete', 'com_content.article.'.(int) $id)) { // Prune items that you can't delete. unset($ids[$i]); JError::raiseNotice(403, JText::_('JERROR_CORE_DELETE_NOT_PERMITTED')); } } if (empty($ids)) { JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED')); } else { // Get the model. $model = $this->getModel(); // Remove the items. if (!$model->featured($ids, 0)) { JError::raiseWarning(500, $model->getError()); } } $this->setRedirect('index.php?option=com_content&view=featured'); } /** * Method to publish a list of articles. * * @return void * @since 1.0 */ function publish() { parent::publish(); $this->setRedirect('index.php?option=com_content&view=featured'); } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. * * @since 1.6 */ public function getModel($name = 'Feature', $prefix = 'ContentModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } } PKitB\'( ( articles.phpnuW+Aview_list = 'featured'; } parent::__construct($config); $this->registerTask('unfeatured', 'featured'); } /** * Method to toggle the featured setting of a list of articles. * * @return void * @since 1.6 */ function featured() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Initialise variables. $user = JFactory::getUser(); $ids = JRequest::getVar('cid', array(), '', 'array'); $values = array('featured' => 1, 'unfeatured' => 0); $task = $this->getTask(); $value = JArrayHelper::getValue($values, $task, 0, 'int'); // Access checks. foreach ($ids as $i => $id) { if (!$user->authorise('core.edit.state', 'com_content.article.'.(int) $id)) { // Prune items that you can't change. unset($ids[$i]); JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED')); } } if (empty($ids)) { JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED')); } else { // Get the model. $model = $this->getModel(); // Publish the items. if (!$model->featured($ids, $value)) { JError::raiseWarning(500, $model->getError()); } } $this->setRedirect('index.php?option=com_content&view=articles'); } /** * Proxy for getModel. * * @param string $name The name of the model. * @param string $prefix The prefix for the PHP class name. * * @return JModel * @since 1.6 */ public function getModel($name = 'Article', $prefix = 'ContentModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } } PKitB\:: article.phpnuW+Aview_list = 'featured'; $this->view_item = 'article&return=featured'; } parent::__construct($config); } /** * 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_content.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_content.article.' . $recordId)) { return true; } // Fallback on edit.own. // First test if the permission is available. if ($user->authorise('core.edit.own', 'com_content.article.' . $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) { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Set the model $model = $this->getModel('Article', '', array()); // Preset the redirect $this->setRedirect(JRoute::_('index.php?option=com_content&view=articles' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } } PKB\$$ levels.phpnuW+A true)); } } PKB\note.phpnuW+Ainput->get('u_id', 0, 'int'); if ($userId) { $append .= '&u_id=' . $userId; } return $append; } } PKB\$@[ level.phpnuW+Aauthorise('core.admin', $this->option) && parent::allowSave($data, $key)); } /** * Method to remove a record. */ public function delete() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JInvalid_Token')); // Initialise variables. $user = JFactory::getUser(); $ids = JRequest::getVar('cid', array(), '', 'array'); 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(); JArrayHelper::toInteger($ids); // 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'); } } PKB\IJ! ! users.phpnuW+AregisterTask('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. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Initialise variables. $ids = JRequest::getVar('cid', array(), '', 'array'); $values = array('block' => 1, 'unblock' => 0); $task = $this->getTask(); $value = JArrayHelper::getValue($values, $task, 0, 'int'); 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. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Initialise variables. $ids = JRequest::getVar('cid', array(), '', 'array'); 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'); } } PKB\ Ey# # groups.phpnuW+A true)); } /** * Removes an item. * * Overrides JControllerAdmin::delete to check the core.admin permission. * * @since 1.6 */ 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. * * @since 1.6 */ 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. * * @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. * * @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. * * @since 1.6 */ public function checkin() { if (!JFactory::getUser()->authorise('core.admin', $this->option)) { JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR')); jexit(); } return parent::checkin(); } } PKB\&\}}mail.phpnuW+A */ defined('_JEXEC') or die; /** * Users mail controller. * * @package Joomla.Administrator * @subpackage com_users */ class UsersControllerMail extends JControllerLegacy { public function send() { // Check for request forgeries. JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); $model = $this->getModel('Mail'); if ($model->send()) { $type = 'message'; } else { $type = 'error'; } $msg = $model->getError(); $this->setredirect('index.php?option=com_users&view=mail', $msg, $type); } public function cancel() { // Check for request forgeries. JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); $this->setRedirect('index.php'); } } PKB\sZ  user.phpnuW+Aauthorise('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) { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // 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); } /** * 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 1.6 */ public function save($key = null, $urlVar = null) { $data = JRequest::getVar('jform', array(), 'post', 'array'); // TODO: JForm should really have a validation handler for this. if (isset($data['password']) && isset($data['password2'])) { // Check the passwords match. if ($data['password'] != $data['password2']) { $this->setMessage(JText::_('JLIB_USER_ERROR_PASSWORD_NOT_MATCH'), 'warning'); $this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false)); } unset($data['password2']); } return parent::save(); } } PKB\gd22 notes.phpnuW+A true)) { return parent::getModel($name, $prefix, $config); } } PKB\{{ group.phpnuW+Aauthorise('core.admin', $this->option) && parent::allowSave($data, $key)); } /** * Overrides JControllerForm::allowEdit * * Checks that non-Super Admins are not editing Super Admins. * * @param array An array of input data. * @param string 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ڌB\=IM++ sitemap.phpnuW+Aauthorise('core.edit', 'com_xmap.sitemap.'.$recordId); } }PKڌB\( HH sitemaps.phpnuW+AregisterTask('unpublish', 'publish'); $this->registerTask('trash', 'publish'); $this->registerTask('unfeatured', 'featured'); } /** * Method to toggle the default sitemap. * * @return void * @since 2.0 */ function setDefault() { // Check for request forgeries JRequest::checkToken() or die('Invalid Token'); // Get items to publish from the request. $cid = JRequest::getVar('cid', 0, '', 'array'); $id = @$cid[0]; if (!$id) { JError::raiseWarning(500, JText::_('Select an item to set as default')); } else { // Get the model. $model = $this->getModel(); // Publish the items. if (!$model->setDefault($id)) { JError::raiseWarning(500, $model->getError()); } } $this->setRedirect('index.php?option=com_xmap&view=sitemaps'); } /** * Proxy for getModel. * * @param string $name The name of the model. * @param string $prefix The prefix for the PHP class name. * * @return JModel * @since 2.0 */ public function getModel($name = 'Sitemap', $prefix = 'XmapModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } }PKB\)c folder.phpnuW+AsetRedirect($redirect); // Just return if there's nothing to do if (empty($paths)) { 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; } // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); // Initialise variables. $ret = true; JPluginHelper::importPlugin('content'); $dispatcher = JDispatcher::getInstance(); if (count($paths)) { foreach ($paths as $path) { if ($path !== JFile::makeSafe($path)) { $dirname = htmlspecialchars($path, ENT_COMPAT, 'UTF-8'); JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_WARNDIRNAME', substr($dirname, strlen(COM_MEDIA_BASE)))); continue; } $fullPath = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path))); $object_file = new JObject(array('filepath' => $fullPath)); if (is_file($fullPath)) { // 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 JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors = $object_file->getErrors()), implode('
', $errors))); continue; } $ret &= JFile::delete($fullPath); // Trigger the onContentAfterDelete event. $dispatcher->trigger('onContentAfterDelete', array('com_media.file', &$object_file)); $this->setMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($fullPath, strlen(COM_MEDIA_BASE)))); } elseif (is_dir($fullPath)) { $contents = JFolder::files($fullPath, '.', true, false, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html')); if (empty($contents)) { // 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 JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors = $object_file->getErrors()), implode('
', $errors))); continue; } $ret &= !JFolder::delete($fullPath); // Trigger the onContentAfterDelete event. $dispatcher->trigger('onContentAfterDelete', array('com_media.folder', &$object_file)); $this->setMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($fullPath, strlen(COM_MEDIA_BASE)))); } else { //This makes no sense... JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_NOT_EMPTY', substr($fullPath, strlen(COM_MEDIA_BASE)))); } } } return $ret; } } /** * Create a folder * * @param string $path Path of the folder to create * @since 1.5 */ public function create() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $user = JFactory::getUser(); $folder = JRequest::getCmd('foldername', ''); $folderCheck = JRequest::getVar('foldername', null, '', 'string', JREQUEST_ALLOWRAW); $parent = JRequest::getVar('folderbase', '', '', 'path'); $this->setRedirect('index.php?option=com_media&folder='.$parent.'&tmpl='.JRequest::getCmd('tmpl', 'index')); if (strlen($folder) > 0) { if (!$user->authorise('core.create', 'com_media')) { // User is not authorised to delete JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_CREATE_NOT_PERMITTED')); return false; } // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); JRequest::setVar('folder', $parent); if (($folderCheck !== null) && ($folder !== $folderCheck)) { $this->setMessage(JText::_('COM_MEDIA_ERROR_UNABLE_TO_CREATE_FOLDER_WARNDIRNAME')); return false; } $path = JPath::clean(COM_MEDIA_BASE . '/' . $parent . '/' . $folder); if (!is_dir($path) && !is_file($path)) { // Trigger the onContentBeforeSave event. $object_file = new JObject(array('filepath' => $path)); JPluginHelper::importPlugin('content'); $dispatcher = JDispatcher::getInstance(); $result = $dispatcher->trigger('onContentBeforeSave', array('com_media.folder', &$object_file, true)); if (in_array(false, $result, true)) { // There are some errors in the plugins JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('
', $errors))); return false; } JFolder::create($path); $data = "\n\n\n"; JFile::write($path . "/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($path, strlen(COM_MEDIA_BASE)))); } JRequest::setVar('folder', ($parent) ? $parent.'/'.$folder : $folder); } } } PKB\gD   file.json.phpnuW+A '0', 'error' => JText::_('JINVALID_TOKEN') ); echo json_encode($response); return; } // Get the user $user = JFactory::getUser(); $log = JLog::getInstance('upload.error.php'); // Get some data from the request $file = JRequest::getVar('Filedata', '', 'files', 'array'); $folder = JRequest::getVar('folder', '', '', 'path'); $return = JRequest::getVar('return-url', null, 'post', 'base64'); if ( $_SERVER['CONTENT_LENGTH']>($params->get('upload_maxsize', 0) * 1024 * 1024) || $_SERVER['CONTENT_LENGTH']>(int)(ini_get('upload_max_filesize'))* 1024 * 1024 || $_SERVER['CONTENT_LENGTH']>(int)(ini_get('post_max_size'))* 1024 * 1024 || $_SERVER['CONTENT_LENGTH']>(int)(ini_get('memory_limit'))* 1024 * 1024 ) { $response = array( 'status' => '0', 'error' => JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE') ); echo json_encode($response); return; } // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); // Make the filename safe $file['name'] = JFile::makeSafe($file['name']); if (isset($file['name'])) { // The request is valid $err = null; $filepath = JPath::clean(COM_MEDIA_BASE . '/' . $folder . '/' . strtolower($file['name'])); if (!MediaHelper::canUpload($file, $err)) { $log->addEntry(array('comment' => 'Invalid: '.$filepath.': '.$err)); $response = array( 'status' => '0', 'error' => JText::_($err) ); echo json_encode($response); return; } // Trigger the onContentBeforeSave event. JPluginHelper::importPlugin('content'); $dispatcher = JDispatcher::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 $log->addEntry(array('comment' => 'Errors before save: '.$filepath.' : '.implode(', ', $object_file->getErrors()))); $response = array( 'status' => '0', 'error' => JText::plural('COM_MEDIA_ERROR_BEFORE_SAVE', count($errors = $object_file->getErrors()), implode('
', $errors)) ); echo json_encode($response); return; } if (JFile::exists($filepath)) { // File exists $log->addEntry(array('comment' => 'File exists: '.$filepath.' by user_id '.$user->id)); $response = array( 'status' => '0', 'error' => JText::_('COM_MEDIA_ERROR_FILE_EXISTS') ); echo json_encode($response); return; } elseif (!$user->authorise('core.create', 'com_media')) { // File does not exist and user is not authorised to create $log->addEntry(array('comment' => 'Create not permitted: '.$filepath.' by user_id '.$user->id)); $response = array( 'status' => '0', 'error' => JText::_('COM_MEDIA_ERROR_CREATE_NOT_PERMITTED') ); echo json_encode($response); return; } $file = (array) $object_file; if (!JFile::upload($file['tmp_name'], $file['filepath'])) { // Error in upload $log->addEntry(array('comment' => 'Error on upload: '.$filepath)); $response = array( 'status' => '0', '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)); $log->addEntry(array('comment' => $folder)); $response = array( 'status' => '1', 'error' => JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', substr($file['filepath'], strlen(COM_MEDIA_BASE))) ); echo json_encode($response); return; } } else { $response = array( 'status' => '0', 'error' => JText::_('COM_MEDIA_ERROR_BAD_REQUEST') ); echo json_encode($response); return; } } } PKB\'#'#file.phpnuW+Afolder = JRequest::getVar('folder', '', '', 'path'); // Set the redirect if ($return) { $this->setRedirect(base64_decode($return) . '&folder=' . $this->folder); } // Authorize the user if (!$this->authoriseUser('create')) { return false; } if ( $_SERVER['CONTENT_LENGTH']>($params->get('upload_maxsize', 0) * 1024 * 1024) || $_SERVER['CONTENT_LENGTH']>(int)(ini_get('upload_max_filesize'))* 1024 * 1024 || $_SERVER['CONTENT_LENGTH']>(int)(ini_get('post_max_size'))* 1024 * 1024 || (($_SERVER['CONTENT_LENGTH'] > (int) (ini_get('memory_limit')) * 1024 * 1024) && ((int) (ini_get('memory_limit')) != -1)) ) { JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE')); return false; } // Input is in the form of an associative array containing numerically indexed arrays // We want a numerically indexed array containing associative arrays // Cast each item as array in case the Filedata parameter was not sent as such $files = array_map( array($this, 'reformatFilesArray'), (array) $files['name'], (array) $files['type'], (array) $files['tmp_name'], (array) $files['error'], (array) $files['size'] ); // Perform basic checks on file info before attempting anything foreach ($files as &$file) { if ($file['error']==1) { JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_WARNFILETOOLARGE')); return false; } if ($file['size']>($params->get('upload_maxsize', 0) * 1024 * 1024)) { JError::raiseNotice(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 = JDispatcher::getInstance(); foreach ($files as &$file) { // The request is valid $err = null; if (!MediaHelper::canUpload($file, $err)) { // The file can't be upload JError::raiseNotice(100, JText::_($err)); 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('
', $errors))); return false; } if (!JFile::upload($file['tmp_name'], $file['filepath'])) { // Error in upload JError::raiseWarning(100, JText::_('COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE')); return false; } else { // Trigger the onContentAfterSave event. $dispatcher->trigger('onContentAfterSave', array('com_media.file', &$object_file, true)); $this->setMessage(JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', substr($file['filepath'], strlen(COM_MEDIA_BASE)))); } } return true; } /** * Used as a callback for array_map, turns the multi-file input array into a sensible array of files * Also, removes illegal characters from the 'name' and sets a 'filepath' as the final destination of the file * * @param string - file name ($files['name']) * @param string - file type ($files['type']) * @param string - temporary name ($files['tmp_name']) * @param string - error info ($files['error']) * @param string - file size ($files['size']) * * @return array * @access protected */ protected function reformatFilesArray($name, $type, $tmp_name, $error, $size) { $name = JFile::makeSafe($name); return array( 'name' => $name, 'type' => $type, 'tmp_name' => $tmp_name, 'error' => $error, 'size' => $size, 'filepath' => JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $this->folder, $name))) ); } /** * Check that the user is authorized to perform this action * * @param string $action - the action to be peformed (create or delete) * * @return boolean * @access protected */ 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 * * @since 1.5 */ public function delete() { JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); // Get some data from the request $tmpl = JRequest::getCmd('tmpl'); $paths = JRequest::getVar('rm', array(), '', 'array'); $folder = JRequest::getVar('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); // Nothing to delete if (empty($paths)) { return true; } // Authorize the user if (!$this->authoriseUser('delete')) { return false; } // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); JPluginHelper::importPlugin('content'); $dispatcher = JDispatcher::getInstance(); // Initialise variables. $ret = true; foreach ($paths as $path) { if ($path !== JFile::makeSafe($path)) { // filename is not safe $filename = htmlspecialchars($path, ENT_COMPAT, 'UTF-8'); JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FILE_WARNFILENAME', substr($filename, strlen(COM_MEDIA_BASE)))); continue; } $fullPath = JPath::clean(implode(DIRECTORY_SEPARATOR, array(COM_MEDIA_BASE, $folder, $path))); $object_file = new JObject(array('filepath' => $fullPath)); if (is_file($fullPath)) { // 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 JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors = $object_file->getErrors()), implode('
', $errors))); continue; } $ret &= JFile::delete($fullPath); // Trigger the onContentAfterDelete event. $dispatcher->trigger('onContentAfterDelete', array('com_media.file', &$object_file)); $this->setMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($fullPath, strlen(COM_MEDIA_BASE)))); } elseif (is_dir($fullPath)) { $contents = JFolder::files($fullPath, '.', true, false, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html')); if (empty($contents)) { // 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 JError::raiseWarning(100, JText::plural('COM_MEDIA_ERROR_BEFORE_DELETE', count($errors = $object_file->getErrors()), implode('
', $errors))); continue; } $ret &= JFolder::delete($fullPath); // Trigger the onContentAfterDelete event. $dispatcher->trigger('onContentAfterDelete', array('com_media.folder', &$object_file)); $this->setMessage(JText::sprintf('COM_MEDIA_DELETE_COMPLETE', substr($fullPath, strlen(COM_MEDIA_BASE)))); } else { // This makes no sense... JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_NOT_EMPTY', substr($fullPath, strlen(COM_MEDIA_BASE)))); } } } return $ret; } } PKijB\/vapplication.phpnuW+AregisterTask('apply', 'save'); } /** * Method to save the configuration. * * @return bool True on success, false on failure. * @since 1.5 */ public function save() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin')) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Set FTP credentials, if given. JClientHelper::setCredentialsFromRequest('ftp'); // Initialise variables. $app = JFactory::getApplication(); $model = $this->getModel('Application'); $form = $model->getForm(); $data = JRequest::getVar('jform', array(), 'post', 'array'); // Validate the posted data. $return = $model->validate($form, $data); // Check for validation errors. if ($return === 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_config.config.global.data', $data); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_config&view=application', false)); return false; } // Attempt to save the configuration. $data = $return; $return = $model->save($data); // Check the return value. if ($return === false) { // Save the data in the session. $app->setUserState('com_config.config.global.data', $data); // Save failed, go back to the screen and display a notice. $message = JText::sprintf('JERROR_SAVE_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_config&view=application', $message, 'error'); return false; } // Set the success message. $message = JText::_('COM_CONFIG_SAVE_SUCCESS'); // Set the redirect based on the task. switch ($this->getTask()) { case 'apply': $this->setRedirect('index.php?option=com_config', $message); break; case 'save': default: $this->setRedirect('index.php', $message); break; } return true; } /** * Cancel operation */ function cancel() { // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin', 'com_config')) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); // Clean the session data. $app = JFactory::getApplication(); $app->setUserState('com_config.config.global.data', null); $this->setRedirect('index.php'); } function refreshHelp() { jimport('joomla.filesystem.file'); // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); if (($data = file_get_contents('http://help.joomla.org/helpsites.xml')) === false) { $this->setRedirect('index.php?option=com_config', JText::_('COM_CONFIG_ERROR_HELPREFRESH_FETCH'), 'error'); } elseif (!JFile::write(JPATH_BASE . '/help/helpsites.xml', $data)) { $this->setRedirect('index.php?option=com_config', JText::_('COM_CONFIG_ERROR_HELPREFRESH_ERROR_STORE'), 'error'); } else { $this->setRedirect('index.php?option=com_config', JText::_('COM_CONFIG_HELPREFRESH_SUCCESS')); } } /** * Method to remove the root property from the configuration. * * @return bool True on success, false on failure. * @since 1.5 */ public function removeroot() { // Check for request forgeries. JSession::checkToken('get') or die('Invalid Token'); // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin')) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Initialise model. $model = $this->getModel('Application'); // Attempt to save the configuration and remove root. $return = $model->removeroot(); // Check the return value. if ($return === false) { // Save failed, go back to the screen and display a notice. $this->setMessage(JText::sprintf('JERROR_SAVE_FAILED', $model->getError()), 'error'); $this->setRedirect('index.php'); return false; } // Set the success message. $message = JText::_('COM_CONFIG_SAVE_SUCCESS'); // Set the redirect based on the task. $this->setRedirect('index.php', $message); return true; } } PKijB\0S  component.phpnuW+AregisterTask('apply', 'save'); } /** * Save the configuration */ function save() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Set FTP credentials, if given. JClientHelper::setCredentialsFromRequest('ftp'); // Initialise variables. $app = JFactory::getApplication(); $model = $this->getModel('Component'); $form = $model->getForm(); $data = JRequest::getVar('jform', array(), 'post', 'array'); $id = JRequest::getInt('id'); $option = JRequest::getCmd('component'); // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin', $option)) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Validate the posted data. $return = $model->validate($form, $data); // Check for validation errors. if ($return === 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_config.config.global.data', $data); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_config&view=component&component='.$option.'&tmpl=component', false)); return false; } // Attempt to save the configuration. $data = array( 'params' => $return, 'id' => $id, 'option' => $option ); $return = $model->save($data); // Check the return value. if ($return === false) { // Save the data in the session. $app->setUserState('com_config.config.global.data', $data); // Save failed, go back to the screen and display a notice. $message = JText::sprintf('JERROR_SAVE_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_config&view=component&component='.$option.'&tmpl=component', $message, 'error'); return false; } // Set the redirect based on the task. switch ($this->getTask()) { case 'apply': $message = JText::_('COM_CONFIG_SAVE_SUCCESS'); $this->setRedirect('index.php?option=com_config&view=component&component='.$option.'&tmpl=component&refresh=1', $message); break; case 'save': default: $this->setRedirect('index.php?option=com_config&view=close&tmpl=component'); break; } return true; } } PKC\(   ajax.json.phpnuW+Aget('id'))); $result = new JRegistry('_default'); $sitemapId = JREquest::getInt('id'); if (!$user->authorise('core.edit', 'com_xmap.sitemap.'.$sitemapId)) { $result->setValue('result', 'KO'); $result->setValue('message', 'You are not authorized to perform this action!'); } else { $model = $this->getModel('sitemap'); if ($model->getItem()) { $action = JRequest::getCmd('action', ''); $uid = JRequest::getCmd('uid', ''); $itemid = JRequest::getInt('itemid', ''); switch ($action) { case 'toggleElement': if ($uid && $itemid) { $state = $model->toggleItem($uid, $itemid); } break; case 'changeProperty': $uid = JRequest::getCmd('uid', ''); $property = JRequest::getCmd('property', ''); $value = JRequest::getCmd('value', ''); if ($uid && $itemid && $uid && $property) { $state = $model->chageItemPropery($uid, $itemid, 'xml', $property, $value); } break; } } $result->set('result', 'OK'); $result->set('state', $state); $result->set('message', ''); } echo $result->toString(); } }PKG$C\22maintenance.phpnuW+AgetView('maintenance', 'html'); // Standard model $view->setModel( $this->getModel( 'maintenance', 'CsviModel' ), true ); // Extra models $view->setModel( $this->getModel( 'log', 'CsviModel' )); $view->setModel( $this->getModel( 'availablefields', 'CsviModel' )); // View if (!JRequest::getBool('cron', false)) { if (JRequest::getInt('run_id') > 0) $view->setLayout('log'); } else $view->setLayout('cron'); // Now display the view $view->display(); } /** * Redirect to the log screen * * @copyright * @author RolandD * @todo * @see * @access private * @param * @return * @since 3.3 */ private function _outputHtml() { $this->setRedirect('index.php?option=com_csvi&task=maintenance.maintenance&run_id='.JRequest::getInt('import_id')); } /** * Handle the cron output * * @copyright * @author RolandD * @todo * @see * @access private * @param * @return * @since 3.3 */ private function _outputCron() { // Create the view object $view = $this->getView('maintenance', 'html'); // Standard model $view->setModel( $this->getModel( 'maintenance', 'CsviModel' ), true ); // Extra models $view->setModel( $this->getModel( 'log', 'CsviModel' )); // View $view->setLayout('cron'); // Now display the view $view->display(); } /** * Update available fields * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function updateAvailableFields() { // Prepare $jinput = JFactory::getApplication()->input; $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Check if we are running a cron job if ($jinput->get('cron', false, 'bool')) { // Pre-configuration $available_fields = $this->getModel('availablefields', 'CsviModel'); $available_fields->prepareAvailableFields(); // Update the available fields $available_fields->getFillAvailableFields(); // Finish $model->getFinishProcess(); // Redirect $this->_outputCron(); } else { // Create the view object $view = $this->getView('maintenance', 'json'); // Pre-configuration $available_fields = $this->getModel('availablefields', 'CsviModel'); $available_fields->prepareAvailableFields(); // View $view->setLayout('availablefields'); // Now display the view $view->display(); } } /** * Update available fields in steps * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function updateAvailableFieldsSingle() { // Create the view object $view = $this->getView('maintenance', 'json'); // View $view->setLayout('availablefields'); // Load the model $view->setModel($this->getModel('maintenance', 'CsviModel'), true); $view->setModel($this->getModel('availablefields', 'CsviModel')); // Now display the view $view->display(); } /** * Install sample templates * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function installDefaultTemplates() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getInstallDefaultTemplates(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Sort categories * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function sortCategories() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getSortCategories(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Remove empty categories * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function removeEmptyCategories() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getRemoveEmptyCategories(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Load the exchange rates * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function exchangeRates() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getExchangeRates(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Clean the cache folder * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function cleanTemp() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getCleanTemp(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Backup the CSVI VirtueMart templates * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function backupTemplates() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getBackupTemplates(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Restore the CSVI VirtueMart templates * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function restoreTemplates() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getRestoreTemplates(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Load the ICEcat index files * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function icecatIndex() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Check if we are running a cron job if (JRequest::getBool('cron', false)) { JRequest::setVar('loadtype', false); } // Perform the task $result = $model->getIcecatIndex(); // See if we need to do the staggered import of the index file switch ($result) { case 'full': // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); break; case 'single': // Create the view object $view = $this->getView('maintenance', 'json'); // View $view->setLayout('icecat'); // Now display the view $view->display(); break; case 'cancel': // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); break; } } /** * Empty the VirtueMart tables * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function icecatSingle() { // Create the view object $view = $this->getView('maintenance', 'json'); // View $view->setLayout('icecat'); // Load the model $view->setModel($this->getModel('maintenance', 'CsviModel'), true); $view->setModel($this->getModel( 'log', 'CsviModel' )); // Now display the view $view->display(); } /** * Optimize the database tables * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function optimizeTables() { // Prepare $jinput = JFactory::getApplication()->input; $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getOptimizeTables(); // Finish $model->getFinishProcess(); // Redirect if (!$jinput->get('cron', false, 'bool')) $this->_outputHtml(); else $this->_outputCron(); } /** * Backup the VirtueMart tables * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function backupVm() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getBackupVirtueMart(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Empty the VirtueMart tables * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function emptyDatabase() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getEmptyDatabase(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Unpublish products in unpublished categories * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.5 */ public function unpublishProductByCategory() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->getUnpublishProductByCategory(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } /** * Cancel the loading of the ICEcat index * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.3 */ public function cancelImport() { // Clean the session $session = JFactory::getSession(); $option = JRequest::getVar('option'); $session->set($option.'.icecat_index_file', serialize('0')); $session->set($option.'.icecat_rows', serialize('0')); $session->set($option.'.icecat_position', serialize('0')); $session->set($option.'.icecat_records', serialize('0')); $session->set($option.'.icecat_wait', serialize('0')); // Redirect back to the maintenance page $this->setRedirect('index.php?option='.JRequest::getCmd('option').'&view=maintenance'); } /** * Delete all CSVI VirtueMart backup tables * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.5 */ public function removeCsviTables() { // Prepare $model = $this->getModel('maintenance'); $model->getPrepareMaintenance(); // Perform the task $model->removeCsviTables(); // Finish $model->getFinishProcess(); // Redirect if (!JRequest::getBool('cron', false)) $this->_outputHtml(); else $this->_outputCron(); } } ?> PKG$C\2&&logdetails.phpnuW+Ainput; // Check if the run ID is set $run_id = $jinput->get('run_id', array(), 'array'); // Get the first Run ID only $run_id = $run_id[0]; if ($run_id > 0) { $jinput->set('run_id', $run_id); // Create the view object $view = $this->getView('logdetails', 'html'); // Standard model $view->setModel( $this->getModel( 'logdetails', 'CsviModel' ), true ); // Log functions $view->setModel( $this->getModel( 'log', 'CsviModel' )); // Now display the view $view->display(); } else { $this->setRedirect('index.php?option=com_csvi&view=log', JText::_('COM_CSVI_NO_RUNID_FOUND'), 'error'); } } /** * Cancel the operation and return to the log view * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 4.0 */ public function cancel() { $this->setRedirect('index.php?option=com_csvi&view=log'); } } ?> PKG$C\ zinstall.json.phpnuW+AgetView('install', 'json'); // Standard model $view->setModel( $this->getModel( 'install', 'CsviModel' ), true ); $view->setModel( $this->getModel( 'availablefields', 'CsviModel' )); $view->setModel( $this->getModel( 'maintenance', 'CsviModel' )); $view->display(); } } ?> PKG$C\#`h::templatetype.phpnuW+A false)); return $model; } } ?>PKG$C\ȔO7  log.phpnuW+AregisterTask('remove_all','remove'); } /** * Cancel the operation * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.5 */ public function cancel() { $this->setRedirect('index.php?option=com_csvi&view=log'); } /** * Download a debug log file * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.0 */ public function downloadDebug() { $log = $this->getModel('log', 'CsviModel'); $log->downloadDebug(); } /** * Read a logfile from disk and show it in a popup * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.0 */ public function LogReader() { $jinput = JFactory::getApplication()->input; $jinput->set('view', 'log'); $jinput->set('layout', 'logreader'); $jinput->set('hidemainmenu', 1); parent::display(); } /** * Delete log files * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.0 */ public function remove() { $jinput = JFactory::getApplication()->input; $model = $this->getModel('log'); switch ($this->getTask()) { case 'remove': $results = $model->getDelete(); break; case 'remove_all': $results = $model->getDeleteAll(); break; } foreach ($results as $type => $messages) { foreach ($messages as $msg) { if ($type == 'ok') $this->setMessage($msg); else if ($type == 'nok') $this->setMessage($msg, 'error'); } } $this->setRedirect('index.php?option=com_csvi&view=log'); } } ?> PKG$C\r  export.phpnuW+AregisterTask('getUser','getData'); $this->registerTask('getProduct','getData'); $this->registerTask('getItemProduct','getData'); $this->registerTask('loadfields','getData'); $this->registerTask('loadtables','getData'); $this->registerTask('loadsites','getData'); } /** * Show the export option screen * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.0 */ public function Export() { $jinput = JFactory::getApplication()->input; // Create the view object $view = $this->getView('export', $jinput->get('format', 'html')); // Standard model $view->setModel( $this->getModel( 'export', 'CsviModel' ), true ); $view->setModel( $this->getModel( 'templates', 'CsviModel' )); $view->setModel( $this->getModel( 'availablefields', 'CsviModel' )); // Now display the view $view->display(); } /** * Retrieve different kinds of data in JSON format * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.0 */ public function getData() { // Create the view object $view = $this->getView('export', 'json'); // Standard model $view->setModel( $this->getModel( 'export', 'CsviModel' ), true ); $view->setModel( $this->getModel( 'availablefields', 'CsviModel' )); $view->setLayout('export'); // Now display the view $view->display(); } } ?> PKG$C\Mdmaintenance.json.phpnuW+AgetView('maintenance', 'json'); // View $view->setLayout('availablefields'); // Load the model $view->setModel($this->getModel('maintenance', 'CsviModel'), true); $view->setModel($this->getModel( 'availablefields', 'CsviModel' )); // Now display the view $view->display(); } } ?> PKG$C\ /_  maintenance.raw.phpnuW+AregisterTask('sortcategories', 'options'); $this->registerTask('icecatsettings', 'options'); } /** * Load the ICEcat settings * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.0 */ public function options() { // Create the view object $view = $this->getView('maintenance', 'raw'); // Load the model $view->setModel($this->getModel('maintenance', 'CsviModel'), true); // Now display the view $view->display(); } /** * Load the operations * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 4.0 */ public function operations() { $model = $this->getModel(); $options = $model->getOperations(); echo $options; } } ?> PKG$C\   process.phpnuW+AregisterTask('saveasnew','save'); } /** * Save a template * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return void * @since 3.0 */ public function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $jinput = JFactory::getApplication()->input; $model = $this->getModel('templates'); // Store the form fields $app = JFactory::getApplication(); $data = $jinput->get('jform', array(), 'array'); // Re-order the import fields if (array_key_exists('import_fields', $data)) { $fields = array(); foreach ($data['import_fields']['_process_field'] as $field) { $fields[] = $field; } $data['import_fields']['_process_field'] = $fields; // Combine field $fields = array(); foreach ($data['import_fields']['_combine_field'] as $field) { $fields[] = $field; } $data['import_fields']['_combine_field'] = $fields; } // Re-order the export fields else if (array_key_exists('export_fields', $data)) { // Process field $fields = array(); foreach ($data['export_fields']['_process_field'] as $field) { $fields[] = $field; } $data['export_fields']['_process_field'] = $fields; // Combine field $fields = array(); foreach ($data['export_fields']['_combine_field'] as $field) { $fields[] = $field; } $data['export_fields']['_combine_field'] = $fields; // Sort field $fields = array(); foreach ($data['export_fields']['_sort_field'] as $field) { $fields[] = $field; } $data['export_fields']['_sort_field'] = $fields; // Replace field $fields = array(); foreach ($data['export_fields']['_replace_field'] as $field) { $fields[] = $field; } $data['export_fields']['_replace_field'] = $fields; } // Save the data $id = $model->save($data); // Redirect back to the export page $this->setRedirect(JRoute::_('index.php?option=com_csvi&view=process&template_id='.$id, false)); } /** * Remove a template * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return void * @since 3.0 */ public function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $model = $this->getModel('templates'); // Save the data $model->remove(); // Redirect back to the export page $this->setRedirect(JRoute::_('index.php?option=com_csvi&view=process', false)); } /** * Import is all finished, show the results page * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.0 */ public function finished() { // Create the view object $view = $this->getView('process', 'result'); // Standard model $view->setModel( $this->getModel( 'process', 'CsviModel' ), true ); // Log functions $view->setModel( $this->getModel( 'log', 'CsviModel' )); // Set the layout file $view->setLayout('import_result'); // Now display the view $view->display(); } /** * Cancel a running import * * @copyright * @author RolandD * @todo Figure out the session vars * @see * @access public * @param * @return * @since 3.0 */ public function cancelImport() { $jinput = JFactory::getApplication()->input; if ($jinput->get('was_preview', false, 'bool')) { $this->setRedirect('index.php?option=com_csvi&view=import', JText::_('COM_CSVI_IMPORT_CANCELLED'), 'notice'); } else { // Load the data from the session $session = JFactory::getSession(); $option = $jinput->get('option'); // The template require_once(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/template.php'); $template = unserialize($session->get($option.'.global.template')); $csvilog = unserialize($session->get($option.'.csvilog')); if (is_object($template)) { // Enable the session $jinput->set('importsession', true); // Set the template $jinput->set('template', $template); // The logger $jinput->set('csvilog', $csvilog); // Set the file handler $jinput->set('csvifile', unserialize($session->get($option.'.csvifile'))); // Load the total line counter $jinput->set('totalline', unserialize($session->get($option.'.totalline'))); // Load the total of records processed $jinput->set('recordsprocessed', unserialize($session->get($option.'.recordsprocessed'))); // Load the field settings $jinput->set('csvifields', unserialize($session->get($option.'.csvifields'))); // Load the column headers $jinput->set('columnheaders', unserialize($session->get($option.'.csvicolumnheaders'))); // Load the preview handler $jinput->set('csvipreview', unserialize($session->get($option.'.csvipreview'))); // Finish the process $model = $this->getModel('importfile'); $model->finishProcess(true); // Store the import as cancelled $db = JFactory::getDbo(); // Get the records processed $query = $db->getQuery(true); $query->select('COUNT(id) AS records'); $query->from('#__csvi_log_details'); $query->where('log_id = '.$csvilog->getLogId()); $db->setQuery($query); $records = $db->loadResult(); // Store the data $query = $db->getQuery(true); $query->update('#__csvi_logs'); $query->set('records = '.$records); $query->set('run_cancelled = 1'); $query->where('run_id = '.$csvilog->getId()); $db->setQuery($query); $db->query(); // Return to the import result screen $this->setRedirect('index.php?option=com_csvi&task=process.finished&run_id='.$csvilog->getId(), JText::_('COM_CSVI_IMPORT_CANCELLED'), 'notice'); } else { // Return to the import result screen $this->setRedirect('index.php?option=com_csvi&view=process', JText::_('COM_CSVI_IMPORT_CANCELLED'), 'notice'); } } } } ?> PKG$C\`availablefields.phpnuW+A PKG$C\R·replacements.phpnuW+A true)); return $model; } } ?> PKG$C\-c   about.phpnuW+AgetModel('settings'); if ($model->getResetSettings()) { $msg = JText::_('COM_CSVI_SETTINGS_RESET_SUCCESSFULLY'); $msgtype = ''; } else { $msg = JText::_('COM_CSVI_SETTINGS_NOT_RESET_SUCCESSFULLY'); $msgtype = 'error'; } $this->setRedirect('index.php?option=com_csvi&view=settings', $msg, $msgtype); } } ?> PKG$C\!Pήcron.phpnuW+Ainput; $data = $jinput->post->get('jform', array(), 'array'); $jinput->set('com_csvi.data', $data); // Create the view object $view = $this->getView('cron', 'html'); // Standard model $view->setModel( $this->getModel( 'cron', 'CsviModel' ), true ); // Now display the view $view->display(); } } ?> PKG$C\VWWcsvi.phpnuW+A PKG$C\K] exportfile.phpnuW+Ainput; $view = $this->getView('exportfile', 'html'); // Default model $view->setModel( $this->getModel('exportfile', 'CsviModel' ), true ); // Log functions $view->setModel( $this->getModel('log', 'CsviModel' )); // Settings functions $view->setModel( $this->getModel('settings', 'CsviModel' )); // General import functions $view->setModel( $this->getModel('export', 'CsviModel' )); // General category functions $view->setModel( $this->getModel('category', 'CsviModel' )); // Available fields $view->setModel( $this->getModel('availablefields', 'CsviModel' )); // Load the model $model = $this->getModel('exportfile'); // Add extra helper paths $view->addHelperPath(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/xml'); $view->addHelperPath(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/html'); // Load the helper classes $view->loadHelper('csvidb'); $view->loadHelper('template'); $view->loadHelper('csvisef'); // Prepare for export if ($model->getPrepareExport()) { // Set the export override $app = JFactory::getApplication(); $template = $jinput->get('template', null, null); $overridefile = JPATH_BASE.'/templates/'.$app->getTemplate().'/html/com_csvi/models/export/'.$template->get('operation', 'options').'.php'; // Add the export model path if override exists if (file_exists($overridefile)) $this->addModelPath(JPATH_BASE.'/templates/'.$app->getTemplate().'/html/com_csvi/models/'.$template->get('component', 'options').'/export'); else $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.'/models/'.$template->get('component', 'options').'/export'); // Load export specifc helper $view->loadHelper($template->get('component', 'options')); $view->loadHelper($template->get('component', 'options').'_config'); // Start the export $view->display(); } else { // Clean up first $model->getCleanSession(); // Redirect back to the export page $this->setRedirect('index.php?option=com_csvi&view=process', JText::_('COM_CSVI_ERROR_EXPORT_PREP'), 'error'); } } } ?>PKG$C\}i@@replacement.phpnuW+A false)); return $model; } } ?>PKG$C\D\, , importfile.phpnuW+A importFile * 2. models/importfile.php -> prepareImport (sets session values) * 3. views/importfile/view.html.php -> display * 4. views/importfile/tmpl/default.php JS calls import * 5. controllers/importfile.json.php -> doImport * 6. models/importfile.php -> getDoImport (sets session values) * 7. views/importfile/view.json.php -> return result * * @package CSVI */ class CsviControllerImportfile extends JController { /** * Load import model files * * Here the models are loaded that are used for import. Special is the * import model file as this is included based on the template type * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 3.0 */ public function process() { $jinput = JFactory::getApplication()->input; // Load the import type $vtype = ($jinput->get('cron', false, 'bool')) ? 'cron' : 'html'; if ($vtype == 'html') { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); } // Set the start time of the import $session = JFactory::getSession(); $option = $jinput->get('option'); $session->set($option.'.runtime', time()); // Start with a clean session $session->set($option.'.select_template', serialize($jinput->get('select_template', 0, 'int'))); $session->set($option.'.global.template', serialize('0')); $session->set($option.'.csvicolumnheaders', serialize('0')); $session->set($option.'.csvifields', serialize('0')); $session->set($option.'.csvifile', serialize('0')); $session->set($option.'.csvilog', serialize('0')); $session->set($option.'.filepos', serialize('0')); $session->set($option.'.recordsprocessed', serialize('0')); $session->set($option.'.totalline', serialize('0')); $model = $this->getModel('templates'); // Create the view object $view = $this->getView('importfile', $vtype); // Load the model $view->setModel( $this->getModel( 'importfile', 'CsviModel' ), true ); // Log functions $view->setModel( $this->getModel( 'log', 'CsviModel' )); // Load the model $model = $this->getModel('importfile'); // Check which helper files to include $helper_files = $model->getHelperFiles(); if (!$helper_files) { if (!JRequest::getBool('cron', false)) { // Redirect back to the import page $this->setRedirect('index.php?option=com_csvi&view=process', JText::_('COM_CSVI_ERROR_IMPORT_FILE'), 'error'); } else { echo JText::_('COM_CSVI_ERROR_IMPORT_FILE')."\n"; $view->setLayout('cron'); } } else { // Load helper files $view->addHelperPath(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/file/import'); $view->loadHelper('file'); $view->loadHelper('template'); if (!empty($helper_files)) { foreach ($helper_files as $helper) { $view->loadHelper($helper); } } // Prepare for import if ($model->getPrepareImport()) { // Start the import switch ($vtype) { case 'cron': $view->setLayout('cron'); return true; break; default: break; } // Show the screen $view->display(); } else { // Clean up $model->getCleanSession(); switch ($vtype) { case 'cron': $jinput->set('error', true); $view->setLayout('cron'); $view->display(); break; default: // Redirect back to the import page $this->setRedirect('index.php?option=com_csvi&view=process', JText::_('COM_CSVI_ERROR_IMPORT_FILE'), 'error'); break; } } } } /** * Import records called via JavaScript * * @copyright * @author RolandD * @todo remove global from session vars * @todo * @see prepareImport (models/importfile) where the session data is set * @see _finishProcess (models/importfile) where the session data is unset * @access public * @param * @return * @since 3.0 */ public function doImport() { // Process first $this->process(); // Start the import $jinput = JFactory::getApplication()->input; // Create the view object $vtype = ($jinput->get('cron', false, 'bool')) ? 'cron' : 'json'; $view = $this->getView('importfile', $vtype); // Load the data from the session $session = JFactory::getSession(); $option = $jinput->get('option'); // Set the run ID $jinput->set('run_id', $session->get($option.'.run_id')); // Check which helper files to include $helper_files = unserialize($session->get($option.'.helper_files')); // Load helper files $view->addHelperPath(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/file/import'); $view->loadHelper('file'); $view->loadHelper('template'); $view->loadHelper('icecat'); $view->loadHelper('settings'); if (!empty($helper_files)) { foreach ($helper_files as $helper) { $view->loadHelper($helper); } } // The template $template = unserialize($session->get($option.'.global.template')); if (is_object($template)) { // Enable the session $jinput->set('importsession', true); // Set the template $jinput->set('template', $template); // The logger $jinput->set('csvilog', unserialize($session->get($option.'.csvilog'))); // Set the file handler $jinput->set('csvifile', unserialize($session->get($option.'.csvifile'))); // Load the total line counter $jinput->set('totalline', unserialize($session->get($option.'.totalline'))); // Load the total of records processed $jinput->set('recordsprocessed', unserialize($session->get($option.'.recordsprocessed'))); // Set the fields found in the import file $jinput->set('csvifields', unserialize($session->get($option.'.csvifields'))); // Set the list of available fields $jinput->set('avfields', unserialize($session->get($option.'.avfields'))); // Load the column headers $jinput->set('columnheaders', unserialize($session->get($option.'.csvicolumnheaders'))); // Load the preview handler $jinput->set('csvipreview', unserialize($session->get($option.'.csvipreview'))); // Set the override for the operation model if exists $app = JFactory::getApplication(); $overridefile = JPATH_BASE.'/templates/'.$app->getTemplate().'/html/com_csvi/models/'.$template->get('component', 'options').'/import/'.$template->get('operation', 'options').'.php'; if (file_exists($overridefile)) $this->addModelPath(JPATH_BASE.'/templates/'.$app->getTemplate().'/html/com_csvi/models/'.$template->get('component', 'options').'/import'); else $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.'/models/'.$template->get('component', 'options').'/import'); // Load the model for the component $view->setModel($this->getModel('importfile', 'CsviModel'), true); // Log functions $view->setModel($this->getModel('log', 'CsviModel')); // General category functions $view->setModel($this->getModel('category', 'CsviModel')); // Available fields $view->setModel($this->getModel('availablefields', 'CsviModel')); // Load import specifc helper $view->loadHelper($template->get('component', 'options')); $view->loadHelper($template->get('component', 'options').'_config'); // Prepare for import $view->get('DoImport'); } else { $jinput->set('importsession', false); } // Set the output screen switch ($vtype) { case 'cron': $view->setLayout('cron'); break; default: break; } // Show the screen $view->display(); } } ?> PKG$C\7,, install.phpnuW+A PKG$C\templatetypes.phpnuW+A PKG$C\Ӽnzz about.raw.phpnuW+AgetModel(); echo json_encode($model->createFolder()); } } ?> PKG$C\]?-templatetypes.json.phpnuW+Ainput; $model = $this->getModel('templatetypes'); $action = $jinput->get('action'); $component = $jinput->get('component'); echo json_encode($model->loadTemplateTypes($action, $component)); } public function loadSettings() { $jinput = JFactory::getApplication()->input; $model = $this->getModel('templatetypes'); $action = $jinput->get('action'); $component = $jinput->get('component'); $operation = $jinput->get('operation'); echo $model->loadSettings($action, $component, $operation); } } ?> PKG$C\+}mmimportfile.json.phpnuW+A importFile * 2. models/importfile.php -> prepareImport (sets session values) * 3. views/importfile/view.html.php -> display * 4. views/importfile/tmpl/default.php JS calls import * 5. controllers/importfile.php -> doImport * 6. models/importfile.php -> getDoImport (sets session values) * 7. views/importfile/view.json.php -> return result * * @package CSVI */ class CsviControllerImportfile extends JController { /** * Import records called via JavaScript * * @copyright * @author RolandD * @todo remove global from session vars * @todo * @see prepareImport (models/importfile) where the session data is set * @see _finishProcess (models/importfile) where the session data is unset * @access public * @param * @return * @since 3.0 */ public function doImport() { $jinput = JFactory::getApplication()->input; // Create the view object $vtype = ($jinput->get('cron', false, 'bool')) ? 'cron' : 'json'; $view = $this->getView('importfile', $vtype); // Load the data from the session $session = JFactory::getSession(); $option = $jinput->get('option'); // Set the run ID $jinput->set('run_id', $session->get($option.'.run_id')); // Check which helper files to include $helper_files = unserialize($session->get($option.'.helper_files')); // Load helper files $view->addHelperPath(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/file/import'); $view->loadHelper('file'); $view->loadHelper('template'); $view->loadHelper('icecat'); $view->loadHelper('settings'); if (!empty($helper_files)) { foreach ($helper_files as $helper) { $view->loadHelper($helper); } } // The template $template = unserialize($session->get($option.'.global.template')); if (is_object($template)) { // Enable the session $jinput->set('importsession', true); // Set the template $jinput->set('template', $template); // The logger $jinput->set('csvilog', unserialize($session->get($option.'.csvilog'))); // Set the file handler $jinput->set('csvifile', unserialize($session->get($option.'.csvifile'))); // Load the total line counter $jinput->set('totalline', unserialize($session->get($option.'.totalline'))); // Load the total of records processed $jinput->set('recordsprocessed', unserialize($session->get($option.'.recordsprocessed'))); // Set the fields found in the import file $jinput->set('csvifields', unserialize($session->get($option.'.csvifields'))); // Set the list of available fields $jinput->set('avfields', unserialize($session->get($option.'.avfields'))); // Load the column headers $jinput->set('columnheaders', unserialize($session->get($option.'.csvicolumnheaders'))); // Load the preview handler $jinput->set('csvipreview', unserialize($session->get($option.'.csvipreview'))); // Set the override for the operation model if exists $app = JFactory::getApplication(); $overridefile = JPATH_BASE.'/templates/'.$app->getTemplate().'/html/com_csvi/models/'.$template->get('component', 'options').'/import/'.$template->get('operation', 'options').'.php'; if (file_exists($overridefile)) $this->addModelPath(JPATH_BASE.'/templates/'.$app->getTemplate().'/html/com_csvi/models/'.$template->get('component', 'options').'/import'); else $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.'/models/'.$template->get('component', 'options').'/import'); // Load the model for the component $view->setModel($this->getModel('importfile', 'CsviModel'), true); // Log functions $view->setModel($this->getModel('log', 'CsviModel')); // General category functions $view->setModel($this->getModel('category', 'CsviModel')); // Available fields $view->setModel($this->getModel('availablefields', 'CsviModel')); // Load import specifc helper $view->loadHelper($template->get('component', 'options')); $view->loadHelper($template->get('component', 'options').'_config'); // Prepare for import $view->get('DoImport'); } else { $jinput->set('importsession', false); } // Set the output screen switch ($vtype) { case 'cron': $view->setLayout('cron'); break; default: break; } // Show the screen $view->display(); } } ?> PKG$C\bprocess.json.phpnuW+Ainput; // Load the appropiate helper file $component = $jinput->get('component'); $users = array(); if ($component) { require_once(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/'.$component.'.php'); $helper = new $component; $users = $helper->getOrderUser(); } echo json_encode($users); } /** * Method Description * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return string json encoded values * @since 4.0 */ public function getProduct() { $jinput = JFactory::getApplication()->input; // Load the appropiate helper file $component = $jinput->get('component'); $users = array(); if ($component) { require_once(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/'.$component.'.php'); $helper = new $component; $products = $helper->getOrderProduct(); } echo json_encode($products); } /** * Method Description * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return string json encoded values * @since 4.0 */ public function getItemProduct() { $jinput = JFactory::getApplication()->input; // Load the appropiate helper file $component = $jinput->get('component'); $users = array(); if ($component) { require_once(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/'.$component.'.php'); $helper = new $component; $products = $helper->getOrderItemProduct(); } echo json_encode($products); } /** * Load the available sites for XML or HTML export * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 4.0 */ public function loadSites() { $jinput = JFactory::getApplication()->input; $model = $this->getModel('process'); $options = array(); $options[] = JHtml::_('select.option', '', JText::_('COM_CSVI_CHOOSE_WEBSITE')); $sites = $model->getExportSites($jinput->get('exportsite')); foreach ($sites as $site) { $options[] = JHtml::_('select.option', $site, JText::_('COM_CSVI_'.strtoupper($site))); } echo json_encode(JHtml::_('select.genericlist', $options, 'jform[general][export_site]', null, 'value', 'text', $jinput->get('selected'), 'jform_general_export_site')); } /** * Load fields for the custom import/export * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 4.0 */ public function loadFields() { $jinput = JFactory::getApplication()->input; $availablefields_model = $this->getModel('availablefields'); $result = $availablefields_model->getAvailableFields($jinput->get('template_type'), $jinput->get('component', 'com_csvi'), 'array', $jinput->get('table_name', '', 'word')); echo json_encode($result); } /** * Load the category tree * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return string json encoded values * @since 4.0 */ public function loadCategoryTree() { $jinput = JFactory::getApplication()->input; $helper = new Com_VirtueMart(); $options = $helper->getCategoryTree($jinput->get('language')); echo json_encode($options); } /* TO BE FIGURED OUT */ public function loadTables() { $result = CsviHelper::getCustomTables(); array_unshift($result, JText::_('COM_CSVI_SELECT_TABLE_FOR_EXPORT')); echo json_encode($result); } public function getStates() { $model = $this->getModel('import'); $options = array(); $options[] = JHtml::_('select.option', 'none', JText::_('COM_CSVI_ALL_TAX_STATES')); $states = array_merge($options, $model->getStates(JRequest::getCmd('country'))); echo json_encode(JHtml::_('select.genericlist', $states, 'jform[tax][states][]', 'multiple="multiple" size="7"', 'value', 'text', 'none')); } } ?> PKrC\'U button.phpnuW+AgetModel('Searches'); if (!$model->reset()) { JError::raiseWarning(500, $model->getError()); } $this->setRedirect('index.php?option=com_search&view=searches'); } } PKD\{;6link.phpnuW+AgetModel(); JArrayHelper::toInteger($ids); // 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'); } /** * Proxy for getModel. * @since 1.6 */ public function getModel($name = 'Link', $prefix = 'RedirectModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } } PKJD\"E message.phpnuW+AsetRedirect('index.php?option=com_messages&view=message&layout=edit&reply_id='.$replyId); } else { $this->setMessage(JText::_('COM_MESSAGES_INVALID_REPLY_ID')); $this->setRedirect('index.php?option=com_messages&view=messages'); } } } PKJD\W֙ messages.phpnuW+A true)) { $model = parent::getModel($name, $prefix, $config); return $model; } } PKJD\x: config.phpnuW+AgetModel('Config', 'MessagesModel'); $data = JRequest::getVar('jform', array(), 'post', '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+B\V index.htmlnuW+APK+B\"d Yplugins.phpnuW+APK+B\桜} ^plugin.phpnuW+APK+B\) `.htaccessnuW+APK\B\G category.phpnuW+APK\B\>,n n categories.phpnuW+APKeB\u $weblink.phpnuW+APKtB\?@ Amodules.phpnuW+APKtB\̪ Hmodule.phpnuW+APKitB\~# Wfeatured.phpnuW+APKitB\'( ( _articles.phpnuW+APKitB\:: Hjarticle.phpnuW+APKB\$$ xlevels.phpnuW+APKB\|note.phpnuW+APKB\$@[ +level.phpnuW+APKB\IJ! !  users.phpnuW+APKB\ Ey# # fgroups.phpnuW+APKB\&\}}àmail.phpnuW+APKB\sZ  xuser.phpnuW+APKB\gd22 notes.phpnuW+APKB\{{ )group.phpnuW+APKڌB\=IM++ ݺsitemap.phpnuW+APKڌB\( HH Csitemaps.phpnuW+APKB\)c folder.phpnuW+APKB\gD   file.json.phpnuW+APKB\'#'#file.phpnuW+APKijB\/v/application.phpnuW+APKijB\0S  V+component.phpnuW+APKC\(   8ajax.json.phpnuW+APKG$C\22Amaintenance.phpnuW+APKG$C\2&&tlogdetails.phpnuW+APKG$C\ z5|install.json.phpnuW+APKG$C\#`h::templatetype.phpnuW+APKG$C\ȔO7  ylog.phpnuW+APKG$C\r  ɏexport.phpnuW+APKG$C\Md maintenance.json.phpnuW+APKG$C\ /_  maintenance.raw.phpnuW+APKG$C\   lprocess.phpnuW+APKG$C\`availablefields.phpnuW+APKG$C\R·wreplacements.phpnuW+APKG$C\-c   about.phpnuW+APKG$C\0 __ settings.phpnuW+APKG$C\!Pήcron.phpnuW+APKG$C\VWW~csvi.phpnuW+APKG$C\K]  exportfile.phpnuW+APKG$C\}i@@replacement.phpnuW+APKG$C\D\, , vimportfile.phpnuW+APKG$C\7,, install.phpnuW+APKG$C\Gtemplatetypes.phpnuW+APKG$C\Ӽnzz  about.raw.phpnuW+APKG$C\]?-templatetypes.json.phpnuW+APKG$C\+}mmimportfile.json.phpnuW+APKG$C\b'process.json.phpnuW+APKrC\'U :button.phpnuW+APKrC\C{y  =imagemanager.phpnuW+APKrC\~^Y Alayout.phpnuW+APKD\ISnn Dsearches.phpnuW+APKD\{;6Hlink.phpnuW+APKD\HHLL Jlinks.phpnuW+APKJD\"E cQmessage.phpnuW+APKJD\W֙ Vmessages.phpnuW+APKJD\x: Zconfig.phpnuW+APK>>kb