aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/login.php
diff options
context:
space:
mode:
authorJames Atkinson <thefinn@users.sourceforge.net>2001-02-25 22:24:17 +0000
committerJames Atkinson <thefinn@users.sourceforge.net>2001-02-25 22:24:17 +0000
commit83b6163b4b75b7d06178dbf43719dbb1be1392d1 (patch)
treed9282fe685e4576ca054db212ec6bedfa90e2ed1 /phpBB/login.php
parent9bb944225afee2a39eb03827d805df17acfc77ec (diff)
downloadforums-83b6163b4b75b7d06178dbf43719dbb1be1392d1.tar
forums-83b6163b4b75b7d06178dbf43719dbb1be1392d1.tar.gz
forums-83b6163b4b75b7d06178dbf43719dbb1be1392d1.tar.bz2
forums-83b6163b4b75b7d06178dbf43719dbb1be1392d1.tar.xz
forums-83b6163b4b75b7d06178dbf43719dbb1be1392d1.zip
Added login/logout file and logic to login a user
git-svn-id: file:///svn/phpbb/trunk@65 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/login.php')
-rw-r--r--phpBB/login.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/phpBB/login.php b/phpBB/login.php
new file mode 100644
index 0000000000..801782941f
--- /dev/null
+++ b/phpBB/login.php
@@ -0,0 +1,57 @@
+<?php
+/***************************************************************************
+ * login.php
+ * -------------------
+ * begin : Saturday, Feb 13, 2001
+ * copyright : (C) 2001 The phpBB Group
+ * email : support@phpbb.com
+ *
+ * $Id$
+ *
+ *
+ ***************************************************************************/
+
+
+/***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ *
+ ***************************************************************************/
+include('extension.inc');
+include('common.'.$phpEx);
+
+if($submit)
+{
+ $userdata = get_userdata($username, $db);
+ if($userdata["error"])
+ {
+ error_die($db, LOGIN_FAILED);
+ }
+ else
+ {
+ if(!auth("login", $db))
+ {
+ error_die($db, LOGIN_FAILED);
+ }
+ else
+ {
+ $sessid = new_session($userdata[user_id], USER_IP, $session_cookie_time, $db);
+ set_session_cookie($sessid, $session_cookie_time, $session_cookie, "", "", 0);
+ header("Location: index.$phpEx");
+ }
+ }
+}
+else if($logout)
+{
+ if($user_logged_in)
+ {
+ end_user_session($userdata["user_id"], $db);
+ }
+ header("Location: index.$phpEx");
+}
+
+?>