2 // require_once "sessions.php";
4 require_once "sanity_check.php";
5 require_once "version.php";
6 require_once "config.php";
7 require_once "functions.php";
9 $url_path = get_script_urlpath();
10 $redirect_base = "http://" . $_SERVER["SERVER_NAME"] . $url_path;
12 if (SINGLE_USER_MODE
) {
13 header("Location: $redirect_base/tt-rss.php");
17 $link = db_connect(DB_HOST
, DB_USER
, DB_PASS
, DB_NAME
);
19 $login = $_POST["login"];
20 $password = $_POST["password"];
22 if ($login && $password) {
24 if ($_POST["remember_me"]) {
25 session_set_cookie_params(SESSION_COOKIE_LIFETIME_REMEMBER
);
27 session_set_cookie_params(SESSION_COOKIE_LIFETIME
);
30 require "sessions.php";
32 if (authenticate_user($link, $login, $password)) {
33 initialize_user_prefs($link, $_SESSION["uid"]);
35 if ($_SESSION["login_redirect"]) {
36 $redirect_to = $_SESSION["login_redirect"];
38 $redirect_to = "tt-rss.php";
40 header("Location: $redirect_base/$redirect_to");
45 $_SESSION["login_redirect"] = $_GET["rt"];
51 <title
>Tiny Tiny RSS
: Login
</title
>
52 <link rel
="stylesheet" type
="text/css" href
="tt-rss.css">
53 <!--[if gte IE
5.5000]>
54 <script type
="text/javascript" src
="pngfix.js"></script
>
56 <meta http
-equiv
="Content-Type" content
="text/html; charset=utf-8">
61 <table width
='100%' height
='100%' class="loginForm">
63 <tr
><td align
='center' valign
='middle'>
65 <form action
="login.php" method
="POST">
67 <table
class="innerLoginForm">
69 <tr
><td valign
="middle" align
="center" colspan
="2">
70 <img src
="images/ttrss_logo.png" alt
="logo">
73 <tr
><td align
="right">Login
:</td
>
74 <td
><input name
="login"></td
></tr
>
75 <tr
><td align
="right">Password
:</td
>
76 <td
><input type
="password" name
="password"></td
></tr
>
77 <tr
><td
> 
;</td
><td
>
78 <input type
="checkbox" name
="remember_me" id
="remember_me">
79 <label
for="remember_me">Remember me
</label
>
81 <tr
><td colspan
="2" align
="center">
82 <input type
="submit" class="button" value
="Login">
92 <?
db_close($link); ?
>