summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xpages/login.php32
-rwxr-xr-xtheme/login.tpl7
2 files changed, 10 insertions, 29 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
diff --git a/theme/login.tpl b/theme/login.tpl index f175f59..7f83045 100755 --- a/theme/login.tpl +++ b/theme/login.tpl
@@ -9,10 +9,9 @@ To post feedback on this site, and also to post on the forums, you must be a mem
9Sadly, currently membership is invitation-only. But hopefully that will change in the near future.<BR> 9Sadly, currently membership is invitation-only. But hopefully that will change in the near future.<BR>
10HOWEVER, you may request membership by email hatkirby@fourisland.com (link on the right).<BR> 10HOWEVER, you may request membership by email hatkirby@fourisland.com (link on the right).<BR>
11A NOTICE TO ALL MEMBERS! Do NOT share your password with anyone! If you misplace your password send an email to hatkirby@fourisland.com (link on the right).<P> 11A NOTICE TO ALL MEMBERS! Do NOT share your password with anyone! If you misplace your password send an email to hatkirby@fourisland.com (link on the right).<P>
12<FORM ACTION="login.php?submit=" METHOD="POST"> 12<FORM ACTION="login.php?submit=" METHOD="POST">
13 <LABEL FOR="username">Username:</LABEL><INPUT TYPE="text" NAME="username" ID="username"><BR> 13 <LABEL FOR="username">Username:</LABEL><INPUT TYPE="text" NAME="username" ID="username"><BR>
14 <LABEL FOR="password">Password:</LABEL><INPUT TYPE="password" NAME="password" ID="password"><BR> 14 <LABEL FOR="password">Password:</LABEL><INPUT TYPE="password" NAME="password" ID="password"><BR>
15 <!--RECAPTCHA--> 15 <INPUT TYPE="hidden" NAME="redirect" VALUE="<!--REDIRECT-->">
16 <INPUT TYPE="hidden" NAME="redirect" VALUE="<!--REDIRECT-->">
17 <INPUT TYPE="submit"> 16 <INPUT TYPE="submit">
18</FORM></CENTER> 17</FORM></CENTER>