\nThank you for your submission. 6Scan support is working on your problem and will be in touch shortly.\n\n";
/* There is no more last error */
update_option( SIXSCAN_OPTION_LAST_ERROR_OCCURED , '');
return;
}
if ( sixscan_common_is_oracle_registered() == TRUE ){
if ( sixscan_common_is_oracle_verified() == TRUE ){ /* Registered and validated */
/* Show the dashboard */
sixscan_menu_show_options_screen();
}
else { /* Registered , but not validated */
if ( isset( $_POST['retry_validation'] ) ){
/* We are retrying validation */
$verification_result = sixscan_communication_oracle_reg_verification();
if ( $verification_result === TRUE ){
sixscan_common_set_oracle_verified_true();
sixscan_menu_show_options_screen();
return;
}else{
$error_message = "There was a problem verifying your site with 6Scan: " . $verification_result . "
";
update_option( SIXSCAN_OPTION_LAST_ERROR_OCCURED , base64_encode( $verification_result ) );
sixscan_menu_show_error_msg( $error_message );
sixscan_menu_show_error_submission_form( $verification_result );
}
}else{
/* User just reentered verification screen */
$previous_error = get_option( SIXSCAN_OPTION_LAST_ERROR_OCCURED );
if ( $previous_error != '' ){
$error_message = "There was a problem verifying your site with 6Scan: " . base64_decode( $previous_error ) . "
";
sixscan_menu_show_error_msg( $error_message );
sixscan_menu_show_error_submission_form( $previous_error );
}else{
/* Technicall , this menu should never be displayed, but let's leave this code, in case somebody plays with DB */
$error_message = "There was a problem verifying your site with 6Scan.
Please click 'Retry Verification'.
";
sixscan_menu_show_error_msg( $error_message );
}
}
/* verification failed. Show "Try now" button here */
sixscan_menu_show_verification_screen();
return;
}
}
else { /* Not registered , and not validated */
if ( ! isset( $_POST[ 'user_email' ] ) || is_email( $_POST[ 'user_email' ] ) == FALSE ){
/* Show registration screen */
sixscan_menu_show_reg_screen();
return;
}
else {
/* Registration process */
$registration_form_data = base64_encode( json_encode( $_POST ) );
$sixscan_register_result = sixscan_communication_oracle_reg_register( get_option( 'siteurl' ) ,
$_POST[ 'user_email' ] , SIXSCAN_PLUGIN_URL . "modules/signatures/notice.php" , $registration_form_data , $sixscan_oracle_auth_struct );
if ( $sixscan_register_result !== TRUE ){
$err_descr = "There was a problem registering your site with 6Scan: $sixscan_register_result.
";
sixscan_menu_show_error_msg( $err_descr );
sixscan_menu_show_error_submission_form( $sixscan_register_result );
return;
}
/* Mark as registered */
sixscan_common_set_oracle_registered_true();
/* 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 ) {
$error_message = "There was a problem verifying your site with 6Scan: " . $verification_result . "
";
update_option( SIXSCAN_OPTION_LAST_ERROR_OCCURED , base64_encode( $verification_result ) );
sixscan_menu_show_error_msg( $error_message );
sixscan_menu_show_error_submission_form( $verification_result );
sixscan_menu_show_verification_screen();
return;
}
sixscan_common_set_oracle_verified_true();
/* Show user his options screen */
sixscan_menu_show_options_screen( TRUE );
}
}
}
function sixscan_menu_show_options_screen( $is_first_time = FALSE) {
print "\n";
?>
\n";
print "\n";
?>