$__pcpin_init_class->_cache = array(); new PCPIN_DB($__pcpin_init_class, ${$_pcpin_dbcn}); new PCPIN_Config($__pcpin_init_class); $_pcpin_init_session = new PCPIN_Session($__pcpin_init_class, $s_id, !empty($_GET['b_id']) || !empty($_GET['external_url']) || !empty($_GET['load_banner']) || defined('PCPIN_NO_SESSION')); unset($__pcpin_init_class); } } unset(${$_pcpin_dbcn}); unset($_pcpin_dbcn); // Get software version if (!defined('PCPIN_NO_SESSION') && empty($_GET['external_url'])) { _pcpin_loadClass('version'); $_pcpin_version = new PCPIN_Version($_pcpin_init_session); if ($_pcpin_version->_db_getList('version', 1)) { define('PCPIN_VERSION', number_format($_pcpin_version->_db_list[0]['version'], 2, '.', '')); $_pcpin_version->_db_freeList(); unset($_pcpin_version); } else { define('PCPIN_VERSION', '0.00'); } } // Load language if (!defined('PCPIN_NO_SESSION')) { if (empty($_GET['b_id']) && empty($_GET['external_url'])) { _pcpin_loadClass('language'); $l = new PCPIN_Language($_pcpin_init_session); $_pcpin_set_language = $_pcpin_init_session->_s_language_id; if (!empty($_pcpin_init_session->_conf_all['allow_language_selection']) && !empty($_POST['language_id'])) { $_pcpin_set_language = $_POST['language_id']; } if (true !== $l->setLanguage($_pcpin_set_language)) {
_pcpin_loadClass('version'); $version = new PCPIN_Version($session); if ($version->_db_getList(1)) { $current_version = $version->_db_list[0]['version']; $last_check = $version->_db_list[0]['last_version_check'] > '0000-00-00 00:00:00' ? $current_user->makeDate(PCPIN_Common::datetimeToTimestamp($version->_db_list[0]['last_version_check'])) : $l->g('never'); $new_version_available = $version->_db_list[0]['new_version_available']; $new_version_url = $version->_db_list[0]['new_version_url']; $version_check_key = $version->_db_list[0]['version_check_key']; } else { $current_version = 6.0; $last_check = $l->g('never'); $new_version_available = $current_version; $new_version_url = ''; $version_check_key = PCPIN_Common::randomString(mt_rand(10, 20)); } $version->_db_freeList(); // Check security key if (!empty($version_check_key) && md5($sk) == $version_check_key) { if ($session->_db_getList('_s_id', '_s_security_code = ' . $version_check_key, 1)) { // Security key check passed $old_session = $session->_db_list[0]['_s_id']; // Save version number $version->setLastVersionCheckTime(); $version->setNewestAvailableVersion($nv); $version->setVersionCheckKey(); $version->setNewVersionDownloadUrl(base64_decode($dl)); $session->_s_updateSession($old_session, false, true, null, null, null, ''); header('Location: ' . PCPIN_ADMIN_FORMLINK . '?s_id=' . $old_session . '&ainc=versions&version_checked'); die; } }