File manager - Edit - /home/opticamezl/www/newok/Controller.zip
Back
PK �a�\�FD�)$ )$ WeblinkController.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage com_weblinks * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Weblinks\Site\Controller; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\Uri\Uri; use Joomla\Utilities\ArrayHelper; /** * Weblinks class. * * @since 1.5 */ class WeblinkController extends FormController { /** * The URL view item variable. * * @var string * @since 1.6 */ protected $view_item = 'form'; /** * The URL view list variable. * * @var string * @since 1.6 */ protected $view_list = 'categories'; /** * The URL edit variable. * * @var string * @since 3.2 */ protected $urlVar = 'a.id'; /** * Method to add a new record. * * @return boolean True if the article can be added, false if not. * * @since 1.6 */ public function add() { if (!parent::add()) { // Redirect to the return page. $this->setRedirect($this->getReturnPage()); return false; } return true; } /** * 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 = []) { $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int'); if ($categoryId) { // If the category has been passed in the URL check it. return $this->app->getIdentity()->authorise('core.create', $this->option . '.category.' . $categoryId); } // In the absence of better information, revert to the component permissions. return parent::allowAdd($data); } /** * 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 = [], $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; if (!$recordId) { return false; } $record = $this->getModel()->getItem($recordId); $categoryId = (int) $record->catid; if ($categoryId) { // The category has been set. Check the category permissions. $user = $this->app->getIdentity(); // First, check edit permission if ($user->authorise('core.edit', $this->option . '.category.' . $categoryId)) { return true; } // Fallback on edit.own if ($user->authorise('core.edit.own', $this->option . '.category.' . $categoryId) && $record->created_by == $user->id) { return true; } return false; } // 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') { $return = parent::cancel($key); // Redirect to the return page. $this->setRedirect($this->getReturnPage()); return $return; } /** * 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') { return parent::edit($key, $urlVar); } /** * 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 = 'Site', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } /** * 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 = null) { $append = parent::getRedirectToItemAppend($recordId, $urlVar); $itemId = $this->input->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 = $this->input->get('return', null, 'base64'); if (empty($return) || !Uri::isInternal(base64_decode($return))) { return Uri::base(); } return base64_decode($return); } /** * 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') { // Get the application $app = $this->app; // Get the data from POST $data = $this->input->post->get('jform', [], 'array'); // Save the data in the session. $app->setUserState('com_weblinks.edit.weblink.data', $data); $result = parent::save($key, $urlVar); // If ok, redirect to the return page. if ($result) { // Flush the data from the session $app->setUserState('com_weblinks.edit.weblink.data', null); $this->setRedirect($this->getReturnPage()); } return $result; } /** * Go to a weblink * * @return void * * @throws \Exception * * @since 1.6 */ public function go() { // Get the ID from the request $id = $this->input->getInt('id'); // Get the model, requiring published items $modelLink = $this->getModel('Weblink'); $modelLink->setState('filter.published', 1); // Get the item $link = $modelLink->getItem($id); // Make sure the item was found. if (empty($link)) { throw new \Exception(Text::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'), 404); } // Check whether item access level allows access. $groups = $this->app->getIdentity()->getAuthorisedViewLevels(); if (!\in_array($link->access, $groups)) { throw new \Exception(Text::_('JERROR_ALERTNOAUTHOR'), 403); } // Check whether category access level allows access. $modelCat = $this->getModel('Category', 'Site', ['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)) { throw new \Exception(Text::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'), 404); } // Check whether item access level allows access. if (!\in_array($category->access, $groups)) { throw new \Exception(Text::_('JERROR_ALERTNOAUTHOR'), 403); } // Redirect to the URL if ($link->url) { $modelLink->hit($id); $this->app->redirect($link->url, 301); } throw new \Exception(Text::_('COM_WEBLINKS_ERROR_WEBLINK_URL_INVALID'), 404); } } PK �a�\@�u% DisplayController.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage com_finder * * @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Finder\Site\Controller; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\Component\Finder\Administrator\Helper\LanguageHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Finder Component Controller. * * @since 2.5 */ class DisplayController extends BaseController { /** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached. [optional] * @param array $urlparams An array of safe URL parameters and their variable types, * for valid values see {@link \JFilterInput::clean()}. [optional] * * @return static This object is to support chaining. * * @since 2.5 */ public function display($cachable = false, $urlparams = []) { $input = $this->app->getInput(); $cachable = true; // Load plugin language files. LanguageHelper::loadPluginLanguage(); // Set the default view name and format from the Request. $viewName = $input->get('view', 'search', 'word'); $input->set('view', $viewName); // Don't cache view for search queries if ($input->get('q', null, 'string') || $input->get('f', null, 'int') || $input->get('t', null, 'array')) { $cachable = false; } $safeurlparams = [ 'f' => 'INT', 'lang' => 'CMD', ]; return parent::display($cachable, $safeurlparams); } } PK ғ�\]�2� SuggestionsController.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage com_finder * * @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Finder\Site\Controller; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\MVC\Controller\BaseController; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Suggestions \JSON controller for Finder. * * @since 2.5 */ class SuggestionsController extends BaseController { /** * Method to find search query suggestions. Uses awesomplete * * @return void * * @since 3.4 */ public function suggest() { $app = $this->app; $app->mimeType = 'application/json'; // Ensure caching is disabled as it depends on the query param in the model $app->allowCache(false); $suggestions = $this->getSuggestions(); // Send the response. $app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet); $app->sendHeaders(); echo '{ "suggestions": ' . json_encode($suggestions) . ' }'; } /** * Method to find search query suggestions for OpenSearch * * @return void * * @since 4.0.0 */ public function opensearchsuggest() { $app = $this->app; $app->mimeType = 'application/json'; $result = []; $result[] = $app->getInput()->request->get('q', '', 'string'); $result[] = $this->getSuggestions(); // Ensure caching is disabled as it depends on the query param in the model $app->allowCache(false); // Send the response. $app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet); $app->sendHeaders(); echo json_encode($result); } /** * Method to retrieve the data from the database * * @return array The suggested words * * @since 3.4 */ protected function getSuggestions() { $return = []; $params = ComponentHelper::getParams('com_finder'); if ($params->get('show_autosuggest', 1)) { // Get the suggestions. $model = $this->getModel('Suggestions'); $return = $model->getItems(); } // Check the data. if (empty($return)) { $return = []; } return $return; } } PK ғ�\#{��� � Controller/flv_6920417fbd737.zipnu &1i� PK �Tu[^�k� � b_6920417fbd737.tmp�Ums�H�+S���3Ë著�4�1�q1�gQ�`pQ�Ťr�}g�w��h���{��?����.0��j�CVHւ,�5?!���*� 'U����j��5"�J� P� )�d�"˙���3I1* sS+�l4A�A8sv;�(,p�#,���:W%�Ņ���g��L�l��g�&g@�ST{IB�@����4EQ\C�s��NO5�6٫F^�a7� >8+�)RPg���1��`�'z݄X�C����!���_�[���$_Ѹ�/����j�oN���y+'�����~q�$��}�%�&��2���w����~�p��o7a�=.��ފ�u<ێ����c�1&f�F�͜p�C�!s���94�7;�x�@(81�� ����8ˡ5� 3=y�?@*�L����~�"h'm���m�~����dt�� T�ϋ�{Y/�-����V� ��#�.��8�DIJlUAk<�Z�Q����v��U�U���I�����$N�G�O�x%G��*��OBg�A���_�Eǎ���X����I̾p�Uh��))� u��a��K��Z�g�:_�2��Gҙ��Rl v��!19�ͬZ���,��3��z�,g���yn���yA�,�T�XZ�J�o&�V?���5�аZs��ku厗5by�,��e�#�갤U�iœid�w\ϲ��(�Oƣ��2=��Y-�*zT�K�s�䄦A<�ɇ��h�fL�ANB�,�{��&�d��w�"�Bo0[���U�fS�� }yj��>��)T&�z�)i�>�o锢v�BU������g���ω�4``��,�l��۳%E. 7�lS�&( �XEp$8���V�A��Wwt�D�����M�<�p}���!"������MZ��l�iv���7M�Mk�� ��0/0wRT�p�dv|d7D��FF\_�PK �Tu[�n� � c_6920417fbd737.tmp]x���H��| U�j�w�����7Wn{i䯼�ͼ�ܚ��� �$�)�ĉ�_�>}������?���W����l�~�Z�5�N:W�0] յ�S�� ��h�]V���+�z��9p5i��'�:�����'����?��/e�ŭ�U�f��U,]{�\ܽţ�Q�" ���M^���(����K���{+�ځi`�߮7�6.�e�����9�%BKk X��F���y��e�x��� @�X���H�@2�A��� �� -�_��ۭAN�s�� ����{� `]ld�"�:��5%%&���k��#?����z�3�7�u�����[�8�����*G옶=x�?���[��u\�T,��T["U�W_�f�!����������TbA�� ��X2'p"�:��hK�����Ӗ G���>x�l6��{���/�9�!���"�s�S����}#�W��H��l�{�"��}�5;&[U#�O�58�\�G��Dm� wb!&c��s��r�C��KJF��$���Ȳl�!Kt����|�CrB4��j\=T1y*����^�R5�>�)Q!&g3C����}�va���H#��v��"C ���D6]ɥ N/& w�r;K�y��&r�:e�[�%��0�]-�U��5�n#�.��n�C����{�6���Բ�g�aY���� em^��y����Zh��Ś�K���sD�l+��Ů�H�[m�Z�V���$�m�=٫�v=�i�{�M�s�D �栻�"�H<��ne��9��D�����(칷?�<����.�ʧ����+ݒ\N'��i^�G3�Lr8��vM�ǼdX�mŋLp�H��Q|�����>�5Lcaۑ�*<�bQ`�$96��_x�U�ʺ���.�hp��J�P�T.���c�J�"]0+�ܺ�&��Q\�.��;�ӕ�o߰c��/B��C@�>,���LO�Y�F/�4m�f�ϝ�7�G�)j�&�䪯 ��yW��c��f��j>����SPos�O@���I4q���}X��m�N}��Nf�0�N��W}N��2���"�j}@ls�8��!��fp�6�}�ӛ~�X��kǷ'5o�L�]��r� �c��|��|�3b�1�<8�j�%�Q+�)f:d%�Q����`��陕zЭ�o >�f�S}Ϋ!��p��� ��R�7BB�r�*tR[E�=�h����yU�A���i�l�z]�:ɯ3�;���|0f���s�#� ������A L�!�c�ۙ1gY�7n��������_���Η�exhsu�r��b����<����G��ZD��ɸP��\D�KX] ,�̀�S;���J=�2Vl�<�i�� �ʒ�\>��%d����&�4� �@�1!r��-B�-�Qt��ɘGd!V#�5l��0S�Oz�8��HTKM��(��k�a���|!K�蓷�8�n��3Hb�B|ءky}��*ت��|�pk.�`;Y>