configs->get_value('aiowps_unlock_request_secret_key'); $unlock_temp_string = isset($_POST['aiowps-unlock-temp-string'])?strip_tags($_POST['aiowps-unlock-temp-string']):''; $submitted_encoded_string = base64_encode($unlock_temp_string.$unlock_secret_string); if($submitted_encoded_string !== $unlock_encoded_info) { //Someone somehow landed on this page directly without clicking the unlock button on login form echo '
'.__('ERROR: Unable to process your request!','aiowpsecurity').'
'; die(); } else if($display_form) { echo display_unlock_form(); } } //End if block if (isset($_POST['aiowps_wp_submit_unlock_request'])) { //This catches the $_POST when someone submits the form from our special unlock request page where visitor enters email address $errors = ''; $email = trim($_POST['aiowps_unlock_request_email']); if (empty($email) || !is_email($email)) { $errors .= '

'.__('Please enter a valid email address','aiowpsecurity').'

'; } if($errors){ $display_form = true; echo '
'.$errors.'
'; echo display_unlock_form($email); }else{ $locked_user = get_user_by('email', $email); if(!$locked_user){ //user with this email does not exist in the system $errors .= '

'.__('User account not found!','aiowpsecurity').'

'; echo '
'.$errors.'
'; }else{ //Process unlock request //Generate a special code and unlock url $ip = AIOWPSecurity_Utility_IP::get_user_ip_address(); //Get the IP address of user $ip_range = AIOWPSecurity_Utility_IP::get_sanitized_ip_range($ip); //Get the IP range of the current user $unlock_url = AIOWPSecurity_User_Login::generate_unlock_request_link($ip_range); if (!$unlock_url){ //No entry found in lockdown table with this IP range $error_msg = '

'.__('Error: No locked entry was found in the DB with your IP address range!','aiowpsecurity').'

'; echo '
'.$error_msg.'
'; }else{ //Send an email to the user AIOWPSecurity_User_Login::send_unlock_request_email($email, $unlock_url); echo '

An email has been sent to you with the unlock instructions.

'; } } $display_form = false; } } ?>
You are here because you have been locked out due to too many incorrect login attempts.

Please enter your email address and you will receive an email with instructions on how to unlock yourself.

' ?>