Ejemplo n.º 1
0
function sixscan_common_erase_regdata()
{
    sixscan_common_set_site_id(FALSE);
    sixscan_common_set_api_token(FALSE);
    sixscan_common_set_verification_token(FALSE);
    sixscan_common_set_dashboard_token(FALSE);
}
Ejemplo n.º 2
0
function sixscan_installation_register_with_server($tmpkey)
{
    $admin_email = isset($_REQUEST['email']) ? $_REQUEST['email'] : "";
    $admin_pass = isset($_REQUEST['sixscan_password']) ? $_REQUEST['sixscan_password'] : "";
    /*	If there is partner file, partner_id and partner_key are filled */
    sixscan_installation_partner_info_get($partner_id, $partner_key);
    $sixscan_register_result = sixscan_communication_oracle_reg_register(get_option('siteurl'), $admin_email, $admin_pass, SIXSCAN_PLUGIN_URL . "modules/signatures/notice.php", $sixscan_oracle_auth_struct, $partner_id, $partner_key, $tmpkey);
    if ($sixscan_register_result !== TRUE) {
        $err_descr = "There was a problem registering your site with 6Scan: <b>{$sixscan_register_result}</b>.<br><br>";
        $err_msg .= sixscan_menu_wrap_error_msg($err_descr);
        $err_msg .= sixscan_menu_get_error_submission_form($sixscan_register_result);
        return $err_msg;
        /* Fail activation with error message and submission form */
    }
    /*	Save the values from registration to database */
    sixscan_common_set_site_id($sixscan_oracle_auth_struct['site_id']);
    sixscan_common_set_api_token($sixscan_oracle_auth_struct['api_token']);
    sixscan_common_set_verification_token($sixscan_oracle_auth_struct['verification_token']);
    sixscan_common_set_dashboard_token($sixscan_oracle_auth_struct['dashboard_token']);
    /*	Verify the site */
    $verification_result = sixscan_communication_oracle_reg_verification();
    if ($verification_result !== TRUE) {
        /*	If verification failed, try running older verification method */
        sixscan_communication_oracle_reg_create_verification_file();
        $verification_result = sixscan_communication_oracle_reg_verification(TRUE);
        if ($verification_result !== TRUE) {
            sixscan_communication_oracle_reg_remove_verification_file();
            $err_descr = "There was a problem verifying your site with 6Scan: <b>{$verification_result}</b><br><br>";
            $err_msg .= sixscan_menu_wrap_error_msg($err_descr);
            $err_msg .= sixscan_menu_get_error_submission_form($verification_result);
            return $err_msg;
            /* Fail activation with error message and submission form */
        }
    }
    return TRUE;
}