From: <ma...@us...> - 2012-05-12 17:27:00
|
Revision: 9490 http://xoops.svn.sourceforge.net/xoops/?rev=9490&view=rev Author: mageg Date: 2012-05-12 17:26:48 +0000 (Sat, 12 May 2012) Log Message: ----------- add maintenance plugin Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/dump.png XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/maintenance.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/menu.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/maintenance.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/maintenance.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/changelog.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/credits.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/install.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/lang_diff.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/licence.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/dump/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/dump/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/icons/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/icons/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/icons/logo_large.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/icons/logo_small.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/images/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/images/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/images/logo.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/english/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/english/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/english/help/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/english/help/help.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/english/help/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/english/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/english/modinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/language/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_center.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/admin/maintenance_dump.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/templates/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/xoops_version.php Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/dump.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/dump.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/maintenance.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/maintenance.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,28 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * maintenance plugins + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package maintenance + * @since 2.6.0 + * @author Mage Grégory (AKA Mage), Cointin Maxime (AKA Kraven30) + * @version $Id$ + */ + +include dirname(__FILE__) . '/header.php'; +$xoops->header(); +$aboutAdmin = new XoopsModuleAdmin(); +$aboutAdmin->renderNavigation('about.php'); +$aboutAdmin->renderabout('6KJ7RW5DR3VTJ', true); +$xoops->footer(); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/about.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,164 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * maintenance plugins + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package maintenance + * @since 2.6.0 + * @author Mage Grégory (AKA Mage), Cointin Maxime (AKA Kraven30) + * @version $Id$ + */ + +include dirname(__FILE__) . '/header.php'; +// Get main instance +$system = System::getInstance(); +// Check users rights +if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { + exit(_NOPERM); +} +$system = System::getInstance(); +// Get Action type +$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); + +// Call Header +$xoops->header('maintenance_center.html'); + +$admin_page = new XoopsModuleAdmin(); +$admin_page->renderNavigation('center.php'); + +switch ($op) { + + case 'list': + default: + // Define tips + $admin_page->addTips(_AM_MAINTENANCE_CENTER_TIPS); + $admin_page->renderTips(); + $form = $xoops->getModuleForm(null, 'maintenance'); + $form->getMaintenance(); + $form->render(); + break; + + case 'maintenance_save': + $admin_page->addItemButton(_AM_MAINTENANCE_CENTER_RETURN, 'center.php', 'application-view-detail'); + $admin_page->renderButton(); + + $session = $system->cleanVars($_REQUEST, 'session', 1, 'int'); + $cache = $system->cleanVars($_REQUEST, 'cache', array(), 'array'); + $tables = $system->cleanVars($_REQUEST, 'tables', array(), 'array'); + $tables_op = $system->cleanVars($_REQUEST, 'maintenance', array(), 'array'); + $db = XoopsDatabaseFactory::getDatabaseConnection(); + //Cache + if (!empty($cache)) { + for ($i = 0; $i < count($cache); $i++) { + switch ($cache[$i]) { + case 1: + $files = glob(XOOPS_VAR_PATH . '/caches/smarty_cache/*.*'); + $total_smarty_cache = 0; + foreach ($files as $filename) { + if (basename(strtolower($filename)) != 'index.html') { + unlink($filename); + $total_smarty_cache++; + } + } + $xoops->tpl->assign('smarty_cache', true); + $xoops->tpl->assign('result_smarty_cache', sprintf(_AM_MAINTENANCE_CENTER_RESULT_SMARTY_CACHE, $total_smarty_cache)); + break; + + case 2: + $files = glob(XOOPS_VAR_PATH . '/caches/smarty_compile/*.*'); + $total_smarty_compile = 0; + foreach ($files as $filename) { + if (basename(strtolower($filename)) != 'index.html') { + unlink($filename); + $total_smarty_compile++; + } + } + $xoops->tpl->assign('smarty_compile', true); + $xoops->tpl->assign('result_smarty_compile', sprintf(_AM_MAINTENANCE_CENTER_RESULT_SMARTY_COMPILE, $total_smarty_compile)); + break; + + case 3: + $files = glob(XOOPS_VAR_PATH . '/caches/xoops_cache/*.*'); + $total_xoops_cache = 0; + foreach ($files as $filename) { + if (basename(strtolower($filename)) != 'index.html') { + unlink($filename); + $total_xoops_cache++; + } + } + $xoops->tpl->assign('xoops_cache', true); + $xoops->tpl->assign('result_xoops_cache', sprintf(_AM_MAINTENANCE_CENTER_RESULT_XOOPS_CACHE, $total_xoops_cache)); + break; + } + } + } + //Session + if ($session == 1) { + $result = $db->queryF('TRUNCATE TABLE ' . $db->prefix('session')); + $result ? $result_session = true : $result_session = false; + $xoops->tpl->assign('result_session', $result_session); + $xoops->tpl->assign('session', true); + } + //Maintenance tables + if (!empty($tables) && !empty($tables_op)) { + $tab = array(); + for ($i = 0; $i < 4; $i++) { + $tab[$i] = $i + 1; + } + $tab1 = array(); + for ($i = 0; $i < 4; $i++) { + if (in_array($tab[$i], $tables_op)) { + $tab1[$i] = $tab[$i]; + } else { + $tab1[$i] = '0'; + } + } + unset($tab); + for ($i = 0; $i < count($tables); $i++) { + $result_arr['table'] = $db->prefix . $tables[$i]; + for ($j = 0; $j < 4; $j++) { + switch ($tab1[$j]) { + case 1: + //Optimize + $result = $db->queryF('OPTIMIZE TABLE ' . $db->prefix . $tables[$i]); + $result ? $result_arr['optimize'] = true : $result_arr['optimize'] = false; + break; + + case 2: + //Tables + $result = $db->queryF('CHECK TABLE ' . $db->prefix . $tables[$i]); + $result ? $result_arr['check'] = true : $result_arr['check'] = false; + break; + + case 3: + //Repair + $result = $db->queryF('REPAIR TABLE ' . $db->prefix . $tables[$i]); + $result ? $result_arr['repair'] = true : $result_arr['repair'] = false; + break; + + case 4: + //Analyze + $result = $db->queryF('ANALYZE TABLE ' . $db->prefix . $tables[$i]); + $result ? $result_arr['analyse'] = true : $result_arr['analyse'] = false; + break; + } + } + $xoops->tpl->append_by_ref('result_arr', $result_arr); + unset($result_arr); + } + $xoops->tpl->assign('maintenance', true); + } + break; +} +$xoops->footer(); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,162 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * maintenance plugins + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package maintenance + * @since 2.6.0 + * @author Mage Grégory (AKA Mage), Cointin Maxime (AKA Kraven30) + * @version $Id$ + */ + +include dirname(__FILE__) . '/header.php'; +// Get main instance +$system = System::getInstance(); +// Check users rights +if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) { + exit(_NOPERM); +} +$system = System::getInstance(); +// Get Action type +$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); + +// Call Header +$xoops->header('maintenance_dump.html'); + +$admin_page = new XoopsModuleAdmin(); +$admin_page->renderNavigation('dump.php'); + +switch ($op) { + + case 'list': + default: + $files = glob(XOOPS_ROOT_PATH . '/modules/maintenance/dump/*.*'); + $count = 0; + foreach ($files as $filename_path) { + $filename = basename(strtolower($filename_path)); + if ($filename != 'index.html') { + $file_arr[$count]['name'] = $filename; + $stat = stat($filename_path); + $file_arr[$count]['size'] = number_format($stat['size']/1024); + $count++; + unset($filename); + } + } + $xoops->tpl->assign('file_arr', array_reverse($file_arr)); + if ($count == 0 && $op == 'list') { + $form = $xoops->getModuleForm(null, 'maintenance'); + $form->getDump(); + $form->render(); + } else { + $admin_page->addItemButton(_AM_MAINTENANCE_DUMP_FORM, 'dump.php?op=dump', 'cd'); + $admin_page->renderButton(); + $xoops->tpl->assign('files', true); + } + break; + + case 'dump_save': + $admin_page->addItemButton(_AM_MAINTENANCE_DUMP_LIST, 'dump.php', 'application-view-detail'); + $admin_page->addItemButton(_AM_MAINTENANCE_DUMP_FORM, 'dump.php?op=dump', 'cd'); + $admin_page->renderButton(); + $dump_modules = isset($_REQUEST['dump_modules']) ? $_REQUEST['dump_modules'] : false; + $dump_tables = isset($_REQUEST['dump_tables']) ? $_REQUEST['dump_tables'] : false; + $drop = $system->cleanVars($_REQUEST, 'drop', 1, 'int'); + + if (($dump_tables == true && $dump_modules == true) || ($dump_tables == false && $dump_modules == false)) { + $xoops->redirect("dump.php", 2, _AM_MAINTENANCE_DUMP_ERROR_TABLES_OR_MODULES); + } + $db = XoopsDatabaseFactory::getDatabaseConnection(); + $dump = new Maintenance(); + $sql_text = "# \n"; + $sql_text .= "# Dump SQL, Generate by Xoops \n"; + $sql_text .= "# Date : " . date('d-m-Y / H:i') . " \n"; + $sql_text .= "# \n\n"; + if ($dump_tables != false) { + $result_module = array(); + for ($i = 0; $i < count($dump_tables); $i++) { + //structure + $result_tables[$i]['name'] = $db->prefix . '_' . $dump_tables[$i]; + $result_structure = $dump->dump_table_structure($db->prefix . '_' . $dump_tables[$i], $drop); + $sql_text .= $result_structure['sql_text']; + $result_tables[$i]['structure'] = $result_structure['structure']; + //data + $result_data = $dump->dump_table_datas($db->prefix . '_' . $dump_tables[$i]); + $sql_text .= $result_data['sql_text']; + $result_tables[$i]['records'] = $result_data['records']; + } + $xoops->tpl->assign('result_t', $result_tables); + } + if ($dump_modules != false) { + $result_module = array(); + for ($i = 0; $i < count($dump_modules); $i++) { + $module_handler = $xoops->getHandlerModule(); + $module = $module_handler->getByDirname($dump_modules[$i]); + $result_module[$i]['name'] = ucfirst($dump_modules[$i]); + $modtables = $module->getInfo('tables'); + if ($modtables != false && is_array($modtables)) { + $count = 0; + foreach ($modtables as $table) { + //structure + $result_tables[$count]['name'] = $db->prefix . '_' . $table; + $result_structure = $dump->dump_table_structure($db->prefix . '_' . $table, $drop); + $sql_text .= $result_structure['sql_text']; + $result_tables[$count]['structure'] = $result_structure['structure']; + + //data + $result_data = $dump->dump_table_datas($db->prefix . '_' . $table); + $sql_text .= $result_data['sql_text']; + $result_tables[$count]['records'] = $result_data['records']; + $count++; + } + $result_module[$i]['table'] = $result_tables; + } else { + $result_module[$i]['table'] = false; + } + unset($result_tables); + } + $xoops->tpl->assign('result_m', $result_module); + } + $xoops->tpl->assign('result_write', true); + $result_write = $dump->dump_write($sql_text); + $xoops->tpl->assign('write', $result_write['write']); + $xoops->tpl->assign('file_name', $result_write['file_name']); + break; + + case 'dump_delete': + $filename = $system->cleanVars($_REQUEST, 'filename', '', 'string'); + if ($filename == '') { + $xoops->redirect("dump.php", 2, _AM_MAINTENANCE_DUMP_NOFILE); + } + unlink(XOOPS_ROOT_PATH . '/modules/maintenance/dump/' . $filename); + $xoops->redirect("dump.php", 2, _AM_MAINTENANCE_DUMP_DELETED); + break; + + case 'dump_deleteall': + $files = glob(XOOPS_ROOT_PATH . '/modules/maintenance/dump/*.*'); + $count = 0; + foreach ($files as $filename_path) { + if (basename(strtolower($filename_path)) != 'index.html') { + unlink($filename_path); + } + } + $xoops->redirect("dump.php", 2, _AM_MAINTENANCE_DUMP_DELETEDALL); + break; + + case 'dump': + $form = $xoops->getModuleForm(null, 'maintenance'); + $form->getDump(); + $form->render(); + break; +} +$xoops->footer(); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/header.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/header.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/header.php 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,27 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * maintenance plugins + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package maintenance + * @since 2.6.0 + * @author Mage Grégory (AKA Mage), Cointin Maxime (AKA Kraven30) + * @version $Id$ + */ + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; +require_once dirname(dirname(__FILE__)) . '/class/maintenance.php'; + +$xoops = Xoops::getInstance(); +XoopsLoad::load('system', 'system'); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/header.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.html 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,46 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * maintenance plugins + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package maintenance + * @since 2.6.0 + * @author Mage Grégory (AKA Mage), Cointin Maxime (AKA Kraven30) + * @version $Id$ + */ + +include dirname(__FILE__) . '/header.php'; + +$xoops->header(); + +$admin_page = new XoopsModuleAdmin(); +$admin_page->renderNavigation('index.php'); + +// folder path +$folder_path = XOOPS_ROOT_PATH . '/modules/maintenance/dump'; + +// files +$files = glob(XOOPS_ROOT_PATH . '/modules/maintenance/dump/*.*'); +$count = 0; +foreach ($files as $filename_path) { + if (basename(strtolower($filename_path)) != 'index.html') { + $count++; + } +} +$admin_page->addConfigBoxLine($folder_path, 'folder'); +$admin_page->addConfigBoxLine(array($folder_path, '777'), 'chmod'); +$admin_page->addInfoBox(_MI_MAINTENANCE_DUMP); +$admin_page->addInfoBoxLine(sprintf(_AM_MAINTENANCE_NBFILES, $count)); +$admin_page->renderIndex(); +$xoops->footer(); \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/index.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/menu.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/menu.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/menu.php 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,39 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * maintenance plugins + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package maintenance + * @since 2.6.0 + * @author Mage Grégory (AKA Mage), Cointin Maxime (AKA Kraven30) + * @version $Id$ + */ + +$adminmenu = array(); +$i = 1; +$adminmenu[$i]['title'] = _MI_MAINTENANCE_INDEX; +$adminmenu[$i]['link'] = "admin/index.php"; +$adminmenu[$i]['icon'] = 'home.png'; +$i++; +$adminmenu[$i]['title'] = _MI_MAINTENANCE_CENTER; +$adminmenu[$i]['link'] = "admin/center.php"; +$adminmenu[$i]['icon'] = 'maintenance.png'; +$i++; +$adminmenu[$i]['title'] = _MI_MAINTENANCE_DUMP; +$adminmenu[$i]['link'] = "admin/dump.php"; +$adminmenu[$i]['icon'] = 'dump.png'; +$i++; +$adminmenu[$i]['title'] = _MI_SMILIES_ABOUT; +$adminmenu[$i]['link'] = 'admin/about.php'; +$adminmenu[$i]['icon'] = 'about.png'; \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/menu.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/index.html 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/maintenance.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/maintenance.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/maintenance.php 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,97 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * maintenance plugins + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package maintenance + * @since 2.6.0 + * @author Mage Gr\xE9gory (AKA Mage), Cointin Maxime (AKA Kraven30) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class MaintenanceMaintenanceForm extends XoopsThemeForm +{ + /** + * @param null $obj + */ + public function __construct($obj = null) + { + } + + /** + * Maintenance Form + * @return void + */ + public function getMaintenance() + { + $maintenance = new Maintenance(); + parent::__construct('', "form_maintenance", "center.php", 'post', true); + + $cache = new XoopsFormSelect(_AM_MAINTENANCE_CENTER_CACHE, "cache", '', 3, true); + $cache->setDescription(XOOPS_VAR_PATH . "/cache/smarty_cache/<br />" . XOOPS_VAR_PATH . "/cache/smarty_compile/<br />" . XOOPS_VAR_PATH . "/cache/xoops_cache/"); + $cache_arr = array(1 => _AM_MAINTENANCE_CENTER_SMARTY_CACHE, 2 => _AM_MAINTENANCE_CENTER_SMARTY_COMPILE, 3 => _AM_MAINTENANCE_CENTER_XOOPS_CACHE); + $cache->addOptionArray($cache_arr); + $this->addElement($cache); + + $this->addElement(new XoopsFormRadioYN(_AM_MAINTENANCE_CENTER_SESSION, 'session', '', _YES, _NO)); + + $tables_tray = new XoopsFormElementTray(_AM_MAINTENANCE_CENTER_TABLES, ' '); + $tables_tray->setDescription(_AM_MAINTENANCE_CENTER_TABLES_DESC); + $select_tables = new XoopsFormSelect('', "tables", '', 7, true); + $select_tables->addOptionArray($maintenance->displayTables(true)); + $tables_tray->addElement($select_tables, false); + $choice = new XoopsFormSelect(' ' . _AM_MAINTENANCE_AND . ' ', "maintenance", '', 4, true); + $options = array( + '1' => _AM_MAINTENANCE_CENTER_CHOICE1, '2' => _AM_MAINTENANCE_CENTER_CHOICE2, + '3' => _AM_MAINTENANCE_CENTER_CHOICE3, '4' => _AM_MAINTENANCE_CENTER_CHOICE4 + ); + $choice->addOptionArray($options); + $tables_tray->addElement($choice, false); + $this->addElement($tables_tray); + + $this->addElement(new XoopsFormHidden("op", "maintenance_save")); + $this->addElement(new XoopsFormButton("", "maintenance_save", _SEND, "submit")); + } + + /** + * @return void + */ + public function getDump() + { + $xoops = Xoops::getInstance(); + $maintenance = new Maintenance(); + parent::__construct('', "form_dump", "dump.php", 'post', true); + + $dump_tray = new XoopsFormElementTray(_AM_MAINTENANCE_DUMP_TABLES_OR_MODULES, ''); + $select_tables1 = new XoopsFormSelect('', "dump_tables", '', 7, true); + $select_tables1->addOptionArray($maintenance->displayTables(true)); + $dump_tray->addElement($select_tables1, false); + $ele = new XoopsFormSelect(' ' . _AM_MAINTENANCE_OR . ' ', 'dump_modules', '', 7, true); + /* @var $module_handler XoopsModuleHandler */ + $module_handler = $xoops->getHandlerModule(); + $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); + $criteria->add(new Criteria('isactive', 1)); + $moduleslist = $module_handler->getNameList($criteria, true); + $ele->addOptionArray($moduleslist); + $dump_tray->addElement($ele); + $this->addElement($dump_tray); + + $this->addElement(new XoopsFormRadioYN(_AM_MAINTENANCE_DUMP_DROP, 'drop', 1, _YES, _NO)); + + $this->addElement(new XoopsFormHidden("op", "dump_save")); + $this->addElement(new XoopsFormButton("", "dump_save", _SEND, "submit")); + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/form/maintenance.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/index.html 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/maintenance.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/maintenance.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/maintenance.php 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,178 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * maintenance plugins + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package maintenance + * @since 2.6.0 + * @author Mage Grégory (AKA Mage), Cointin Maxime (AKA Kraven30) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * System Maintenance + * + * @copyright copyright (c) 2000 XOOPS.org + * @package system + */ +class Maintenance +{ + var $db; + var $prefix; + + /** + * Constructor + */ + function Maintenance() + { + $db = XoopsDatabaseFactory::getDatabaseConnection(); + $this->db = $db; + $this->prefix = $this->db->prefix . '_'; + } + + /** + * Display Tables + * + * @param array + * @return + */ + function displayTables($array = true) + { + $tables = array(); + $result = $this->db->queryF('SHOW TABLES'); + while ($myrow = $this->db->fetchArray($result)) { + $value = array_values($myrow); + $value = substr($value[0], 5); + $tables[$value] = $value; + } + if ($array = true) { + return $tables; + } else { + return join(',', $tables); + } + } + + /** + * Dump table structure + * + * @param string table + * @param int drop + * @return array 'ret[sql_text] = dump, ret[structure] = display structure + */ + function dump_table_structure($table, $drop) + { + $sql_text = ''; + $verif = false; + $result = $this->db->queryF('SHOW create table `' . $table . '`;'); + if ($result) { + if ($row = $this->db->fetchArray($result)) { + $sql_text .= "# Table structure for table `" . $table . "` \n\n"; + if ($drop == 1) { + $sql_text .= "DROP TABLE IF EXISTS `" . $table . "`;\n\n"; + } + $verif = true; + $sql_text .= $row['Create Table'] . ";\n\n"; + } + } + $this->db->freeRecordSet($result); + $ret['sql_text'] = $sql_text; + $ret['structure'] = $verif; + return $ret; + } + + /** + * Dump table data + * + * @param string table + * @return array 'ret[sql_text] = dump, ret[records] = display records + */ + function dump_table_datas($table) + { + $sql_text = ''; + $count = 0; + $result = $this->db->queryF('SELECT * FROM ' . $table . ';'); + if ($result) { + $num_rows = $this->db->getRowsNum($result); + $num_fields = $this->db->getFieldsNum($result); + + if ($num_rows > 0) { + $field_type = array(); + $i = 0; + while ($i < $num_fields) { + $meta = mysql_fetch_field($result, $i); + array_push($field_type, $meta->type); + $i++; + } + + $sql_text .= "INSERT INTO `" . $table . "` values\n"; + $index = 0; + while ($row = $this->db->fetchRow($result)) { + $count++; + $sql_text .= "("; + for ($i = 0; $i < $num_fields; $i++) { + if (is_null($row[$i])) { + $sql_text .= "null"; + } else { + switch ($field_type[$i]) { + case 'int': + $sql_text .= $row[$i]; + break; + default: + $sql_text .= "'" . mysql_real_escape_string($row[$i]) . "'"; + } + } + if ($i < $num_fields - 1) { + $sql_text .= ","; + } + } + $sql_text .= ")"; + + if ($index < $num_rows - 1) { + $sql_text .= ","; + } else { + $sql_text .= ";"; + } + $sql_text .= "\n"; + $index++; + } + } + } + $this->db->freeRecordSet($result); + $ret['sql_text'] = $sql_text . "\n\n"; + $ret['records'] = $count; + return $ret; + } + + /** + * Dump Write + * + * @param string + * @return array 'ret[file_name] = file name, ret[write] = write + */ + function dump_write($sql_text) + { + $file_name = "dump_" . date("Y.m.d") . "_" . date("H.i.s") . ".sql"; + $path_file = "../dump/" . $file_name; + if (file_put_contents($path_file, $sql_text)) { + $write = true; + } else { + $write = false; + } + $ret['file_name'] = $file_name; + $ret['write'] = $write; + return $ret; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/class/maintenance.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/changelog.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/changelog.txt (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/changelog.txt 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,3 @@ +Version 0.1 +------------------- +Create maintenance plugin \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/credits.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/credits.txt (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/credits.txt 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,3 @@ +Credits +------------------- + Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/index.html 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1 @@ +<script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/install.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/install.txt (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/install.txt 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,6 @@ +INSTALL/UNISTALL +------------------- + +No special measures necessary, follow the standard installation process extract the module folder into the ../modules directory. Install the module through Admin -> System Module -> Modules. + +Detailed instructions on installing modules are available in the XOOPS Operations Manual (http://goo.gl/adT2i) \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/lang_diff.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/lang_diff.txt (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/lang_diff.txt 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,7 @@ +LANGUAGE DIFFERENCES +------------------- + +Below are language differences from a version to next version. + +Release xxx +------------------- Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/licence.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/licence.txt (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/docs/licence.txt 2012-05-12 17:26:48 UTC (rev 9490) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these... [truncated message content] |