diff options
author | Andrew Dolgov <[email protected]> | 2005-11-18 07:21:24 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-11-18 07:21:24 +0100 |
commit | c8437f35c62f0ad12eee5d4b2ac075c44d7ed2c7 (patch) | |
tree | 6b8c41f78785dc2ff6a35c09fa600b82597cf400 /login.php | |
parent | 1c7f75ed2c8e0c914bba2134158e483aa1c3af40 (diff) |
optional login form/http basic auth support
Diffstat (limited to 'login.php')
-rw-r--r-- | login.php | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -3,9 +3,18 @@ require_once "version.php"; require_once "config.php"; + require_once "functions.php"; - $_SESSION["uid"] = PLACEHOLDER_UID; // FIXME: placeholder - $_SESSION["name"] = PLACEHOLDER_NAME; + $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); + + $login = $_POST["login"]; + $password = $_POST["password"]; + + if ($login && $password) { + if (authenticate_user($link, $login, $password)) { + header("Location: tt-rss.php"); + } + } ?> <html> @@ -20,6 +29,8 @@ <body> +<form action="login.php" method="POST"> + <table width='100%' height='100%' class="loginForm"> <tr><td align='center' valign='middle'> @@ -34,9 +45,17 @@ <td><input name="login"></td></tr> <tr><td align="right">Password:</td> <td><input type="password" name="password"></td></tr> + + <tr><td colspan="2" align="center"> + <input type="submit" class="button" value="Login"> + </td></tr> </table></td></tr> </table> +</form> + +<? db_close($link); ?> + </body> </html> |