-<?
+<?php
// require_once "sessions.php";
require_once "sanity_check.php";
$error_msg = "";
$url_path = get_script_urlpath();
+ $return_to = $_REQUEST["rt"];
if (ENABLE_LOGIN_SSL) {
$redirect_base = "https://" . $_SERVER["SERVER_NAME"] . $url_path;
$redirect_base = "http://" . $_SERVER["SERVER_NAME"] . $url_path;
}
- if (SINGLE_USER_MODE) {
+ if (SINGLE_USER_MODE && $return_to != "none") {
header("Location: $redirect_base/tt-rss.php");
exit;
}
$login = $_POST["login"];
$password = $_POST["password"];
- $return_to = $_POST["rt"];
+ $action = $_POST["action"];
- if ($_COOKIE[get_session_cookie_name()]) {
+ if ($_COOKIE[get_session_cookie_name()] && $return_to != "none") {
require_once "sessions.php";
if ($_SESSION["uid"]) {
initialize_user_prefs($link, $_SESSION["uid"]);
} else {
$error_msg = "Error: Unable to authenticate user. Please check login and password.";
}
- } else {
+ } else if ($action) {
$error_msg = "Error: Either login or password is blank.";
}
<head>
<title>Tiny Tiny RSS : Login</title>
<link rel="stylesheet" type="text/css" href="tt-rss.css">
+ <link rel="shortcut icon" type="image/png" href="images/favicon.png">
<!--[if gte IE 5.5000]>
<script type="text/javascript" src="pngfix.js"></script>
<![endif]-->
</td>
</tr><tr>
<td align="center" valign="middle" class="loginMiddle" height="100%">
- <? if ($error_msg) { ?>
- <div class="loginError"><?= $error_msg ?></div>
- <? } ?>
+ <?php if ($error_msg) { ?>
+ <div class="loginError"><?php echo $error_msg ?></div>
+ <?php } ?>
<table>
<tr><td align="right">Login:</td>
- <td><input name="login"></td></tr>
+ <td align="right"><input name="login"></td></tr>
<tr><td align="right">Password:</td>
- <td><input type="password" name="password"></td></tr>
+ <td align="right"><input type="password" name="password"></td></tr>
<tr><td colspan="2">
<input type="checkbox" name="remember_me" id="remember_me">
<label for="remember_me">Remember me on this computer</label>
</td></tr>
- <tr><td colspan="2" align="right">
+ <tr><td colspan="2" align="right" class="innerLoginCell">
<input type="submit" class="button" value="Login">
- <input type="hidden" name="rt" value="<?= $_GET['rt'] ?>">
+ <input type="hidden" name="action" value="login">
+ <input type="hidden" name="rt"
+ value="<?php if ($return_to != 'none') { echo $return_to; } ?>">
</td></tr>
</table>
</td>
</tr><tr>
<td align="center" class="loginBottom">
- <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> © 2005-2006 Andrew Dolgov
- <? if (WEB_DEMO_MODE) { ?>
- <br>Running in demo mode, some functionality is disabled.
- <? } ?>
+ <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> © 2005-2007 <a href="http://bah.org.ru/">Andrew Dolgov</a>
</td>
</tr>
</form>
-<? db_close($link); ?>
+<?php db_close($link); ?>
<script type="text/javascript">
/* for IE */