]> git.wh0rd.org - tt-rss.git/blob - login_form.php
rework feed dialog layouts
[tt-rss.git] / login_form.php
1 <html>
2 <head>
3 <title>Tiny Tiny RSS : Login</title>
4 <link rel="stylesheet" type="text/css" href="tt-rss.css">
5 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
6 <!--[if gte IE 5.5000]>
7 <script type="text/javascript" src="pngfix.js"></script>
8 <![endif]-->
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
10 <script type="text/javascript" src="prototype.js"></script>
11 <script type="text/javascript" src="scriptaculous/scriptaculous.js"></script>
12 <script type="text/javascript" src="functions.js"></script>
13 </head>
14
15 <body>
16
17 <script type="text/javascript">
18 function init() {
19
20 if (arguments.callee.done) return;
21 arguments.callee.done = true;
22
23 var login = document.forms["loginForm"].login;
24
25 var limit_set = getCookie("ttrss_bwlimit");
26
27 if (limit_set == "true") {
28 document.forms["loginForm"].bw_limit.checked = true;
29 }
30
31 login.focus();
32
33 }
34 function languageChange(elem) {
35 try {
36 document.forms['loginForm']['click'].disabled = true;
37
38 var lang = elem[elem.selectedIndex].value;
39 setCookie("ttrss_lang", lang, <?php print SESSION_COOKIE_LIFETIME ?>);
40 window.location.reload();
41 } catch (e) {
42 exception_error("languageChange", e);
43 }
44 }
45
46 function bwLimitChange(elem) {
47 try {
48 var limit_set = elem.checked;
49
50 setCookie("ttrss_bwlimit", limit_set,
51 <?php print SESSION_COOKIE_LIFETIME ?>);
52
53 } catch (e) {
54 exception_error("bwLimitChange", e);
55 }
56 }
57
58 function validateLoginForm(f) {
59 try {
60
61 if (f.login.value.length == 0) {
62 new Effect.Highlight(f.login);
63 return false;
64 }
65
66 if (f.password.value.length == 0) {
67 new Effect.Highlight(f.password);
68 return false;
69 }
70
71 document.forms['loginForm']['click'].disabled = true;
72
73 return true;
74 } catch (e) {
75 exception_error("validateLoginForm", e);
76 return true;
77 }
78 }
79 </script>
80
81 <script type="text/javascript">
82 if (document.addEventListener) {
83 document.addEventListener("DOMContentLoaded", init, null);
84 }
85 window.onload = init;
86 </script>
87
88 <form action="" method="POST" name="loginForm" onsubmit="return validateLoginForm(this)">
89 <input type="hidden" name="login_action" value="do_login">
90
91 <table width="100%" class="loginForm2">
92 <tr>
93 <td class="loginTop" valign="bottom" align="left">
94 <img src="images/ttrss_logo_big.png" alt="Logo">
95 </td>
96 </tr><tr>
97 <td align="center" valign="middle" class="loginMiddle" height="100%">
98 <?php if ($_SESSION['login_error_msg']) { ?>
99 <div class="loginError"><?php echo $_SESSION['login_error_msg'] ?></div>
100 <?php $_SESSION['login_error_msg'] = ""; ?>
101 <?php } ?>
102 <table>
103 <tr><td align="right"><?php echo __("Login:") ?></td>
104 <td align="right"><input name="login"
105 value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
106 <tr><td align="right"><?php echo __("Password:") ?></td>
107 <td align="right"><input type="password" name="password"
108 value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
109 <?php if (ENABLE_TRANSLATIONS) { ?>
110 <tr><td align="right"><?php echo __("Language:") ?></td>
111 <td align="right">
112 <?php
113 print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
114 "style='width : 100%' onchange='languageChange(this)'");
115
116 ?>
117 </td></tr>
118 <?php } ?>
119 <!-- <tr><td colspan="2">
120 <input type="checkbox" name="remember_me" id="remember_me">
121 <label for="remember_me">Remember me on this computer</label>
122 </td></tr> -->
123
124 <tr><td colspan="2" align="right" class="innerLoginCell">
125
126 <?php if (defined('_ENABLE_REGISTRATION')) { ?>
127 <a class="newAcctPrompt" href="register.php">Create new account</a>
128 <?php } ?>
129
130 <input type="submit" class="button" value="<?php echo __('Log in') ?>" name='click'>
131 <input type="hidden" name="action" value="login">
132 <input type="hidden" name="rt"
133 value="<?php if ($return_to != 'none') { echo $return_to; } ?>">
134 </td></tr>
135
136 <tr><td colspan="2" align="right" class="innerLoginCell">
137
138 <div class="small">
139 <input name="bw_limit" id="bw_limit" type="checkbox"
140 onchange="bwLimitChange(this)">
141 <label for="bw_limit">
142 <?php echo __("Limit bandwidth usage") ?></label></div>
143
144 </td></tr>
145
146
147 </table>
148 </td>
149 </tr><tr>
150 <td align="center" class="loginBottom">
151 <a href="http://tt-rss.org/">Tiny Tiny RSS</a> &copy; 2005&ndash;2008 <a href="http://bah.org.ru/">Andrew Dolgov</a>
152 </td>
153 </tr>
154
155 </table>
156
157 </form>
158
159 </body></html>