diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2008-11-19 17:27:03 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2008-11-19 17:27:03 -0500 |
commit | 24503e3abe705acde2df159aeae61be0d009f92e (patch) | |
tree | 8debbd53dcd0db2f5934c5e2af4e697e3787781d /pages/login.php | |
download | fourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.gz fourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.bz2 fourisland-24503e3abe705acde2df159aeae61be0d009f92e.zip |
Imported sources
Diffstat (limited to 'pages/login.php')
-rw-r--r-- | pages/login.php | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pages/login.php b/pages/login.php new file mode 100644 index 0000000..6270502 --- /dev/null +++ b/pages/login.php | |||
@@ -0,0 +1,64 @@ | |||
1 | <?php | ||
2 | /* | ||
3 | 444444444 | ||
4 | 4::::::::4 | ||
5 | 4:::::::::4 | ||
6 | 4::::44::::4 | ||
7 | 4::::4 4::::4 Four Island | ||
8 | 4::::4 4::::4 | ||
9 | 4::::4 4::::4 Written and maintained by Starla Insigna | ||
10 | 4::::444444::::444 | ||
11 | 4::::::::::::::::4 pages/login.php | ||
12 | 4444444444:::::444 | ||
13 | 4::::4 Please do not use, reproduce or steal the | ||
14 | 4::::4 contents of this file without explicit | ||
15 | 4::::4 permission from Hatkirby. | ||
16 | 44::::::44 | ||
17 | 4::::::::4 | ||
18 | 4444444444 | ||
19 | */ | ||
20 | |||
21 | if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} | ||
22 | |||
23 | require('headerproc.php'); | ||
24 | |||
25 | $noMembers=1; | ||
26 | |||
27 | include('includes/recaptchalib.php'); | ||
28 | $publickey = "6LfgvgEAAAAAAG_BJMkWk8sNcT1nBaGoXKJYb-JT"; | ||
29 | $privatekey = "6LfgvgEAAAAAAD0_UVLp57MU7tqcypsbZPS9qTnr"; | ||
30 | |||
31 | if (!isset($_GET['submit'])) | ||
32 | { | ||
33 | $template = new FITemplate('login'); | ||
34 | $template->add('REDIRECT',$_GET['redirect']); | ||
35 | |||
36 | $template->add('RECAPTCHA',recaptcha_get_html($publickey)); | ||
37 | } else { | ||
38 | $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); | ||
39 | if (!$resp->is_valid) | ||
40 | { | ||
41 | $template = new FITemplate('login'); | ||
42 | $template->add('REDIRECT',$_GET['redirect']); | ||
43 | $template->adds_block('ERROR',array('msg' => "The reCAPTCHA wasn't entered correctly. Go back and try it again. (reCAPTCHA said: " . $resp->error . ")")); | ||
44 | |||
45 | $template->add('RECAPTCHA',recaptcha_get_html($publickey)); | ||
46 | } else { | ||
47 | if (verifyUser($_POST['username'], $_POST['password'])) | ||
48 | { | ||
49 | sess_set('uname',$_POST['username']); | ||
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 | } | ||
60 | } | ||
61 | |||
62 | $template->display(); | ||
63 | |||
64 | ?> | ||