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