ttrss/login_form.php

163 lines
4.3 KiB
PHP
Raw Normal View History

2007-03-01 09:43:54 +00:00
<html>
<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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="lib/prototype.js"></script>
2009-01-22 13:36:04 +00:00
<script type="text/javascript" src="lib/scriptaculous/scriptaculous.js"></script>
<script type="text/javascript" src="functions.js"></script>
2007-03-01 09:43:54 +00:00
</head>
<body>
<script type="text/javascript">
function init() {
if (arguments.callee.done) return;
arguments.callee.done = true;
var login = document.forms["loginForm"].login;
var limit_set = getCookie("ttrss_bwlimit");
if (limit_set == "true") {
document.forms["loginForm"].bw_limit.checked = true;
}
2007-03-01 09:43:54 +00:00
login.focus();
}
function languageChange(elem) {
try {
document.forms['loginForm']['click'].disabled = true;
var lang = elem[elem.selectedIndex].value;
setCookie("ttrss_lang", lang, <?php print SESSION_COOKIE_LIFETIME ?>);
window.location.reload();
} catch (e) {
exception_error("languageChange", e);
}
}
2007-08-20 05:10:03 +00:00
function gotoRegForm() {
window.location.href = "register.php";
return false;
}
function bwLimitChange(elem) {
try {
var limit_set = elem.checked;
setCookie("ttrss_bwlimit", limit_set,
<?php print SESSION_COOKIE_LIFETIME ?>);
} catch (e) {
exception_error("bwLimitChange", e);
}
}
2007-08-20 05:10:03 +00:00
function validateLoginForm(f) {
try {
if (f.login.value.length == 0) {
new Effect.Highlight(f.login);
return false;
}
if (f.password.value.length == 0) {
new Effect.Highlight(f.password);
return false;
}
document.forms['loginForm']['click'].disabled = true;
2007-08-20 05:10:03 +00:00
return true;
} catch (e) {
exception_error("validateLoginForm", e);
return true;
}
}
2007-03-01 09:43:54 +00:00
</script>
<script type="text/javascript">
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", init, null);
}
window.onload = init;
</script>
2007-08-20 05:10:03 +00:00
<form action="" method="POST" name="loginForm" onsubmit="return validateLoginForm(this)">
2007-03-01 09:43:54 +00:00
<input type="hidden" name="login_action" value="do_login">
<table width="100%" class="loginForm2">
<tr>
<td class="loginTop" valign="bottom" align="left">
<img src="images/ttrss_logo_big.png" alt="Logo">
</td>
</tr><tr>
<td align="center" valign="middle" class="loginMiddle" height="100%">
2007-03-02 10:48:46 +00:00
<?php if ($_SESSION['login_error_msg']) { ?>
<div class="loginError"><?php echo $_SESSION['login_error_msg'] ?></div>
<?php $_SESSION['login_error_msg'] = ""; ?>
2007-03-01 09:43:54 +00:00
<?php } ?>
<table>
2007-03-05 12:50:46 +00:00
<tr><td align="right"><?php echo __("Login:") ?></td>
<td align="right"><input name="login"
value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
2007-03-05 12:50:46 +00:00
<tr><td align="right"><?php echo __("Password:") ?></td>
<td align="right"><input type="password" name="password"
value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
<?php if (ENABLE_TRANSLATIONS) { ?>
2007-08-11 14:25:51 +00:00
<tr><td align="right"><?php echo __("Language:") ?></td>
<td align="right">
<?php
print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
"style='width : 100%' onchange='languageChange(this)'");
2007-08-11 14:25:51 +00:00
?>
</td></tr>
<?php } ?>
2007-03-02 11:05:17 +00:00
<!-- <tr><td colspan="2">
2007-03-01 09:43:54 +00:00
<input type="checkbox" name="remember_me" id="remember_me">
<label for="remember_me">Remember me on this computer</label>
2007-03-02 11:05:17 +00:00
</td></tr> -->
2007-03-01 09:43:54 +00:00
<tr><td colspan="2" align="right" class="innerLoginCell">
2010-01-12 15:50:08 +00:00
<button name='click'><?php echo __('Log in') ?></button>
<?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
2010-01-12 15:50:08 +00:00
<button onclick="return gotoRegForm()">
<?php echo __("Create new account") ?></button>
<?php } ?>
2007-03-01 09:43:54 +00:00
<input type="hidden" name="action" value="login">
<input type="hidden" name="rt"
value="<?php if ($return_to != 'none') { echo $return_to; } ?>">
</td></tr>
<tr><td colspan="2" align="right" class="innerLoginCell">
<div class="small">
<input name="bw_limit" id="bw_limit" type="checkbox"
onchange="bwLimitChange(this)">
<label for="bw_limit">
2008-06-24 07:50:30 +00:00
<?php echo __("Limit bandwidth usage") ?></label></div>
</td></tr>
2007-03-01 09:43:54 +00:00
</table>
</td>
</tr><tr>
<td align="center" class="loginBottom">
2010-01-13 10:48:37 +00:00
<a href="http://tt-rss.org/">Tiny Tiny RSS</a> &copy; 2005&ndash;2010 <a href="http://bah.org.ru/">Andrew Dolgov</a>
2007-03-01 09:43:54 +00:00
</td>
</tr>
</table>
</form>
2007-11-17 07:25:37 +00:00
</body></html>