"); } fo_showLoginForm(get_option('prompt_error')); } else { // set cookie if password was validated setcookie(COOKIE_KEY, md5($login.'%'.$supplied_address), 0, parse_url(get_bloginfo('wpurl'),PHP_URL_HOST)); // Clear password protector variables unset($_POST['access_login']); unset($_POST['access_password']); unset($_POST['Submit']); // Send email notifying of SUCCESSFUL login if (get_option('notify_success') && is_email($notify_address[0])) { wp_mail( $notify_address, "[".wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)."] SUCCESS for ".$supplied_address, "Successful login at ".wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)." by ".$supplied_address."\n\nTime: ".date("H:i:s \(\G\M\TP\)")."\nIP: ".$_SERVER['REMOTE_ADDR']." (http://www.ip2location.com/".$_SERVER['REMOTE_ADDR'].")", "From: Friends Only Notification <".get_settings('admin_email').">"); } } } // Check if password cookie is set else { if (!isset($_COOKIE[COOKIE_KEY])) { fo_showLoginForm(""); } } } // This function displays the login form if the user is required to authenticate with the sentry function fo_showLoginForm($error_message) { echo "
"; echo bloginfo('name'); echo "
"; if ($error_message == NULL) { echo get_option('prompt_email'); } else { echo $error_message; } echo "