]> git.wh0rd.org - tt-rss.git/blame - login.php
prefs: further feedlist tweaks (2)
[tt-rss.git] / login.php
CommitLineData
46a1969d
AD
1<?
2 session_start();
3
66581886 4 require_once "sanity_check.php";
46a1969d
AD
5 require_once "version.php";
6 require_once "config.php";
c8437f35 7 require_once "functions.php";
46a1969d 8
75836f33
AD
9 $url_path = get_script_urlpath();
10 $redirect_base = "http://" . $_SERVER["SERVER_NAME"] . $url_path;
11
4585ff0e 12 if (SINGLE_USER_MODE) {
75836f33 13 header("Location: $redirect_base/tt-rss.php");
4585ff0e
AD
14 exit;
15 }
16
c8437f35
AD
17 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
18
19 $login = $_POST["login"];
20 $password = $_POST["password"];
21
22 if ($login && $password) {
23 if (authenticate_user($link, $login, $password)) {
e6cb77a0 24 initialize_user_prefs($link, $_SESSION["uid"]);
f6d0ab14
AD
25
26 if ($_SESSION["login_redirect"]) {
27 $redirect_to = $_SESSION["login_redirect"];
28 } else {
29 $redirect_to = "tt-rss.php";
30 }
75836f33 31 header("Location: $redirect_base/$redirect_to");
c8437f35
AD
32 }
33 }
46a1969d 34
f6d0ab14
AD
35 if ($_GET["rt"]) {
36 $_SESSION["login_redirect"] = $_GET["rt"];
37 }
38
46a1969d
AD
39?>
40<html>
41<head>
42 <title>Tiny Tiny RSS : Login</title>
43 <link rel="stylesheet" type="text/css" href="tt-rss.css">
44 <!--[if gte IE 5.5000]>
45 <script type="text/javascript" src="pngfix.js"></script>
46 <![endif]-->
47 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
48</head>
49
50<body>
51
52<table width='100%' height='100%' class="loginForm">
53
54 <tr><td align='center' valign='middle'>
747976de
AD
55
56 <form action="login.php" method="POST">
46a1969d
AD
57
58 <table class="innerLoginForm">
59
60 <tr><td valign="middle" align="center" colspan="2">
61 <img src="images/ttrss_logo.png" alt="logo">
62 </td></tr>
63
64 <tr><td align="right">Login:</td>
65 <td><input name="login"></td></tr>
66 <tr><td align="right">Password:</td>
67 <td><input type="password" name="password"></td></tr>
c8437f35
AD
68
69 <tr><td colspan="2" align="center">
70 <input type="submit" class="button" value="Login">
71 </td></tr>
46a1969d 72
747976de
AD
73 </table>
74
75 </form>
46a1969d 76
747976de
AD
77 </td></tr>
78</table>
c8437f35
AD
79
80<? db_close($link); ?>
81
46a1969d
AD
82</body>
83</html>