jce/services/provider.php000060400000002372152455303030011473 0ustar00set( PluginInterface::class, function (Container $container) { $dispatcher = $container->get(DispatcherInterface::class); $plugin = new Jce( $dispatcher, (array) PluginHelper::getPlugin('installer', 'jce') ); $plugin->setApplication(Factory::getApplication()); $plugin->setDatabase($container->get(DatabaseInterface::class)); return $plugin; } ); } };jce/src/Extension/Jce.php000060400000004741152455303030011264 0ustar00getDatabase(); $query = $db->getQuery(true) ->select('package_id') ->from('#__extensions') ->where('element = ' . $db->quote('com_jce')); $db->setQuery($query); $packageId = $db->loadResult(); if (is_null($packageId)) { return null; } $query = $db->getQuery(true) ->select($db->quoteName('update_sites.extra_query')) ->from($db->quoteName('#__update_sites', 'update_sites')) ->join( 'INNER', $db->quoteName('#__update_sites_extensions', 'update_sites_extensions') . ' ON ' . $db->quoteName('update_sites_extensions.update_site_id') . ' = ' . $db->quoteName('update_sites.update_site_id') ) ->where($db->quoteName('update_sites_extensions.extension_id') . ' = ' . (int) $packageId); $db->setQuery($query); $result = $db->loadResult(); if ($result) { // Parse the `extra_query` to extract the key value parse_str($result, $parsedQuery); if (isset($parsedQuery['key'])) { return $parsedQuery['key']; } } return null; } /** * Get the download key from the update sites table. * * @return string|null The download key or null if not found */ public function getDownloadKey() { // get the key directly from the update sites table, eg: when updating a plugin $key = $this->getDownloadKeyFromUpdateSites(); // Return the key or null if not found return $key; } } jce/src/PluginTraits/EventsTrait.php000060400000007555152455303030013512 0ustar00 value format) * * @return bool true if credentials have been added to request or not our business, false otherwise (credentials not set by user) * * @since 3.0 */ public function onInstallerBeforePackageDownload(&$url, &$headers) { $app = Factory::getApplication(); $uri = Uri::getInstance($url); $host = $uri->getHost(); if ($host !== 'www.joomlacontenteditor.net') { return true; } // check if the key has already been set via the dlid field. This will only be available in Joomla 4.x and later $key = $uri->getVar('key', ''); // get the key from the component params or Update Sites (in the case of plugin updates) if (empty($key)) { $key = $this->getDownloadKey(); } // if no key is set... if (empty($key)) { $query = $uri->getQuery(true); // if we are attempting to update JCE Pro or JCE Plugins, display a notice message if ($this->checkIfKeyRequired($query) === true) { $app->enqueueMessage(Text::_('PLG_INSTALLER_JCE_KEY_WARNING'), 'notice'); return true; } } // Append the subscription key to the download URL if it exists if (!empty($key)) { $uri->setVar('key', $key); } // create the url string $url = $uri->toString(); // check validity of the key and display a message if it is invalid / expired try { $tmpUri = clone $uri; $tmpUri->setVar('task', 'update.validate'); $tmpUrl = $tmpUri->toString(); $response = HttpFactory::getHttp()->get($tmpUrl, array()); } catch (\RuntimeException $exception) { $app->enqueueMessage($exception->getMessage(), 'notice'); return true; } // invalid key, display a notice message if (403 == $response->code || 401 == $response->code) { $app->enqueueMessage(Text::_('PLG_INSTALLER_JCE_KEY_INVALID'), 'notice'); } // update limit exceeded if (498 === $response->code) { $app->enqueueMessage(Text::_('PLG_INSTALLER_JCE_KEY_LIMIT'), 'notice'); } return true; } }jce/jce.xml000060400000002003152455303030006557 0ustar00 plg_installer_jce 2.9.99.2 22-04-2026 Ryan Demmer info@joomlacontenteditor.net http://www.joomlacontenteditor.net Copyright (C) 2006 - 2026 Ryan Demmer. All rights reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html PLG_INSTALLER_JCE_XML_DESCRIPTION Joomla\Plugin\Installer\Jce jce.php services src en-GB.plg_installer_jce.ini en-GB.plg_installer_jce.sys.ini jce/jce.php000060400000002434152455303030006556 0ustar00params->get('updates_key', ''); return $key; } } urlinstaller/tmpl/default.php000060400000002141152455303030012367 0ustar00 * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); JFactory::getDocument()->addScriptDeclaration(' Joomla.submitbuttonurl = function() { var form = document.getElementById("adminForm"); JoomlaInstaller.showLoading(); form.installtype.value = "url" form.submit(); }; '); ?>
urlinstaller/urlinstaller.php000060400000001726152455303030012517 0ustar00 * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * UrlFolderInstaller Plugin. * * @since 3.6.0 */ class PlgInstallerUrlInstaller extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.6.0 */ protected $autoloadLanguage = true; /** * Textfield or Form of the Plugin. * * @return array Returns an array with the tab information * * @since 3.6.0 */ public function onInstallerAddInstallationTab() { $tab = array(); $tab['name'] = 'url'; $tab['label'] = JText::_('PLG_INSTALLER_URLINSTALLER_TEXT'); // Render the input ob_start(); include JPluginHelper::getLayoutPath('installer', 'urlinstaller'); $tab['content'] = ob_get_clean(); return $tab; } } urlinstaller/urlinstaller.xml000060400000001454152455303030012526 0ustar00 PLG_INSTALLER_URLINSTALLER Joomla! Project May 2016 (C) 2016 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.6.0 PLG_INSTALLER_URLINSTALLER_PLUGIN_XML_DESCRIPTION urlinstaller.php en-GB.plg_installer_urlinstaller.ini en-GB.plg_installer_urlinstaller.sys.ini packageinstaller/packageinstaller.xml000060400000001504152455303030014104 0ustar00 plg_installer_packageinstaller Joomla! Project May 2016 (C) 2016 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.6.0 PLG_INSTALLER_PACKAGEINSTALLER_PLUGIN_XML_DESCRIPTION packageinstaller.php en-GB.plg_installer_packageinstaller.ini en-GB.plg_installer_packageinstaller.sys.ini packageinstaller/packageinstaller.php000060400000001770152455303030014100 0ustar00 * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * PackageInstaller Plugin. * * @since 3.6.0 */ class PlgInstallerPackageInstaller extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.6.0 */ protected $autoloadLanguage = true; /** * Textfield or Form of the Plugin. * * @return array Returns an array with the tab information * * @since 3.6.0 */ public function onInstallerAddInstallationTab() { $tab = array(); $tab['name'] = 'package'; $tab['label'] = JText::_('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_PACKAGE_FILE'); // Render the input ob_start(); include JPluginHelper::getLayoutPath('installer', 'packageinstaller'); $tab['content'] = ob_get_clean(); return $tab; } } packageinstaller/tmpl/default.php000060400000022161152455303030013164 0ustar00 * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); JHtml::_('jquery.token'); JText::script('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_ERROR_UNKNOWN'); JText::script('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_ERROR_EMPTY'); JText::script('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG'); JFactory::getDocument()->addScriptDeclaration(' Joomla.submitbuttonpackage = function() { var form = document.getElementById("adminForm"); // do field validation if (form.install_package.value == "") { alert("' . JText::_('PLG_INSTALLER_PACKAGEINSTALLER_NO_PACKAGE', true) . '"); } else if (form.install_package.files[0].size > form.max_upload_size.value) { alert("' . JText::_('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG', true) . '"); } else { JoomlaInstaller.showLoading(); form.installtype.value = "upload" form.submit(); } }; '); // Drag and Drop installation scripts $token = JSession::getFormToken(); $return = JFactory::getApplication()->input->getBase64('return'); // Drag-drop installation JFactory::getDocument()->addScriptDeclaration( << fileSizeMax) { alert(Joomla.JText._('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG'), true); return; } data.append('install_package', file); data.append('installtype', 'upload'); dragZone.attr('data-state', 'uploading'); uploading = true; $.ajax({ url: url, data: data, type: 'post', processData: false, cache: false, contentType: false, xhr: function () { var xhr = new window.XMLHttpRequest(); progressBar.css('width', 0); progressBar.attr('aria-valuenow', 0); percentage.text(0); // Upload progress xhr.upload.addEventListener("progress", function (evt) { if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; var number = Math.round(percentComplete * 100); progressBar.css('width', number + '%'); progressBar.attr('aria-valuenow', number); percentage.text(number); if (number === 100) { dragZone.attr('data-state', 'installing'); } } }, false); return xhr; } }) .done(function (res) { // Handle extension fatal error if (!res || (!res.success && !res.data)) { showError(res); return; } // Always redirect that can show message queue from session if (res.data.redirect) { location.href = res.data.redirect; } else { location.href = 'index.php?option=com_installer&view=install'; } }).error(function (error) { uploading = false; if (error.status === 200) { var res = error.responseText || error.responseJSON; showError(res); } else { showError(error.statusText); } }); function showError(res) { dragZone.attr('data-state', 'pending'); var message = Joomla.JText._('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_ERROR_UNKNOWN'); if (res == null) { message = Joomla.JText._('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_ERROR_EMPTY'); } else if (typeof res === 'string') { // Let's remove unnecessary HTML message = res.replace(/(<([^>]+)>|\s+)/g, ' '); } else if (res.message) { message = res.message; } Joomla.renderMessages({error: [message]}); } }); }); JS ); JFactory::getDocument()->addStyleDeclaration( <<

0%

folderinstaller/tmpl/default.php000060400000002665152455303030013053 0ustar00 * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); $app = JFactory::getApplication('administrator'); JFactory::getDocument()->addScriptDeclaration(' Joomla.submitbuttonfolder = function() { var form = document.getElementById("adminForm"); // do field validation if (form.install_directory.value == "") { alert("' . JText::_('PLG_INSTALLER_FOLDERINSTALLER_NO_INSTALL_PATH', true) . '"); } else { JoomlaInstaller.showLoading(); form.installtype.value = "folder" form.submit(); } }; '); ?>
folderinstaller/folderinstaller.php000060400000001742152455303030013637 0ustar00 * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * FolderInstaller Plugin. * * @since 3.6.0 */ class PlgInstallerFolderInstaller extends JPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.6.0 */ protected $autoloadLanguage = true; /** * Textfield or Form of the Plugin. * * @return array Returns an array with the tab information * * @since 3.6.0 */ public function onInstallerAddInstallationTab() { $tab = array(); $tab['name'] = 'folder'; $tab['label'] = JText::_('PLG_INSTALLER_FOLDERINSTALLER_TEXT'); // Render the input ob_start(); include JPluginHelper::getLayoutPath('installer', 'folderinstaller'); $tab['content'] = ob_get_clean(); return $tab; } } folderinstaller/folderinstaller.xml000060400000001476152455303030013654 0ustar00 PLG_INSTALLER_FOLDERINSTALLER Joomla! Project May 2016 (C) 2016 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.6.0 PLG_INSTALLER_FOLDERINSTALLER_PLUGIN_XML_DESCRIPTION folderinstaller.php en-GB.plg_installer_folderinstaller.ini en-GB.plg_installer_folderinstaller.sys.ini