Ejemplo n.º 1
0
}
*/
ob_start();
$timerStart = microtime(true);
$currentFileName = array_reverse(explode("/", $_SERVER['SCRIPT_NAME']));
// $cookieLifetime = (time() + (((int)Configuration::get('PS_COOKIE_LIFETIME_BO') > 0 ? (int)Configuration::get('PS_COOKIE_LIFETIME_BO') : 1)* 3600));
$cookieLifetime = time() + 84600;
$adminFilename = trim($_POST['dir'], '/') . '/';
// die(info($adminFilename));
require_once AUTOUPGRADE_MODULE_DIR . 'Tools14.php';
require_once AUTOUPGRADE_MODULE_DIR . 'AdminSelfTab.php';
require_once AUTOUPGRADE_MODULE_DIR . 'AdminSelfUpgrade.php';
// $needClass = array('Cookie'); //, 'ObjectModel', 'Db', 'MySQL', 'SubDomain', 'Tools');
$needClass = array();
foreach ($needClass as $class) {
    if (!class_exists($class, false)) {
        if (file_exists(_PS_ADMIN_DIR_ . '/autoupgrade/' . $class . '.php')) {
            require_once _PS_ADMIN_DIR_ . '/autoupgrade/' . $class . '.php';
            info($class, 'from autoupgrade');
        } else {
            require_once _PS_ROOT_DIR_ . '/classes/' . $class . '.php';
        }
        if (version_compare(_PS_VERSION_, '1.4', '<')) {
            if (!class_exists($class, false) and class_exists($class . 'Core', false)) {
                eval('class ' . $class . ' extends ' . $class . 'Core{}');
            }
        }
    }
}
$currentIndex = $_SERVER['SCRIPT_NAME'] . (($tab = Tools14::getValue('tab')) ? '?tab=' . $tab : '');
Ejemplo n.º 2
0
    define('_PS_ROOT_DIR_', realpath(_PS_ADMIN_DIR_ . '/../'));
}
// ajax-upgrade-tab is located in admin/autoupgrade directory
require_once _PS_ROOT_DIR_ . '/config/settings.inc.php';
//require(_PS_ADMIN_DIR_.'/functions.php');
include AUTOUPGRADE_MODULE_DIR . 'init.php';
// this is used to set this->ajax = true in the constructor
global $ajax;
$ajax = true;
$adminObj = new AdminSelfUpgrade();
if (is_object($adminObj)) {
    $adminObj->ajax = 1;
    if ($adminObj->checkToken()) {
        // the differences with index.php is here
        $adminObj->ajaxPreProcess();
        $action = Tools14::getValue('action');
        // no need to use displayConf() here
        if (!empty($action) and method_exists($adminObj, 'ajaxProcess' . $action)) {
            $adminObj->{'ajaxProcess' . $action}();
        } else {
            $adminObj->ajaxProcess();
        }
        // @TODO We should use a displayAjaxError
        $adminObj->displayErrors();
        if (!empty($action) and method_exists($adminObj, 'displayAjax' . $action)) {
            $adminObj->{'displayAjax' . $action}();
        } else {
            $adminObj->displayAjax();
        }
    } else {
        // If this is an XSS attempt, then we should only display a simple, secure page
Ejemplo n.º 3
0
 public static function file_get_contents($url, $use_include_path = false, $stream_context = null, $curl_timeout = 5)
 {
     if (!extension_loaded('openssl') and strpos('https://', $url) === true) {
         $url = str_replace('https', 'http', $url);
     }
     if ($stream_context == null && preg_match('/^https?:\\/\\//', $url)) {
         $stream_context = @stream_context_create(array('http' => array('timeout' => $curl_timeout, 'header' => "User-Agent:MyAgent/1.0\r\n")));
     }
     if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1')) || !preg_match('/^https?:\\/\\//', $url)) {
         $var = @file_get_contents($url, $use_include_path, $stream_context);
         /* PSCSX-3205 buffer output ? */
         if (Tools14::getValue('ajaxMode') && ob_get_level() && ob_get_length() > 0) {
             ob_clean();
         }
         if ($var) {
             return $var;
         }
     } elseif (function_exists('curl_init')) {
         $curl = curl_init();
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($curl, CURLOPT_URL, $url);
         curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
         curl_setopt($curl, CURLOPT_TIMEOUT, $curl_timeout);
         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
         $opts = stream_context_get_options($stream_context);
         if (isset($opts['http']['method']) && self::strtolower($opts['http']['method']) == 'post') {
             curl_setopt($curl, CURLOPT_POST, true);
             if (isset($opts['http']['content'])) {
                 parse_str($opts['http']['content'], $datas);
                 curl_setopt($curl, CURLOPT_POSTFIELDS, $datas);
             }
         }
         $content = curl_exec($curl);
         curl_close($curl);
         return $content;
     } else {
         return false;
     }
 }
Ejemplo n.º 4
0
 protected function _postConfig($fields)
 {
     global $currentIndex, $smarty;
     $languages = Language::getLanguages(false);
     if (method_exists('Tools', 'clearCache')) {
         Tools14::clearCache($smarty);
     }
     /* Check required fields */
     foreach ($fields as $field => $values) {
         if (isset($values['required']) and $values['required']) {
             if (isset($values['type']) and $values['type'] == 'textLang') {
                 foreach ($languages as $language) {
                     if (($value = Tools14::getValue($field . '_' . $language['id_lang'])) == false and (string) $value != '0') {
                         $this->_errors[] = Tools14::displayError('field') . ' <b>' . $values['title'] . '</b> ' . Tools14::displayError('is required.');
                     }
                 }
             } elseif (($value = Tools14::getValue($field)) == false and (string) $value != '0') {
                 $this->_errors[] = Tools14::displayError('field') . ' <b>' . $values['title'] . '</b> ' . Tools14::displayError('is required.');
             }
         }
     }
     /* Check fields validity */
     foreach ($fields as $field => $values) {
         if (isset($values['type']) and $values['type'] == 'textLang') {
             foreach ($languages as $language) {
                 if (Tools14::getValue($field . '_' . $language['id_lang']) and isset($values['validation'])) {
                     if (!Validate::$values['validation'](Tools14::getValue($field . '_' . $language['id_lang']))) {
                         $this->_errors[] = Tools14::displayError('field') . ' <b>' . $values['title'] . '</b> ' . Tools14::displayError('is invalid.');
                     }
                 }
             }
         } elseif (Tools14::getValue($field) and isset($values['validation'])) {
             if (!Validate::$values['validation'](Tools14::getValue($field))) {
                 $this->_errors[] = Tools14::displayError('field') . ' <b>' . $values['title'] . '</b> ' . Tools14::displayError('is invalid.');
             }
         }
     }
     /* Default value if null */
     foreach ($fields as $field => $values) {
         if (!Tools14::getValue($field) and isset($values['default'])) {
             $_POST[$field] = $values['default'];
         }
     }
     /* Save process */
     if (!sizeof($this->_errors)) {
         if (Tools14::isSubmit('submitAppearanceconfiguration')) {
             if (isset($_FILES['PS_LOGO']['tmp_name']) and $_FILES['PS_LOGO']['tmp_name']) {
                 if ($error = checkImage($_FILES['PS_LOGO'], 300000)) {
                     $this->_errors[] = $error;
                 }
                 if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) or !move_uploaded_file($_FILES['PS_LOGO']['tmp_name'], $tmpName)) {
                     return false;
                 } elseif (!@imageResize($tmpName, _PS_IMG_DIR_ . 'logo.jpg')) {
                     $this->_errors[] = 'an error occurred during logo copy';
                 }
                 unlink($tmpName);
             }
             if (isset($_FILES['PS_LOGO_MAIL']['tmp_name']) and $_FILES['PS_LOGO_MAIL']['tmp_name']) {
                 if ($error = checkImage($_FILES['PS_LOGO_MAIL'], 300000)) {
                     $this->_errors[] = $error;
                 }
                 if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_MAIL')) or !move_uploaded_file($_FILES['PS_LOGO_MAIL']['tmp_name'], $tmpName)) {
                     return false;
                 } elseif (!@imageResize($tmpName, _PS_IMG_DIR_ . 'logo_mail.jpg')) {
                     $this->_errors[] = 'an error occurred during logo copy';
                 }
                 unlink($tmpName);
             }
             if (isset($_FILES['PS_LOGO_INVOICE']['tmp_name']) and $_FILES['PS_LOGO_INVOICE']['tmp_name']) {
                 if ($error = checkImage($_FILES['PS_LOGO_INVOICE'], 300000)) {
                     $this->_errors[] = $error;
                 }
                 if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_INVOICE')) or !move_uploaded_file($_FILES['PS_LOGO_INVOICE']['tmp_name'], $tmpName)) {
                     return false;
                 } elseif (!@imageResize($tmpName, _PS_IMG_DIR_ . 'logo_invoice.jpg')) {
                     $this->_errors[] = 'an error occurred during logo copy';
                 }
                 unlink($tmpName);
             }
             if (isset($_FILES['PS_STORES_ICON']['tmp_name']) and $_FILES['PS_STORES_ICON']['tmp_name']) {
                 if ($error = checkImage($_FILES['PS_STORES_ICON'], 300000)) {
                     $this->_errors[] = $error;
                 }
                 if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_STORES_ICON')) or !move_uploaded_file($_FILES['PS_STORES_ICON']['tmp_name'], $tmpName)) {
                     return false;
                 } elseif (!@imageResize($tmpName, _PS_IMG_DIR_ . 'logo_stores.gif')) {
                     $this->_errors[] = 'an error occurred during logo copy';
                 }
                 unlink($tmpName);
             }
             $this->uploadIco('PS_FAVICON', _PS_IMG_DIR_ . 'favicon.ico');
         }
         /* Update settings in database */
         if (!sizeof($this->_errors)) {
             foreach ($fields as $field => $values) {
                 unset($val);
                 if (isset($values['type']) and $values['type'] == 'textLang') {
                     foreach ($languages as $language) {
                         $val[$language['id_lang']] = isset($values['cast']) ? $values['cast'](Tools14::getValue($field . '_' . $language['id_lang'])) : Tools14::getValue($field . '_' . $language['id_lang']);
                     }
                 } else {
                     $val = isset($values['cast']) ? $values['cast'](Tools14::getValue($field)) : Tools14::getValue($field);
                 }
                 Configuration::updateValue($field, $val);
             }
             Tools14::redirectAdmin($currentIndex . '&conf=6' . '&token=' . $this->token);
         }
     }
 }
Ejemplo n.º 5
0
    protected function _displayForm($name, $fields, $tabname, $size, $icon)
    {
        global $currentIndex;
        $defaultLanguage = (int) Configuration::get('PS_LANG_DEFAULT');
        $languages = Language::getLanguages(false);
        $confValues = $this->getConf($fields, $languages);
        $divLangName = $this->getDivLang($fields);
        $required = false;
        echo '
		<script type="text/javascript">
			id_language = Number(' . $defaultLanguage . ');
			
			function addRemoteAddr(){
				var length = $(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\').length;	
				if (length > 0)
					$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\') +\',' . Tools14::getRemoteAddr() . '\');
				else
					$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',\'' . Tools14::getRemoteAddr() . '\');
			}
		</script>
		<form action="' . $currentIndex . '&submit' . $name . $this->table . '=1&token=' . $this->token . '" method="post" enctype="multipart/form-data">
			<fieldset><legend><img src="../img/admin/' . strval($icon) . '.gif" />' . $tabname . '</legend>';
        foreach ($fields as $key => $field) {
            /* Specific line for e-mails settings */
            if (get_class($this) == 'Adminemails' and $key == 'PS_MAIL_SERVER') {
                echo '<div id="smtp" style="display: ' . ((isset($confValues['PS_MAIL_METHOD']) and $confValues['PS_MAIL_METHOD'] == 2) ? 'block' : 'none') . ';">';
            }
            if (isset($field['required']) and $field['required']) {
                $required = true;
            }
            $val = $this->getVal($confValues, $key);
            if (!in_array($field['type'], array('image', 'radio', 'container', 'container_end')) or isset($field['show'])) {
                echo '<div style="clear: both; padding-top:15px;">' . ($field['title'] ? '<label >' . $field['title'] . '</label>' : '') . '<div class="margin-form" style="padding-top:5px;">';
            }
            /* Display the appropriate input type for each field */
            switch ($field['type']) {
                case 'disabled':
                    echo $field['disabled'];
                    break;
                case 'select':
                    echo '
					<select name="' . $key . '"' . (isset($field['js']) === true ? ' onchange="' . $field['js'] . '"' : '') . ' id="' . $key . '">';
                    foreach ($field['list'] as $k => $value) {
                        echo '<option value="' . (isset($value['cast']) ? $value['cast']($value[$field['identifier']]) : $value[$field['identifier']]) . '"' . ($val == $value[$field['identifier']] ? ' selected="selected"' : '') . '>' . $value['name'] . '</option>';
                    }
                    echo '
					</select>';
                    break;
                case 'selectLang':
                    foreach ($languages as $language) {
                        echo '
						<div id="' . $key . '_' . $language['id_lang'] . '" style="margin-bottom:8px; display: ' . ($language['id_lang'] == $defaultLanguage ? 'block' : 'none') . '; float: left; vertical-align: top;">
							<select name="' . $key . '_' . strtoupper($language['iso_code']) . '">';
                        foreach ($field['list'] as $k => $value) {
                            echo '<option value="' . (isset($value['cast']) ? $value['cast']($value[$field['identifier']]) : $value[$field['identifier']]) . '"' . (htmlentities(Tools14::getValue($key . '_' . strtoupper($language['iso_code']), Configuration::get($key . '_' . strtoupper($language['iso_code'])) ? Configuration::get($key . '_' . strtoupper($language['iso_code'])) : ''), ENT_COMPAT, 'UTF-8') == $value[$field['identifier']] ? ' selected="selected"' : '') . '>' . $value['name'] . '</option>';
                        }
                        echo '
							</select>
						</div>';
                    }
                    $this->displayFlags($languages, $defaultLanguage, $divLangName, $key);
                    break;
                case 'bool':
                    echo '<label class="t" for="' . $key . '_on"><img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /></label>
					<input type="radio" name="' . $key . '" id="' . $key . '_on" value="1"' . ($val ? ' checked="checked"' : '') . (isset($field['js']['on']) ? $field['js']['on'] : '') . ' />
					<label class="t" for="' . $key . '_on"> ' . $this->l('Yes') . '</label>
					<label class="t" for="' . $key . '_off"><img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /></label>
					<input type="radio" name="' . $key . '" id="' . $key . '_off" value="0" ' . (!$val ? 'checked="checked"' : '') . (isset($field['js']['off']) ? $field['js']['off'] : '') . '/>
					<label class="t" for="' . $key . '_off"> ' . $this->l('No') . '</label>';
                    break;
                case 'radio':
                    foreach ($field['choices'] as $cValue => $cKey) {
                        echo '<input type="radio" name="' . $key . '" id="' . $key . $cValue . '_on" value="' . (int) $cValue . '"' . ($cValue == $val ? ' checked="checked"' : '') . (isset($field['js'][$cValue]) ? ' ' . $field['js'][$cValue] : '') . ' /><label class="t" for="' . $key . $cValue . '_on"> ' . $cKey . '</label><br />';
                    }
                    echo '<br />';
                    break;
                case 'image':
                    echo '
					<table cellspacing="0" cellpadding="0">
						<tr>';
                    if ($name == 'themes') {
                        echo '
						<td colspan="' . sizeof($field['list']) . '">
							<b>' . $this->l('In order to use a new theme, please follow these steps:', get_class()) . '</b>
							<ul>
								<li>' . $this->l('Import your theme using this module:', get_class()) . ' <a href="index.php?tab=AdminModules&token=' . Tools14::getAdminTokenLite('AdminModules') . '&filtername=themeinstallator" style="text-decoration: underline;">' . $this->l('Theme installer', get_class()) . '</a></li>
								<li>' . $this->l('When your theme is imported, please select the theme in this page', get_class()) . '</li>
							</ul>
						</td>
						</tr>
						<tr>
						';
                    }
                    $i = 0;
                    foreach ($field['list'] as $theme) {
                        echo '<td class="center" style="width: 180px; padding:0px 20px 20px 0px;">
						<input type="radio" name="' . $key . '" id="' . $key . '_' . $theme['name'] . '_on" style="vertical-align: text-bottom;" value="' . $theme['name'] . '"' . (_THEME_NAME_ == $theme['name'] ? 'checked="checked"' : '') . ' />
						<label class="t" for="' . $key . '_' . $theme['name'] . '_on"> ' . Tools14::strtolower($theme['name']) . '</label>
						<br />
						<label class="t" for="' . $key . '_' . $theme['name'] . '_on">
							<img src="../themes/' . $theme['name'] . '/preview.jpg" alt="' . Tools14::strtolower($theme['name']) . '">
						</label>
						</td>';
                        if (isset($field['max']) and ($i + 1) % $field['max'] == 0) {
                            echo '</tr><tr>';
                        }
                        $i++;
                    }
                    echo '</tr>
					</table>';
                    break;
                case 'price':
                    $default_currency = new Currency((int) Configuration::get("PS_CURRENCY_DEFAULT"));
                    echo $default_currency->getSign('left') . '<input type="' . $field['type'] . '" size="' . (isset($field['size']) ? (int) $field['size'] : 5) . '" name="' . $key . '" value="' . ($field['type'] == 'password' ? '' : htmlentities($val, ENT_COMPAT, 'UTF-8')) . '" />' . $default_currency->getSign('right') . ' ' . $this->l('(tax excl.)');
                    break;
                case 'textLang':
                    foreach ($languages as $language) {
                        echo '
						<div id="' . $key . '_' . $language['id_lang'] . '" style="margin-bottom:8px; display: ' . ($language['id_lang'] == $defaultLanguage ? 'block' : 'none') . '; float: left; vertical-align: top;">
							<input type="text" size="' . (isset($field['size']) ? (int) $field['size'] : 5) . '" name="' . $key . '_' . $language['id_lang'] . '" value="' . htmlentities($this->getVal($confValues, $key . '_' . $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" />
						</div>';
                    }
                    $this->displayFlags($languages, $defaultLanguage, $divLangName, $key);
                    break;
                case 'file':
                    if (isset($field['thumb']) and $field['thumb'] and $field['thumb']['pos'] == 'before') {
                        echo '<img src="' . $field['thumb']['file'] . '" alt="' . $field['title'] . '" title="' . $field['title'] . '" /><br />';
                    }
                    echo '<input type="file" name="' . $key . '" />';
                    break;
                case 'textarea':
                    echo '<textarea name=' . $key . ' cols="' . $field['cols'] . '" rows="' . $field['rows'] . '">' . htmlentities($val, ENT_COMPAT, 'UTF-8') . '</textarea>';
                    break;
                case 'container':
                    echo '<div id="' . $key . '">';
                    break;
                case 'container_end':
                    echo (isset($field['content']) === true ? $field['content'] : '') . '</div>';
                    break;
                case 'maintenance_ip':
                    echo '<input type="' . $field['type'] . '"' . (isset($field['id']) === true ? ' id="' . $field['id'] . '"' : '') . ' size="' . (isset($field['size']) ? (int) $field['size'] : 5) . '" name="' . $key . '" value="' . ($field['type'] == 'password' ? '' : htmlentities($val, ENT_COMPAT, 'UTF-8')) . '" />' . (isset($field['next']) ? '&nbsp;' . strval($field['next']) : '') . ' &nbsp<a href="#" class="button" onclick="addRemoteAddr(); return false;">' . $this->l('Add my IP') . '</a>';
                    break;
                case 'text':
                default:
                    echo '<input type="' . $field['type'] . '"' . (isset($field['id']) === true ? ' id="' . $field['id'] . '"' : '') . ' size="' . (isset($field['size']) ? (int) $field['size'] : 5) . '" name="' . $key . '" value="' . ($field['type'] == 'password' ? '' : htmlentities($val, ENT_COMPAT, 'UTF-8')) . '" />' . (isset($field['next']) ? '&nbsp;' . strval($field['next']) : '');
            }
            echo (isset($field['required']) and $field['required'] and !in_array($field['type'], array('image', 'radio'))) ? ' <sup>*</sup>' : '';
            echo isset($field['desc']) ? '<p style="clear:both">' . ((isset($field['thumb']) and $field['thumb'] and $field['thumb']['pos'] == 'after') ? '<img src="' . $field['thumb']['file'] . '" alt="' . $field['title'] . '" title="' . $field['title'] . '" style="float:left;" />' : '') . $field['desc'] . '</p>' : '';
            if (!in_array($field['type'], array('image', 'radio', 'container', 'container_end')) or isset($field['show'])) {
                echo '</div></div>';
            }
        }
        /* End of specific div for e-mails settings */
        if (get_class($this) == 'Adminemails') {
            echo '<script type="text/javascript">if (getE(\'PS_MAIL_METHOD2_on\').checked) getE(\'smtp\').style.display = \'block\'; else getE(\'smtp\').style.display = \'none\';</script></div>';
        }
        if (!is_writable(PS_ADMIN_DIR . '/../config/settings.inc.php') and $name == 'themes') {
            echo '<p><img src="../img/admin/warning.gif" alt="" /> ' . $this->l('if you change the theme, the settings.inc.php file must be writable (CHMOD 755 / 777)') . '</p>';
        }
        echo '	<div align="center" style="margin-top: 20px;">
					<input type="submit" value="' . $this->l('   Save   ', 'AdminPreferences') . '" name="submit' . ucfirst($name) . $this->table . '" class="button" />
				</div>
				' . ($required ? '<div class="small"><sup>*</sup> ' . $this->l('Required field', 'AdminPreferences') . '</div>' : '') . '
			</fieldset>
		</form>';
        if (get_class($this) == 'AdminPreferences') {
            echo '<script type="text/javascript">changeCMSActivationAuthorization();</script>';
        }
    }
Ejemplo n.º 6
0
    public function display()
    {
        $this->_html .= '<script type="text/javascript">var jQueryVersionPS = parseInt($().jquery.replace(/\\./g, ""));</script>
		<script type="text/javascript" src="' . __PS_BASE_URI__ . 'modules/autoupgrade/js/jquery-1.6.2.min.js"></script>
		<script type="text/javascript">if (jQueryVersionPS >= 162) jq162 = jQuery.noConflict(true);</script>';
        /* PrestaShop demo mode */
        if (defined('_PS_MODE_DEMO_') && _PS_MODE_DEMO_) {
            echo '<div class="error">' . $this->l('This functionality has been disabled.') . '</div>';
            return;
        }
        if (!file_exists($this->autoupgradePath . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php')) {
            echo '<div class="error">' . '<img src="../img/admin/warning.gif" /> ' . $this->l('[TECHNICAL ERROR] ajax-upgradetab.php is missing. Please reinstall or reset the module.') . '</div>';
            return false;
        }
        /* PrestaShop demo mode*/
        // in order to not use Tools class
        $upgrader = new Upgrader();
        preg_match('#([0-9]+\\.[0-9]+)(?:\\.[0-9]+){1,2}#', _PS_VERSION_, $matches);
        $upgrader->branch = $matches[1];
        $channel = $this->getConfig('channel');
        switch ($channel) {
            case 'archive':
                $upgrader->channel = 'archive';
                $upgrader->version_num = $this->getConfig('archive.version_num');
                break;
            case 'directory':
                $upgrader->channel = 'directory';
                $upgrader->version_num = $this->getConfig('directory.version_num');
                break;
            default:
                $upgrader->channel = $channel;
                if (isset($_GET['refreshCurrentVersion'])) {
                    // delete the potential xml files we saved in config/xml (from last release and from current)
                    $upgrader->clearXmlMd5File(_PS_VERSION_);
                    $upgrader->clearXmlMd5File($upgrader->version_num);
                    if ($this->getConfig('channel') == 'private' && !$this->getConfig('private_allow_major')) {
                        $upgrader->checkPSVersion(true, array('private', 'minor'));
                    } else {
                        $upgrader->checkPSVersion(true, array('minor'));
                    }
                    Tools14::redirectAdmin($this->currentIndex . '&conf=5&token=' . Tools14::getValue('token'));
                } else {
                    if ($this->getConfig('channel') == 'private' && !$this->getConfig('private_allow_major')) {
                        $upgrader->checkPSVersion(false, array('private', 'minor'));
                    } else {
                        $upgrader->checkPSVersion(false, array('minor'));
                    }
                }
        }
        $this->upgrader = $upgrader;
        $this->_html .= '<link type="text/css" rel="stylesheet" href="' . __PS_BASE_URI__ . 'modules/autoupgrade/css/styles.css" />';
        $this->_html .= '<div class="bootstrap" id="informationBlock">
            <div class="panel">
                <div class="panel-heading">
                  ' . $this->l('Welcome!') . '
                </div>
                <p>
                    ' . $this->l('With the PrestaShop 1-Click Upgrade module, upgrading your store to the latest version available has never been easier!') . '<br /><br />
                    <span style="color:#CC0000;font-weight:bold">' . $this->l('Please always perform a full manual backup of your files and database before starting any upgrade.') . '</span><br />
                    ' . $this->l('Double-check the integrity of your backup and that you can easily manually roll-back if necessary.') . '<br />
                    ' . $this->l('If you do not know how to proceed, ask your hosting provider.') . '
                </p>
            </div>
            </div>';
        /* Make sure the user has configured the upgrade options, or set default values */
        $configuration_keys = array('PS_AUTOUP_UPDATE_DEFAULT_THEME' => 1, 'PS_AUTOUP_CHANGE_DEFAULT_THEME' => 0, 'PS_AUTOUP_KEEP_MAILS' => 0, 'PS_AUTOUP_CUSTOM_MOD_DESACT' => 1, 'PS_AUTOUP_MANUAL_MODE' => 0, 'PS_AUTOUP_PERFORMANCE' => 1, 'PS_DISPLAY_ERRORS' => 0);
        foreach ($configuration_keys as $k => $default_value) {
            if (Configuration::get($k) == '') {
                Configuration::updateValue($k, $default_value);
            }
        }
        /* Checks/requirements and "Upgrade PrestaShop now" blocks */
        $this->_displayCurrentConfiguration();
        $this->_displayBlockUpgradeButton();
        $this->_displayComparisonBlock();
        $this->_displayBlockActivityLog();
        $this->_displayRollbackForm();
        $this->_html .= '<br/>';
        $this->_html .= '<form action="' . $this->currentIndex . '&amp;customSubmitAutoUpgrade=1&amp;token=' . $this->token . '" method="post" class="form-horizontal" enctype="multipart/form-data">';
        $this->_displayForm('backupOptions', $this->_fieldsBackupOptions, '<a href="#" name="backup-options" id="backup-options">' . $this->l('Backup Options') . '</a>', '', 'database_gear');
        $this->_displayForm('upgradeOptions', $this->_fieldsUpgradeOptions, '<a href="#" name="upgrade-options" id="upgrade-options">' . $this->l('Upgrade Options') . '</a>', '', 'prefs');
        $this->_html .= '</form>';
        $this->_html .= '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'modules/autoupgrade/js/jquery.xml2json.js"></script>';
        $this->_html .= '<script type="text/javascript">' . $this->_getJsInit() . '</script>';
        echo $this->_html;
    }