* welcome.php: added.
[citadel.git] / ctdlphp / do_login.php
1 <?PHP
2
3 // $Id$
4 //
5 // The login form displayed in login.php submits to this page.
6 // 
7 // Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
8 // This program is released under the terms of the GNU General Public License.
9 //
10
11 include "ctdlheader.php";
12
13 bbs_page_header();
14
15 if ($_POST["action"] == "Login") {
16         list($retval, $msg) =
17                 login_existing_user($_POST["user"], $_POST["pass"]);
18 }
19 else if ($_POST["action"] == "New User") {
20         list($retval, $msg) =
21                 create_new_user($_POST["user"], $_POST["pass"]);
22 }
23 else {
24         echo "uuuuhhhhhhhhh....<BR>\n" ;
25 }
26
27
28 if ($retval == FALSE) {
29         echo "<DIV ALIGN=CENTER>", $msg, "<BR><BR>\n" ;
30         echo "<a href=\"login.php\">Try again</A><BR>\n" ;
31         echo "<a href=\"logout.php\">Log out</A><BR>\n" ;
32 }
33 else {
34         echo "<A HREF=\"welcome.php\">Logged in.  Click to continue.</a><BR>";
35         echo "<meta http-equiv=\"refresh\" content=\"0;url=welcome.php\">\n";
36 }
37
38 bbs_page_footer();
39
40 ?>
41