/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($id, $option, $client = 0) { global $mosConfig_absolute_path; josSpoofCheck(null, null, 'request'); $id = str_replace(array('\\', '/'), '', $id); $basepath = $mosConfig_absolute_path . '/language/'; $xmlfile = $basepath . $id . '.xml'; // see if there is an xml install file, must be same name as element if (file_exists($xmlfile)) { $this->i_xmldoc = new DOMIT_Lite_Document(); $this->i_xmldoc->resolveErrors(true); if ($this->i_xmldoc->loadXML($xmlfile, false, true)) { $mosinstall =& $this->i_xmldoc->documentElement; // get the files element $files_element =& $mosinstall->getElementsByPath('files', 1); if (!is_null($files_element)) { $files = $files_element->childNodes; foreach ($files as $file) { // delete the files $filename = $file->getText(); echo $filename; if (file_exists($basepath . $filename)) { echo '<br />Deletando: ' . $basepath . $filename; $result = unlink($basepath . $filename); } echo intval($result); } } } } else { HTML_installer::showInstallMessage('ID do idioma vazio, não é possível remover arquivos', 'Desistalação - erro', $this->returnTo($option, 'language', $client)); exit; } // remove XML file from front @unlink($xmlfile); return true; }
/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($id, $option, $client = 0) { global $mosConfig_absolute_path, $adminLanguage; $id = str_replace(array('\\', '/'), '', $id); $basepath = $mosConfig_absolute_path . '/language/'; $xmlfile = $basepath . $id . '.xml'; // see if there is an xml install file, must be same name as element if (file_exists($xmlfile)) { $this->i_xmldoc =& new DOMIT_Lite_Document(); $this->i_xmldoc->resolveErrors(true); if ($this->i_xmldoc->loadXML($xmlfile, false, true)) { $mosinstall =& $this->i_xmldoc->documentElement; // get the files element $files_element =& $mosinstall->getElementsByPath('files', 1); if (!is_null($files_element)) { $files = $files_element->childNodes; foreach ($files as $file) { // delete the files $filename = $file->getText(); echo $filename; if (file_exists($basepath . $filename)) { echo '<br />' . $adminLanguage->A_INSTALL_LANG_DELETING . ': ' . $basepath . $filename; $result = unlink($basepath . $filename); } echo intval($result); } } } } else { HTML_installer::showInstallMessage($adminLanguage->A_INSTALL_LANG_NOREMOVE, $adminLanguage->A_INSTALL_LANG_UN_ERR, $this->returnTo($option, 'language', $client)); exit; } // remove XML file from front @unlink($xmlfile); return true; }
/** * @version $Id: template.php 10002 2008-02-08 10:56:57Z willebil $ * @package Joomla * @subpackage Installer * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } $client = mosGetParam($_REQUEST, 'client', ''); $userfile = mosGetParam($_REQUEST, 'userfile', dirname(__FILE__)); $userfile = mosPathName($userfile); HTML_installer::showInstallForm('Instalar novo Tema <small><small>[ ' . ($client == 'admin' ? 'Administração' : 'Site') . ' ]</small></small>', $option, 'template', $client, $userfile, '<a href="index2.php?option=com_templates&client=' . $client . '">Voltar ao administrador de temas</a>'); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/templates'); writableCell('templates'); writableCell('images/stories'); ?> </table>
* @version $Id: component.php,v 1.1 2004/10/13 07:53:02 dappa Exp $ * @package Mambo_4.5.1 * @copyright (C) 2000 - 2004 Miro International Pty Ltd * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * Mambo is Free Software * @subpackage Installer */ /** ensure this file is being included by a parent file */ defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'component'); showInstalledComponents($option); HTML_installer::showInstallForm($adminLanguage->A_INSTALL_COMP_UPL_NEW, $option, 'component', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/components'); writableCell('components'); writableCell('images/stories'); ?> </table> <?php /** * @param string The URL option */ function showInstalledComponents($option) {
* See COPYRIGHT.php for copyright notices and details. * @license GNU/GPL Version 2, see LICENSE.php * Mambo is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 of the License. */ /** ensure this file is being included by a parent file */ defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); // ensure user has access to this function //if ( !$acl->acl_check( 'administration', 'install', 'users', $my->usertype, $element . 's', 'all' ) ) { // mosRedirect( 'index2.php', T_('You are not authorized to view this resource.') ); //} require_once $mainframe->getPath('installer_html', 'component'); $suppress_install = false; if (!$suppress_install) { HTML_installer::showInstallForm(T_('Install Mambo plugin (component, module, mambot, template, include, parameter, composite)'), $option, 'universal', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('administrator/components'); writableCell('administrator/modules'); writableCell('administrator/templates'); writableCell('components'); writableCell('mambots'); writableCell('mambots/content'); writableCell('mambots/editors'); writableCell('mambots/editors-xtd'); writableCell('mambots/search'); writableCell('media'); writableCell('modules'); writableCell('templates');
<?php /** * @package Mambo * @subpackage Installer * @author Mambo Foundation Inc see README.php * @copyright Mambo Foundation Inc. * See COPYRIGHT.php for copyright notices and details. * @license GNU/GPL Version 2, see LICENSE.php * Mambo is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 of the License. */ /** ensure this file is being included by a parent file */ defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', T_('You are not authorized to view this resource.')); } $backlink = '<a href="index2.php?option=com_languages">' . T_('Back to Language Manager') . '</a>'; HTML_installer::showInstallForm(T_('Install new Language - Site'), $option, 'language', '', dirname(__FILE__), $backlink); ?> <table class="content"> <?php writableCell('media'); writableCell('language'); ?> </table>
/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($id, $option, $client = 0) { global $database, $mosConfig_absolute_path; josSpoofCheck(null, null, 'request'); $id = intval($id); $query = "SELECT name, folder, element, iscore" . "\n FROM #__mambots" . "\n WHERE id = " . (int) $id; $database->setQuery($query); $row = null; $database->loadObject($row); if ($database->getErrorNum()) { HTML_installer::showInstallMessage($database->stderr(), 'Uninstall - error', $this->returnTo($option, 'mambot', $client)); exit; } if ($row == null) { HTML_installer::showInstallMessage('Invalid object id', 'Uninstall - error', $this->returnTo($option, 'mambot', $client)); exit; } if (trim($row->folder) == '') { HTML_installer::showInstallMessage('Campo de Diretório vazio, Não foi possível remover arquivos', 'Desinstalar - erro', $this->returnTo($option, 'mambot', $client)); exit; } $basepath = $mosConfig_absolute_path . '/mambots/' . $row->folder . '/'; $xmlfile = $basepath . $row->element . '.xml'; // see if there is an xml install file, must be same name as element if (file_exists($xmlfile)) { $this->i_xmldoc = new DOMIT_Lite_Document(); $this->i_xmldoc->resolveErrors(true); if ($this->i_xmldoc->loadXML($xmlfile, false, true)) { $mosinstall =& $this->i_xmldoc->documentElement; // get the files element $files_element =& $mosinstall->getElementsByPath('files', 1); if (!is_null($files_element)) { $files = $files_element->childNodes; foreach ($files as $file) { // delete the files $filename = $file->getText(); if (file_exists($basepath . $filename)) { $parts = pathinfo($filename); $subpath = $parts['dirname']; if ($subpath != '' && $subpath != '.' && $subpath != '..') { echo '<br />Deleting: ' . $basepath . $subpath; $result = deldir(mosPathName($basepath . $subpath . '/')); } else { echo '<br />Deleting: ' . $basepath . $filename; $result = unlink(mosPathName($basepath . $filename, false)); } echo intval($result); } } // remove XML file from front echo "Deleting XML File: {$xmlfile}"; @unlink(mosPathName($xmlfile, false)); // define folders that should not be removed $sysFolders = array('content', 'search'); if (!in_array($row->folder, $sysFolders)) { // delete the non-system folders if empty if (count(mosReadDirectory($basepath)) < 1) { deldir($basepath); } } } } } if ($row->iscore) { HTML_installer::showInstallMessage($row->name . ' é um elemento do sistema e não pode ser desinstalado.<br />Será necessário despublicá-lo caso não pretenda continuar a utilizá-lo', 'Uninstall - error', $this->returnTo($option, 'mambot', $client)); exit; } $query = "DELETE FROM #__mambots" . "\n WHERE id = " . (int) $id; $database->setQuery($query); if (!$database->query()) { $msg = $database->stderr; die($msg); } return true; }
/** * Language uninstall method * @param int The id of the module * @param string The URL option * @param int The client id */ function language_uninstall($id, $option, $client = 0) { $id = str_replace(array('\\', '/'), '', $id); $basepath = mamboCore::get('mosConfig_absolute_path') . '/language/'; $xmlfile = $basepath . $id . '.xml'; // see if there is an xml install file, must be same name as element if (file_exists($xmlfile)) { $parser =& new mosUninstallXML($xmlfile); $parser->uninstall(); $ret = $parser->errors->getMaxLevel() < _MOS_ERROR_FATAL; HTML_installer::showInstallMessage($parser->errors->getErrors(), T_('Uninstall language - ') . ($ret ? T_('Success') : T_('Error')), returnTo($option, 'language', $client)); } else { $message = new mosError(T_('Language id empty, cannot remove files'), _MOS_ERROR_FATAL); HTML_installer::showInstallMessage($message, T_('Uninstall - error'), "index2.php?option=com_languages"); } exit; }
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'module'); HTML_installer::showInstallForm('Instalar novos Módulos', $option, 'module', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/modules'); writableCell('modules'); ?> </table> <?php showInstalledModules($option); /** * @param string The URL option */ function showInstalledModules($_option) {
/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($id, $option, $client = 0) { global $database, $mosConfig_absolute_path; $id = intval($id); $database->setQuery("SELECT name, folder, element, iscore FROM #__mambots WHERE id = '{$id}'"); $row = null; $database->loadObject($row); if ($database->getErrorNum()) { HTML_installer::showInstallMessage($database->stderr(), 'Uninstall - error', $installer->returnTo($option, 'mambot', $client)); exit; } if (trim($row->folder) == '') { HTML_installer::showInstallMessage('Folder field empty, cannot remove files', 'Uninstall - error', $installer->returnTo($option, 'mambot', $client)); exit; } $basepath = $mosConfig_absolute_path . '/mambots/' . $row->folder . '/'; $xmlfile = $basepath . $row->element . '.xml'; // see if there is an xml install file, must be same name as element if (file_exists($xmlfile)) { $this->i_xmldoc =& new DOMIT_Lite_Document(); $this->i_xmldoc->resolveErrors(true); if ($this->i_xmldoc->loadXML($xmlfile, false, true)) { $mosinstall =& $this->i_xmldoc->documentElement; // get the files element $files_element =& $mosinstall->getElementsByPath('files', 1); if (!is_null($files_element)) { $files = $files_element->childNodes; foreach ($files as $file) { // delete the files $filename = $file->getText(); if (file_exists($basepath . $filename)) { $parts = pathinfo($filename); $subpath = $parts['dirname']; if ($subpath != '' && $subpath != '.' && $subpath != '..') { echo '<br />Deleting: ' . $basepath . $subpath; $result = deldir(mosPathName($basepath . $subpath . '/')); } else { echo '<br />Deleting: ' . $basepath . $filename; $result = unlink(mosPathName($basepath . $filename, false)); } echo intval($result); } } // remove XML file from front echo "Deleting XML File: {$xmlfile}"; @unlink(mosPathName($xmlfile, false)); // define folders that should not be removed $sysFolders = array('content', 'search'); if (!in_array($row->folder, $sysFolders)) { // delete the non-system folders if empty if (count(mosReadDirectory($basepath)) < 1) { deldir($basepath); } } } } } if ($row->iscore) { HTML_installer::showInstallMessage($row->name . ' is a core element, and cannot be uninstalled.<br />You need to unpublish it if you don\'t want to use it', 'Uninstall - error', $this->returnTo($option, 'mambot', $client)); exit; } $database->setQuery("DELETE FROM #__mambots WHERE id = '{$id}'"); if (!$database->query()) { $msg = $database->stderr; die($msg); } return true; }
* @version $Id: module.php,v 1.1 2004/10/13 08:13:39 dappa Exp $ * @package Mambo_4.5.1 * @copyright (C) 2000 - 2004 Miro International Pty Ltd * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * Mambo is Free Software * @subpackage Installer */ /** ensure this file is being included by a parent file */ defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'module'); showInstalledModules($option); HTML_installer::showInstallForm($adminLanguage->A_INSTALL_MOD_INSTALL_MOD, $option, 'module', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/modules'); writableCell('modules'); ?> </table> <?php /** * @param string The URL option */ function showInstalledModules($_option)
/** * Install a template from a directory * @param string The URL option */ function installFromDirectory($installerClass, $option, $element, $client) { global $adminLanguage; $userfile = mosGetParam($_REQUEST, 'userfile', ''); if (!$userfile) { mosRedirect("index2.php?option={$option}&element=module", $adminLanguage->A_INSTALL_SELECT_DIR); } $installer = new $installerClass(); $path = mosPathName($userfile); if (!is_dir($path)) { $path = dirname($path); } $ret = $installer->install($path); HTML_installer::showInstallMessage($installer->getError(), $adminLanguage->A_INSTALL_UPLOAD_NEW . $element . ' - ' . ($ret ? $adminLanguage->A_INSTALL_SUCCESS : $adminLanguage->A_INSTALL_ERROR), $installer->returnTo($option, $element, $client)); }
<?php /** * @version $Id: language.php 10002 2008-02-08 10:56:57Z willebil $ * @package Joomla * @subpackage Installer * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } $backlink = '<a href="index2.php?option=com_languages">Voltar ao administrador de idiomas</a>'; HTML_installer::showInstallForm('Instale novo Idioma - Site', $option, 'language', '', dirname(__FILE__), $backlink); ?> <table class="content"> <?php writableCell('media'); writableCell('language'); ?> </table>
/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($id, $option, $client = 0) { global $database, $mosConfig_absolute_path; josSpoofCheck(null, null, 'request'); // Delete directories $path = $mosConfig_absolute_path . ($client == 'admin' ? '/administrator' : '') . '/templates/' . $id; $id = str_replace('..', '', $id); if (trim($id)) { if (is_dir($path)) { return deldir(mosPathName($path)); } else { HTML_installer::showInstallMessage('Directory does not exist, cannot remove files', 'Uninstall - error', $this->returnTo($option, 'template', $client)); } } else { HTML_installer::showInstallMessage('Template id is empty, cannot remove files', 'Uninstall - error', $this->returnTo($option, 'template', $client)); exit; } }
/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($id, $option, $client = 0) { global $database, $mosConfig_absolute_path; $id = intval($id); $database->setQuery("SELECT module, iscore, client_id FROM #__modules WHERE id = '{$id}'"); $row = null; $database->loadObject($row); if ($row->iscore) { HTML_installer::showInstallMessage($row->title . 'is a core module, and can not be uninstalled.<br />You need to unpublish it if you don\'t want to use it', 'Uninstall - error', $this->returnTo($option, 'module', $row->client_id ? '' : 'admin')); exit; } $database->setQuery("SELECT id FROM #__modules WHERE module = '{$row->module}'"); $modules = $database->loadResultArray(); if (count($modules)) { $database->setQuery("DELETE FROM #__modules_menu" . "\nWHERE moduleid IN ('" . implode("','", $modules) . "')"); if (!$database->query()) { $msg = $database->stderr; die($msg); } } $database->setQuery("DELETE FROM #__modules WHERE module = '{$row->module}'"); if (!$database->query()) { $msg = $database->stderr; die($msg); } $basepath = $mosConfig_absolute_path . '/modules/'; $xmlfile = $basepath . $row->module . '.xml'; // see if there is an xml install file, must be same name as element if (file_exists($xmlfile)) { $this->i_xmldoc =& new DOMIT_Lite_Document(); $this->i_xmldoc->resolveErrors(true); if ($this->i_xmldoc->loadXML($xmlfile, false, true)) { $mosinstall =& $this->i_xmldoc->documentElement; // get the files element $files_element =& $mosinstall->getElementsByPath('files', 1); if (!is_null($files_element)) { $files = $files_element->childNodes; foreach ($files as $file) { // delete the files $filename = $file->getText(); if (file_exists($basepath . $filename)) { $parts = pathinfo($filename); $subpath = $parts['dirname']; if ($subpath != '' && $subpath != '.' && $subpath != '..') { echo '<br />Deleting: ' . $basepath . $subpath; $result = deldir(mosPathName($basepath . $subpath . '/')); } else { echo '<br />Deleting: ' . $basepath . $filename; $result = unlink(mosPathName($basepath . $filename, false)); } echo intval($result); } } // remove XML file from front echo "Deleting XML File: {$xmlfile}"; @unlink(mosPathName($xmlfile, false)); return true; } } } }
/** * @version $Id$ * @package Joomla * @subpackage Installer * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } $client = mosGetParam($_REQUEST, 'client', ''); $userfile = mosGetParam($_REQUEST, 'userfile', dirname(__FILE__)); $userfile = mosPathName($userfile); HTML_installer::showInstallForm('Install new Template <small><small>[ ' . ($client == 'admin' ? 'Administrator' : 'Site') . ' ]</small></small>', $option, 'template', $client, $userfile, '<a href="index2.php?option=com_templates&client=' . $client . '">Back to Templates</a>'); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/templates'); writableCell('templates'); writableCell('images/stories'); ?> </table>
* @version $Id: mambot.php,v 1.1 2004/10/13 08:06:16 dappa Exp $ * @package Mambo_4.5.1 * @copyright (C) 2000 - 2004 Miro International Pty Ltd * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * Mambo is Free Software * @subpackage Installer */ /** ensure this file is being included by a parent file */ defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'mambot'); showInstalledMambots($option); HTML_installer::showInstallForm($adminLanguage->A_INSTALL_MAMB_INSTALL_MAMBOT, $option, 'mambot', '', dirname(__FILE__)); ?> <br /><br /> <table class="content"> <?php writableCell('media'); writableCell('language'); writableCell('mambots'); writableCell('mambots/content'); writableCell('mambots/search'); ?> </table> <?php function showInstalledMambots($_option) {
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'component'); HTML_installer::showInstallForm('Enviar novo componente ', $option, 'component', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/components'); writableCell('components'); writableCell('images/stories'); ?> </table> <?php showInstalledComponents($option); /** * @param string The URL option */ function showInstalledComponents($option)
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'component'); HTML_installer::showInstallForm('Install new Component', $option, 'component', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/components'); writableCell('components'); writableCell('images/stories'); ?> </table> <?php showInstalledComponents($option); /** * @param string The URL option */ function showInstalledComponents($option)
<?php /** * @version $Id: language.php,v 1.1 2004/10/13 08:00:33 dappa Exp $ * @package Mambo_4.5.1 * @copyright (C) 2000 - 2004 Miro International Pty Ltd * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * Mambo is Free Software * @subpackage Installer */ /** ensure this file is being included by a parent file */ defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } $backlink = '<a href="index2.php?option=com_languages">' . $adminLanguage->A_INSTALL_BACK_LANG_MGR . '</a>'; HTML_installer::showInstallForm($adminLanguage->A_INSTALL_LANG, $option, 'language', '', dirname(__FILE__), $backlink); ?> <table class="content"> <?php writableCell('media'); writableCell('language'); ?> </table>
/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($id, $option, $client = 0) { global $database, $mosConfig_absolute_path; josSpoofCheck(); $id = intval($id); $query = "SELECT module, iscore, client_id" . "\n FROM #__modules WHERE id = " . (int) $id; $database->setQuery($query); $row = null; $database->loadObject($row); if ($row->iscore) { HTML_installer::showInstallMessage($row->title . 'é um elemento do sistema e não pode ser desinstalado.<br />Caso não o pretenda continuar a utilizar será necessário retirar de publicação', 'Desinstalar - erro', $this->returnTo($option, 'module', $row->client_id ? '' : 'admin')); exit; } $query = "SELECT id" . "\n FROM #__modules" . "\n WHERE module = " . $database->Quote($row->module) . " AND client_id = " . (int) $row->client_id; $database->setQuery($query); $modules = $database->loadResultArray(); if (count($modules)) { mosArrayToInts($modules); $modID = 'moduleid=' . implode(' OR moduleid=', $modules); $query = "DELETE FROM #__modules_menu" . "\n WHERE ( {$modID} )"; $database->setQuery($query); if (!$database->query()) { $msg = $database->stderr; die($msg); } $query = "DELETE FROM #__modules" . "\n WHERE module = " . $database->Quote($row->module) . " AND client_id = " . (int) $row->client_id; $database->setQuery($query); if (!$database->query()) { $msg = $database->stderr; die($msg); } if (!$row->client_id) { $basepath = $mosConfig_absolute_path . '/modules/'; } else { $basepath = $mosConfig_absolute_path . '/administrator/modules/'; } $xmlfile = $basepath . $row->module . '.xml'; // see if there is an xml install file, must be same name as element if (file_exists($xmlfile)) { $this->i_xmldoc = new DOMIT_Lite_Document(); $this->i_xmldoc->resolveErrors(true); if ($this->i_xmldoc->loadXML($xmlfile, false, true)) { $mosinstall =& $this->i_xmldoc->documentElement; // get the files element $files_element =& $mosinstall->getElementsByPath('files', 1); if (!is_null($files_element)) { $files = $files_element->childNodes; foreach ($files as $file) { // delete the files $filename = $file->getText(); if (file_exists($basepath . $filename)) { $parts = pathinfo($filename); $subpath = $parts['dirname']; if ($subpath != '' && $subpath != '.' && $subpath != '..') { echo '<br />Deletado: ' . $basepath . $subpath; $result = deldir(mosPathName($basepath . $subpath . '/')); } else { echo '<br />Deletado: ' . $basepath . $filename; $result = unlink(mosPathName($basepath . $filename, false)); } echo intval($result); } } // remove XML file from front echo "Deletando arquivo XML: {$xmlfile}"; @unlink(mosPathName($xmlfile, false)); return true; } } } } }
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. * */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'mambot'); HTML_installer::showInstallForm('Install new Mambots', $option, 'mambot', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('media'); writableCell('language'); writableCell('mambots'); writableCell('mambots/content'); writableCell('mambots/search'); writableCell('mambots/system'); ?> </table> <?php showInstalledMambots($option); function showInstalledMambots($_option) {
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. * */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'mambot'); HTML_installer::showInstallForm('Instalar novos plugins', $option, 'mambot', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('media'); writableCell('language'); writableCell('mambots'); writableCell('mambots/content'); writableCell('mambots/search'); writableCell('mambots/system'); ?> </table> <?php showInstalledMambots($option); function showInstalledMambots($_option) {
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_VALID_MOS') or die('Restricted access'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('installer_html', 'module'); HTML_installer::showInstallForm('Install new Modules', $option, 'module', '', dirname(__FILE__)); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/modules'); writableCell('modules'); ?> </table> <?php showInstalledModules($option); /** * @param string The URL option */ function showInstalledModules($_option) {
/** * Install a template from a directory * @param string The URL option */ function installFromDirectory($installerClass, $option, $element, $client) { josSpoofCheck(); $userfile = mosGetParam($_REQUEST, 'userfile', ''); if (!$userfile) { mosRedirect("index2.php?option={$option}&element=module", "Por favor, selecione um diretório"); } $installer = new $installerClass(); $path = mosPathName($userfile); if (!is_dir($path)) { $path = dirname($path); } $ret = $installer->install($path); HTML_installer::showInstallMessage($installer->getError(), 'Novo envio ' . $element . ' - ' . ($ret ? 'Sucesso' : 'Erro'), $installer->returnTo($option, $element, $client)); }
/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($cid, $option, $client = 0) { global $database, $mosConfig_absolute_path; $uninstallret = ""; $sql = "SELECT * FROM #__components WHERE id={$cid}"; $database->setQuery($sql); $row = null; if (!$database->loadObject($row)) { HTML_installer::showInstallMessage($database->stderr(true), 'Uninstall - error', $this->returnTo($option, 'component', $client)); exit; } if ($row->iscore) { HTML_installer::showInstallMessage("Component {$row->name} is a core component, and can not be uninstalled.<br />You need to unpublish it if you don't want to use it", 'Uninstall - error', $this->returnTo($option, 'component', $client)); exit; } // Delete entries in the DB $sql = "DELETE FROM #__components WHERE parent={$row->id}"; $database->setQuery($sql); if (!$database->query()) { HTML_installer::showInstallMessage($database->stderr(true), 'Uninstall - error', $this->returnTo($option, 'component', $client)); exit; } $sql = "DELETE FROM #__components WHERE id={$row->id}"; $database->setQuery($sql); if (!$database->query()) { HTML_installer::showInstallMessage($database->stderr(true), 'Uninstall - error', $this->returnTo($option, 'component', $client)); exit; } // Try to find the uninstall file $filesindir = mosReadDirectory($mosConfig_absolute_path . '/administrator/components/' . $row->option, 'uninstall'); if (count($filesindir) > 0) { $uninstall_file = $filesindir[0]; if (file_exists($mosConfig_absolute_path . '/administrator/components/' . $row->option . '/' . $uninstall_file)) { require_once $mosConfig_absolute_path . '/administrator/components/' . $row->option . '/' . $uninstall_file; $uninstallret = com_uninstall(); } } // Try to find the XML file $filesindir = mosReadDirectory(mosPathName($mosConfig_absolute_path . '/administrator/components/' . $row->option), '.xml$'); if (count($filesindir) > 0) { $ismosinstall = false; foreach ($filesindir as $file) { $xmlDoc =& new DOMIT_Lite_Document(); $xmlDoc->resolveErrors(true); if (!$xmlDoc->loadXML($mosConfig_absolute_path . "/administrator/components/" . $row->option . "/" . $file, false, true)) { return false; } $element =& $xmlDoc->documentElement; if ($element->getTagName() != 'mosinstall') { HTML_installer::showInstallMessage('XML File invalid', 'Uninstall - error', $this->returnTo($option, 'component', $client)); exit; } $query_element =& $xmlDoc->getElementsbyPath('uninstall/queries', 1); if (!is_null($query_element)) { $queries = $query_element->childNodes; foreach ($queries as $query) { $database->setQuery($query->getText()); if (!$database->query()) { HTML_installer::showInstallMessage($database->stderr(true), 'Uninstall - error', $this->returnTo($option, 'component', $client)); exit; } } } } } else { /* HTML_installer::showInstallMessage( 'Could not find XML Setup file in '.$mosConfig_absolute_path.'/administrator/components/'.$row->option, 'Uninstall - error', $option, 'component' ); exit(); */ } // Delete directories if (trim($row->option)) { $result = 0; $path = mosPathName($mosConfig_absolute_path . '/administrator/components/' . $row->option); if (is_dir($path)) { $result |= deldir($path); } $path = mosPathName($mosConfig_absolute_path . '/components/' . $row->option); if (is_dir($path)) { $result |= deldir($path); } return $result; } else { HTML_installer::showInstallMessage('Option field empty, cannot remove files', 'Uninstall - error', $option, 'component'); exit; } return $uninstallret; }
/** * Custom install method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall($id, $option, $client = 0) { global $database, $mosConfig_absolute_path; josSpoofCheck(null, null, 'request'); // Delete directories $path = $mosConfig_absolute_path . ($client == 'admin' ? '/administrator' : '') . '/templates/' . $id; $id = str_replace('..', '', $id); if (trim($id)) { if (is_dir($path)) { return deldir(mosPathName($path)); } else { HTML_installer::showInstallMessage('O diretório não existe, não é possível remover arquivos', 'Desinstalar - erro', $this->returnTo($option, 'template', $client)); } } else { HTML_installer::showInstallMessage('ID de Tema está vazio, não é possível remover arquivos', 'Desinstalar - erro', $this->returnTo($option, 'template', $client)); exit; } }
<?php /** * @version $Id: template.php,v 1.1 2004/10/13 08:16:15 dappa Exp $ * @package Mambo_4.5.1 * @copyright (C) 2000 - 2004 Miro International Pty Ltd * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * Mambo is Free Software * @subpackage Installer */ /** ensure this file is being included by a parent file */ defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); // ensure user has access to this function if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) { mosRedirect('index2.php', _NOT_AUTH); } $client = mosGetParam($_REQUEST, 'client', ''); $userfile = mosGetParam($_REQUEST, 'userfile', dirname(__FILE__)); $userfile = mosPathName($userfile); HTML_installer::showInstallForm($adminLanguage->A_INSTALL_TEMPL_INSTALL . ($client == 'admin' ? $adminLanguage->A_INSTALL_TEMPL_ADMIN_TEMPL : $adminLanguage->A_INSTALL_TEMPL_SITE_TEMPL), $option, 'template', $client, $userfile, '<a href="index2.php?option=com_templates&client=' . $client . '">' . $adminLanguage->A_INSTALL_TEMPL_BACKTTO_TEMPL . '</a>'); ?> <table class="content"> <?php writableCell('media'); writableCell('administrator/templates'); writableCell('templates'); writableCell('images/stories'); ?> </table>
function theSourceForm($option, $element, $client) { HTML_installer::showUrlForm('', $option, $element, $client); echo '<object type="text/html" data="http://source.mambo-foundation.org/component/syndstyle/option,com_remository/" width="500" height="1000">' . T_('Sorry, it seems that The Source is not available') . '</object>'; }