2 require_once "functions.php";
4 require_once "../version.php";
5 require_once "../config.php";
6 require_once "../functions.php";
8 $url_path = get_script_urlpath();
9 $redirect_base = "http://" . $_SERVER["SERVER_NAME"] . $url_path;
11 if (SINGLE_USER_MODE
) {
12 header("Location: $redirect_base/tt-rss.php");
16 $link = db_connect(DB_HOST
, DB_USER
, DB_PASS
, DB_NAME
);
18 $login = $_POST["login"];
19 $password = $_POST["password"];
20 $return_to = $_POST["rt"];
22 if ($_COOKIE[get_session_cookie_name()]) {
23 require_once "../sessions.php";
24 if ($_SESSION["uid"]) {
25 initialize_user_prefs($link, $_SESSION["uid"]);
26 header("Location: $redirect_base/tt-rss.php");
31 if ($login && $password) {
33 if ($_POST["remember_me"]) {
34 session_set_cookie_params(SESSION_COOKIE_LIFETIME_REMEMBER
);
36 session_set_cookie_params(SESSION_COOKIE_LIFETIME
);
39 require_once "../sessions.php";
41 if (authenticate_user($link, $login, $password)) {
42 initialize_user_prefs($link, $_SESSION["uid"]);
44 if ($_POST["remember_me"]) {
45 $_SESSION["cookie_lifetime"] = time() + SESSION_COOKIE_LIFETIME_REMEMBER
;
47 $_SESSION["cookie_lifetime"] = time() + SESSION_COOKIE_LIFETIME
;
50 setcookie("ttrss_cltime", $_SESSION["cookie_lifetime"],
51 $_SESSION["cookie_lifetime"]);
54 $return_to = "tt-rss.php";
56 header("Location: $redirect_base/$return_to");
64 <title
>Tiny Tiny RSS
: Login
</title
>
65 <link rel
="stylesheet" type
="text/css" href
="mobile.css">
66 <meta http
-equiv
="Content-Type" content
="text/html; charset=utf-8">
72 <div id
="heading">Tiny Tiny RSS
</div
>
74 <form action
="login.php" method
="POST">
75 <input type
="hidden" name
="rt" value
="<?= $_GET['rt'] ?>">
78 <tr
><td align
='right'>Login
:</td
><td
><input name
="login"></td
>
79 <tr
><td align
='right'>Password
:</td
><td
><input type
="password" name
="password"></tr
>
82 <input type
="submit" class="button" value
="Login">
83 <input type
="checkbox" name
="remember_me" id
="remember_me">
84 <label
for="remember_me">Remember me
</label
></td
></tr
>
94 <?
db_close($link); ?
>