Beispiel #1
0
function sixscan_common_is_regdata_present()
{
    if (sixscan_common_get_site_id() == FALSE || sixscan_common_get_api_token() == FALSE || sixscan_common_get_verification_token() == FALSE || sixscan_common_get_dashboard_token() == FALSE) {
        return FALSE;
    }
    return TRUE;
}
Beispiel #2
0
if (sixscan_common_is_regdata_present() != TRUE) {
    header("HTTP/1.1 500 6Scan not registered");
    exit(0);
}
/*	Backwards compatibility. Plugins of versions <1.0.5 had another "active" indication */
$backward_compat_active = get_option('sixscan_setupaccount');
if ($backward_compat_active == 'SETUP_STAGE_RUNNING' || $backward_compat_active == 'SETUP_STAGE_INSTALLED') {
    /*	Cleanup and activate for new version */
    delete_option('sixscan_setupaccount');
    sixscan_common_set_account_active(TRUE);
}
/*	Verify process. Make sure that sites belongs to the user that registered it */
if (isset($_REQUEST[SIXSCAN_NOTICE_VERIFICATION_NAME]) && isset($_REQUEST[SIXSCAN_NOTICE_AUTH_NAME])) {
    $expected_auth_id = md5(sixscan_common_get_api_token() . sixscan_common_get_site_id());
    if ($_REQUEST[SIXSCAN_NOTICE_VERIFICATION_NAME] == sixscan_common_get_site_id() && $_REQUEST[SIXSCAN_NOTICE_AUTH_NAME] == $expected_auth_id) {
        echo SIXSCAN_VERIFICATION_DELIMITER . sixscan_common_get_verification_token() . SIXSCAN_VERIFICATION_DELIMITER;
    } else {
        header("HTTP/1.1 500 Bad verification token");
    }
    exit(0);
}
if (sixscan_common_is_account_active() != TRUE) {
    header("HTTP/1.1 500 6Scan not active");
    exit(0);
}
$oracle_nonce = intval($_REQUEST['nonce']);
$last_nonce = intval(get_option(SIXSCAN_OPTION_COMM_LAST_SIG_UPDATE_NONCE));
if ($last_nonce >= $oracle_nonce) {
    header("HTTP/1.1 500 Bad nonce request");
    exit(0);
}
function sixscan_communication_oracle_reg_remove_verification_file()
{
    $verification_file_name = ABSPATH . "/" . SIXSCAN_VERIFICATION_FILE_PREFIX . sixscan_common_get_verification_token() . ".gif";
    global $wp_filesystem;
    $wp_filesystem->delete($verification_file_name);
}