root/releases/0.6rc2/login/index.php

Revision 269, 1.7 kB (checked in by ben, 3 years ago)

--

  • Property svn:eol-style set to native
Line 
1 <?php
2
3 require_once(dirname(dirname(__FILE__)).'/includes.php');
4
5 // if we're already logged in, redirect away again.
6 if (logged_on) {
7     $messages[] = gettext("You are already logged on.");
8     define('redirect_url',url . "home.php");
9     $_SESSION['messages'] = $messages;
10     header("Location: " . redirect_url);
11     exit;
12 }
13
14 $l = optional_param('username');
15 $p = optional_param('password');
16
17 if (!empty($l) && !empty($p)) {
18     $ok = authenticate_account($l, md5($p));
19     if ($ok) {
20         $messages[] = gettext("You have been logged on.");
21         define('redirect_url',url . "home.php");
22         $_SESSION['messages'] = $messages;
23         header("Location: " . redirect_url);
24         exit;
25     } else {
26         $messages[] = gettext("Unrecognised username or password. The system could not log you on, or you may not have activated your account.");
27     }
28 } else if (!empty($l) || !empty($p)) { // if ONLY one was entered, make the error message.
29     $messages[] = gettext("Either the username or password were not specified. The system could not log you on.");
30 }
31
32 $body = gettext('Please log in');
33 templates_page_setup();
34 // display the form.
35 echo templates_page_draw( array(
36                                       sitename,
37                                       templates_draw(array(
38                                                            'body' => $body,
39                                                            'title' => gettext('Log On'),
40                                                            'context' => 'contentholder'
41                                                            )
42                                                      )
43                                       )
44          );
45                         
46                         
47 ?>
Note: See TracBrowser for help on using the browser.