summary refs log tree commit diff stats
path: root/pages/login.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/login.php')
-rwxr-xr-xpages/login.php32
1 files changed, 7 insertions, 25 deletions
diff --git a/pages/login.php b/pages/login.php index 6270502..690a0e8 100755 --- a/pages/login.php +++ b/pages/login.php
@@ -24,38 +24,20 @@ require('headerproc.php');
24 24
25$noMembers=1; 25$noMembers=1;
26 26
27include('includes/recaptchalib.php');
28$publickey = "6LfgvgEAAAAAAG_BJMkWk8sNcT1nBaGoXKJYb-JT";
29$privatekey = "6LfgvgEAAAAAAD0_UVLp57MU7tqcypsbZPS9qTnr";
30
31if (!isset($_GET['submit'])) 27if (!isset($_GET['submit']))
32{ 28{
33 $template = new FITemplate('login'); 29 $template = new FITemplate('login');
34 $template->add('REDIRECT',$_GET['redirect']); 30 $template->add('REDIRECT',$_GET['redirect']);
35
36 $template->add('RECAPTCHA',recaptcha_get_html($publickey));
37} else { 31} else {
38 $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); 32 if (verifyUser($_POST['username'], $_POST['password']))
39 if (!$resp->is_valid)
40 { 33 {
41 $template = new FITemplate('login'); 34 sess_set('uname',$_POST['username']);
42 $template->add('REDIRECT',$_GET['redirect']); 35 header('Location: ' . rawurldecode($_POST['redirect']));
43 $template->adds_block('ERROR',array('msg' => "The reCAPTCHA wasn't entered correctly. Go back and try it again. (reCAPTCHA said: " . $resp->error . ")")); 36 exit;
44
45 $template->add('RECAPTCHA',recaptcha_get_html($publickey));
46 } else { 37 } else {
47 if (verifyUser($_POST['username'], $_POST['password'])) 38 $template = new FITemplate('login');
48 { 39 $template->add('REDIRECT',$_POST['redirect']);
49 sess_set('uname',$_POST['username']); 40 $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."));
50 header('Location: ' . rawurldecode($_POST['redirect']));
51 exit;
52 } else {
53 $template = new FITemplate('login');
54 $template->add('REDIRECT',$_POST['redirect']);
55 $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."));
56
57 $template->add('RECAPTCHA',recaptcha_get_html($publickey));
58 }
59 } 41 }
60} 42}
61 43