if (vmget($_SESSION, 'vm_updatepackage') !== null) { include PAGEPATH . 'admin.update_preview.php'; return; } vmCommonHTML::loadMooTools(); require_once CLASSPATH . 'update.class.php'; if (!empty($_SESSION['vmLatestVersion']) && version_compare($VMVERSION->RELEASE, $_SESSION['vmLatestVersion']) === -1) { $checkbutton_style = 'display:none;'; $downloadbutton_style = ''; } else { $checkbutton_style = ''; $downloadbutton_style = 'display:none;'; } $formObj = new formFactory($VM_LANG->_('VM_UPDATE_CHECK_LBL')); $formObj->startForm('adminForm', 'enctype="multipart/form-data"'); vmUpdate::stepBar(1); $tabs = new vmTabPanel(0, 0, 'versionCheck'); $tabs->startPane('versionCheckPane'); $tabs->startTab($VM_LANG->_('VM_UPDATE_CHECK_LBL'), 'update_check'); ?> <table class="adminlist"> <tr> <th class="title"><?php echo $VM_LANG->_('VM_UPDATE_CHECK_VERSION_INSTALLED'); ?> </th> <th class="title"><?php echo $VM_LANG->_('VM_UPDATE_CHECK_LATEST_VERSION'); ?> </th> </tr>
/** * Deletes the Patch Package File and its extracted contents * * @param array $d * @return boolean */ function removePackageFile(&$d) { global $vm_mainframe, $vmLogger; $packageFile = vmGet($_SESSION, 'vm_updatepackage'); if (empty($packageFile) || !file_exists($packageFile)) { return true; } $packageDir = vmUpdate::getPackageDir($packageFile); if (!empty($packageDir)) { $result = vmRemoveDirectoryR($packageDir); if (!$result) { $vmLogger->err('Failed to remove the Directory of the Patch Package'); } $result = @unlink($packageFile); if (!$result) { $vmLogger->err('Failed to remove the Patch Package File'); return false; } unset($_SESSION['vm_updatepackage']); unset($_SESSION['vmLatestVersion']); } if (vmIsXHR()) { $vm_mainframe->addResponseScript('parent.loadPage("' . $GLOBALS['sess']->url($_SERVER['PHP_SELF'] . '?page=admin.update_check', false, false) . '");'); } return true; }
die('Direct Access to ' . basename(__FILE__) . ' is not allowed.'); } /** * * @version $Id: admin.update_result.php 1431 2008-06-20 17:46:57Z soeren_nb $ * @package VirtueMart * @subpackage html * @copyright Copyright (C) 2008 soeren - All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart 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 /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details. * * http://virtuemart.net * */ global $VM_LANG; require_once CLASSPATH . 'update.class.php'; vmUpdate::stepBar(3); if (!empty($_SESSION['vmupdatemessage'])) { echo '<div class="shop_info">' . shopMakeHtmlSafe($_SESSION['vmupdatemessage']) . '<br /><br /><br />' . $VM_LANG->_('VM_UPDATE_RESULT_TITLE') . ':<br />'; unset($_SESSION['vmupdatemessage']); require_once ADMINPATH . 'version.php'; echo $myVersion . '<br /><br /> <input class="vmicon vmicon32 vmicon-32-apply" type="button" onclick="document.location=\'' . $sess->url($_SERVER['PHP_SELF'] . '?page=store.index') . '\';" value="' . $VM_LANG->_('CMN_CONTINUE') . '" name="submitbutton" />'; echo '</div>'; } else { vmRedirect($sess->url($_SERVER['PHP_SELF'] . '?page=admin.update_check', false, false)); }
if (vmget($_SESSION, 'vm_updatepackage') == null) { $vmLogger->err($VM_LANG->_('VM_UPDATE_NOTDOWNLOADED')); return; } require_once CLASSPATH . 'update.class.php'; $packageContents = vmUpdate::getPatchContents(vmget($_SESSION, 'vm_updatepackage')); if ($packageContents === false) { $vmLogger->flush(); // An Error should be logged before return; } vmCommonHTML::loadMooTools(); $formObj = new formFactory($VM_LANG->_('VM_UPDATE_PREVIEW_LBL')); $formObj->startForm(); $vm_mainframe->addStyleDeclaration(".writable { color:green;}\n.unwritable { color:red;font-weight:bold; }"); vmUpdate::stepBar(2); ?> <a name="warning"></a> <div class="shop_warning"> <span style="font-style: italic;"><?php echo $VM_LANG->_('VM_UPDATE_WARNING_TITLE'); ?> </span><br /> <?php echo $VM_LANG->_('VM_UPDATE_WARNING_TEXT'); ?> </div> <div class="shop_info"> <span style="font-style: italic;"><?php echo $VM_LANG->_('VM_UPDATE_PATCH_DETAILS'); ?>
if (file_exists(CLASSPATH . $classfile)) { require_once CLASSPATH . $classfile; $class = str_replace('.class', '', $class); $methods = get_class_methods($class); if (empty($methods)) { $methods = get_class_methods('vm' . $class); } foreach ($methods as $method) { if ($method == $class) { continue; } $method_array[$method] = $method; } } vmConnector::sendHeaderAndContent(200, ps_html::selectList('function_method', $function, $method_array)); break; case 'checkforupdate': require_once CLASSPATH . 'update.class.php'; $result = vmUpdate::checkLatestVersion(); if (!empty($result)) { // Convert a String like "1.1.1" => "1.11", so we can use it as float in Javascript $version_as_float = substr($result, 0, 3) . substr($result, 4); $version_as_json = '{version_string:"' . $result . '",version:"' . $version_as_float . '"}'; vmConnector::sendHeaderAndContent('200', $version_as_json); } else { vmConnector::sendHeaderAndContent('200', 'Connection Failed'); } default: die; } exit;