add('REDIRECT',$_GET['redirect']); $template->add('RECAPTCHA',recaptcha_get_html($publickey)); } else { $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { $template = new FITemplate('login'); $template->add('REDIRECT',$_GET['redirect']); $template->adds_block('ERROR',array('msg' => "The reCAPTCHA wasn't entered correctly. Go back and try it again. (reCAPTCHA said: " . $resp->error . ")")); $template->add('RECAPTCHA',recaptcha_get_html($publickey)); } else { if (verifyUser($_POST['username'], $_POST['password'])) { sess_set('uname',$_POST['username']); header('Location: ' . rawurldecode($_POST['redirect'])); exit; } else { $template = new FITemplate('login'); $template->add('REDIRECT',$_POST['redirect']); $template->adds_block('ERROR',array('MSG' => "The username/password pair didn't resolve to a real user. Try logging on again, spelling the password right, or making sure you actually have an a account.")); $template->add('RECAPTCHA',recaptcha_get_html($publickey)); } } } $template->display(); ?>