public static function init() { global $whmcs; $obj = new WHMCS_License(); $obj->licensekey = $whmcs->get_license_key(); $obj->localkey = $whmcs->get_config("License"); $obj->salt = sha1("WHMCS" . $whmcs->get_config("Version") . "TFB" . $whmcs->get_hash()); $obj->date = date("Ymd"); $obj->decodeLocalOnce(); if (isset($_GET['forceremote'])) { $obj->forceRemoteCheck(); exit; } return $obj; }
if (file_exists(ROOTDIR . "/install/install.php")) { echo "<div style=\"border: 1px dashed #cc0000;font-family:Tahoma;background-color:#FBEEEB;width:100%;padding:10px;color:#cc0000;\"><strong>Security Warning</strong><br>The install folder needs to be deleted for security reasons before using WHMCS</div>"; exit; } if (!$whmcs->check_template_cache_writeable()) { exit("<div style=\"border: 1px dashed #cc0000;font-family:Tahoma;background-color:#FBEEEB;width:100%;padding:10px;color:#cc0000;\"><strong>Permissions Error</strong><br>The templates compiling directory '" . $whmcs->get_template_compiledir_name() . "' must be writeable (CHMOD 777) before you can continue.<br>If the path shown is incorrect, you can update it in the configuration.php file.</div>"); } if (defined("CLIENTAREA") && $CONFIG['MaintenanceMode'] && !$_SESSION['adminid']) { if ($CONFIG['MaintenanceModeURL']) { header("Location: " . $CONFIG['MaintenanceModeURL']); exit; } echo "<div style=\"border: 1px dashed #cc0000;font-family:Tahoma;background-color:#FBEEEB;width:100%;padding:10px;color:#cc0000;\"><strong>Down for Maintenance (Err 3)</strong><br>" . $CONFIG['MaintenanceModeMessage'] . "</div>"; exit; } $licensing = WHMCS_License::init(); if ($licensing->getVersionHash() != "9eb7da5f081b3fc7ae1e460afdcb89ea8239eca1") { exit("License Checking Error"); } if (defined("CLIENTAREA") && isset($_SESSION['uid']) && !isset($_SESSION['adminid'])) { $twofa = new WHMCS_2FA(); $twofa->setClientID($_SESSION['uid']); if ($twofa->isForced() && !$twofa->isEnabled() && $twofa->isActiveClients()) { if ($whmcs->get_filename() == "clientarea" && ($whmcs->get_req_var("action") == "security" || $whmcs->get_req_var("2fasetup"))) { } else { redir("action=security&2fasetup=1&enforce=1", "clientarea.php"); } } } if (isset($_SESSION['currency']) && is_array($_SESSION['currency'])) { $_SESSION['currency'] = $_SESSION['currency']['id'];