$key = PCPIN_Common::randomString(36, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-()[].,');
    $version->setVersionCheckKey($key);
    $session->_s_updateSession($session->_s_id, true, true, null, null, null, md5($key));
    header('Location: ' . PCPIN_VERSIONCHECKER_URL . '?' . htmlspecialchars($key));
    die;
}
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/versions.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
if (empty($do_check)) {
    // Display form
    $tpl->addvars('main', array('current_version' => htmlspecialchars($current_version), 'last_check' => htmlspecialchars($last_check)));
    if ($current_version < $new_version_available) {
        $tpl->addVars('newer_version', array('display' => true, 'url' => $new_version_url, 'newversionavailable' => htmlspecialchars(str_replace('[VERSION]', $new_version_available, $l->g('new_version_is_available')))));
    } elseif (isset($version_checked)) {
        $tpl->addVar('no_new_version', 'display', true);
    }
}