]> git.wh0rd.org Git - tt-rss.git/blob - login_form.php
offline: only force stage to 1 when cidt/cidb are present when stage != 0
[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="lib/prototype.js"></script>
11         <script type="text/javascript" src="lib/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 gotoRegForm() {
47         window.location.href = "register.php";
48         return false;
49 }
50
51 function bwLimitChange(elem) {
52         try {
53                 var limit_set = elem.checked;
54
55                 setCookie("ttrss_bwlimit", limit_set, 
56                         <?php print SESSION_COOKIE_LIFETIME ?>);
57
58         } catch (e) {
59                 exception_error("bwLimitChange", e);
60         }
61 }
62
63 function validateLoginForm(f) {
64         try {
65
66                 if (f.login.value.length == 0) {
67                         new Effect.Highlight(f.login);
68                         return false;
69                 }
70
71                 if (f.password.value.length == 0) {
72                         new Effect.Highlight(f.password);
73                         return false;
74                 }
75
76                 document.forms['loginForm']['click'].disabled = true;
77
78                 return true;
79         } catch (e) {
80                 exception_error("validateLoginForm", e);
81                 return true;
82         }
83 }
84 </script>
85
86 <script type="text/javascript">
87 if (document.addEventListener) {
88         document.addEventListener("DOMContentLoaded", init, null);
89 }
90 window.onload = init;
91 </script>
92
93 <form action="" method="POST" name="loginForm" onsubmit="return validateLoginForm(this)">
94 <input type="hidden" name="login_action" value="do_login">
95
96 <table width="100%" class="loginForm2">
97 <tr>
98         <td class="loginTop" valign="bottom" align="left">
99                 <img src="images/ttrss_logo_big.png" alt="Logo">
100         </td>
101 </tr><tr>
102         <td align="center" valign="middle" class="loginMiddle" height="100%">
103                 <?php if ($_SESSION['login_error_msg']) { ?>
104                         <div class="loginError"><?php echo $_SESSION['login_error_msg'] ?></div>
105                         <?php $_SESSION['login_error_msg'] = ""; ?>
106                 <?php } ?>
107                 <table>
108                         <tr><td align="right"><?php echo __("Login:") ?></td>
109                         <td align="right"><input name="login" 
110                                 value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
111                         <tr><td align="right"><?php echo __("Password:") ?></td>
112                         <td align="right"><input type="password" name="password"
113                                 value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
114                         <?php if (ENABLE_TRANSLATIONS) { ?>
115                         <tr><td align="right"><?php echo __("Language:") ?></td>
116                         <td align="right">
117                         <?php
118                                 print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
119                                         "style='width : 100%' onchange='languageChange(this)'");
120
121                         ?>
122                         </td></tr>
123                         <?php } ?>
124                         <!-- <tr><td colspan="2">
125                                 <input type="checkbox" name="remember_me" id="remember_me">
126                                 <label for="remember_me">Remember me on this computer</label>
127                         </td></tr> -->
128
129                         <tr><td colspan="2" align="right" class="innerLoginCell">
130
131                         <input type="submit" class="button" value="<?php echo __('Log in') ?>" name='click'>
132                         <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
133                                 <input type="submit" class="button" onclick="return gotoRegForm()"
134                                         value="<?php echo __("Create new account") ?>"/>
135                         <?php } ?>
136
137                                 <input type="hidden" name="action" value="login">
138                                 <input type="hidden" name="rt" 
139                                         value="<?php if ($return_to != 'none') { echo $return_to; } ?>">
140                         </td></tr>
141
142                         <tr><td colspan="2" align="right" class="innerLoginCell">
143
144                         <div class="small">
145                         <input name="bw_limit" id="bw_limit" type="checkbox"
146                                 onchange="bwLimitChange(this)">
147                         <label for="bw_limit">
148                         <?php echo __("Limit bandwidth usage") ?></label></div>
149
150                         </td></tr>
151
152
153                 </table>
154         </td>
155 </tr><tr>
156         <td align="center" class="loginBottom">
157                 <a href="http://tt-rss.org/">Tiny Tiny RSS</a> &copy; 2005&ndash;2009 <a href="http://bah.org.ru/">Andrew Dolgov</a>
158         </td>
159 </tr>
160
161 </table>
162
163 </form>
164
165 </body></html>