]>
Commit | Line | Data |
---|---|---|
1 | <html> | |
2 | <head> | |
3 | <title>Tiny Tiny RSS : Login</title> | |
4 | <link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/> | |
5 | <link rel="stylesheet" type="text/css" href="tt-rss.css"> | |
6 | <link rel="shortcut icon" type="image/png" href="images/favicon.png"> | |
7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
8 | <script type="text/javascript" src="lib/dojo/dojo.js"></script> | |
9 | <script type="text/javascript" src="lib/dijit/dijit.js"></script> | |
10 | <script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script> | |
11 | <script type="text/javascript" src="lib/prototype.js"></script> | |
12 | <script type="text/javascript" src="js/functions.js"></script> | |
13 | <script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script> | |
14 | <script type="text/javascript"> | |
15 | Event.observe(window, 'load', function() { | |
16 | init(); | |
17 | }); | |
18 | </script> | |
19 | <style type="text/css"> | |
20 | body#ttrssLogin { | |
21 | padding : 2em; | |
22 | font-size : 14px; | |
23 | } | |
24 | ||
25 | fieldset { | |
26 | margin-left : auto; | |
27 | margin-right : auto; | |
28 | display : block; | |
29 | width : 400px; | |
30 | border-width : 0px; | |
31 | } | |
32 | ||
33 | input.input { | |
34 | font-family : sans-serif; | |
35 | font-size : medium; | |
36 | border-spacing : 2px; | |
37 | border : 1px solid #b5bcc7; | |
38 | padding : 2px; | |
39 | } | |
40 | ||
41 | label { | |
42 | width : 120px; | |
43 | margin-right : 20px; | |
44 | display : inline-block; | |
45 | text-align : right; | |
46 | color : gray; | |
47 | } | |
48 | ||
49 | div.header { | |
50 | border-width : 0px 0px 1px 0px; | |
51 | border-style : solid; | |
52 | border-color : #88b0f0; | |
53 | margin-bottom : 1em; | |
54 | padding-bottom : 5px; | |
55 | } | |
56 | ||
57 | div.footer { | |
58 | margin-top : 1em; | |
59 | padding-top : 5px; | |
60 | border-width : 1px 0px 0px 0px; | |
61 | border-style : solid; | |
62 | border-color : #88b0f0; | |
63 | text-align : center; | |
64 | color : gray; | |
65 | font-size : 12px; | |
66 | } | |
67 | ||
68 | a.forgotpass { | |
69 | text-align : right; | |
70 | font-size : 11px; | |
71 | display : inline-block; | |
72 | } | |
73 | ||
74 | a { | |
75 | color : #4684ff; | |
76 | } | |
77 | ||
78 | a:hover { | |
79 | color : black; | |
80 | } | |
81 | ||
82 | div.footer a { | |
83 | color : gray; | |
84 | } | |
85 | ||
86 | div.footer a:hover { | |
87 | color : #88b0f0; | |
88 | } | |
89 | ||
90 | div.row { | |
91 | padding : 0px 0px 5px 0px; | |
92 | } | |
93 | ||
94 | div.row-error { | |
95 | color : red; | |
96 | text-align : center; | |
97 | padding : 0px 0px 5px 0px; | |
98 | } | |
99 | ||
100 | </style> | |
101 | </head> | |
102 | ||
103 | <body id="ttrssLogin" class="claro"> | |
104 | ||
105 | <script type="text/javascript"> | |
106 | function init() { | |
107 | dojo.require("dijit.form.Button"); | |
108 | dojo.require("dijit.form.CheckBox"); | |
109 | dojo.require("dijit.form.Form"); | |
110 | dojo.require("dijit.form.Select"); | |
111 | dojo.require("dijit.form.TextBox"); | |
112 | dojo.require("dijit.form.ValidationTextBox"); | |
113 | ||
114 | dojo.parser.parse(); | |
115 | ||
116 | fetchProfiles(); | |
117 | ||
118 | dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true'); | |
119 | ||
120 | document.forms.loginForm.login.focus(); | |
121 | } | |
122 | ||
123 | function fetchProfiles() { | |
124 | try { | |
125 | var query = "op=getProfiles&login=" + param_escape(document.forms["loginForm"].login.value); | |
126 | ||
127 | if (query) { | |
128 | new Ajax.Request("public.php", { | |
129 | parameters: query, | |
130 | onComplete: function(transport) { | |
131 | if (transport.responseText.match("select")) { | |
132 | $('profile_box').innerHTML = transport.responseText; | |
133 | dojo.parser.parse('profile_box'); | |
134 | } | |
135 | } }); | |
136 | } | |
137 | ||
138 | } catch (e) { | |
139 | exception_error("fetchProfiles", e); | |
140 | } | |
141 | } | |
142 | ||
143 | ||
144 | function gotoRegForm() { | |
145 | window.location.href = "register.php"; | |
146 | return false; | |
147 | } | |
148 | ||
149 | function bwLimitChange(elem) { | |
150 | try { | |
151 | var limit_set = elem.checked; | |
152 | ||
153 | setCookie("ttrss_bwlimit", limit_set, | |
154 | <?php print SESSION_COOKIE_LIFETIME ?>); | |
155 | ||
156 | } catch (e) { | |
157 | exception_error("bwLimitChange", e); | |
158 | } | |
159 | } | |
160 | </script> | |
161 | ||
162 | <?php $return = urlencode($_SERVER["REQUEST_URI"]) ?> | |
163 | ||
164 | <form action="public.php?return=<?php echo $return ?>" | |
165 | dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm"> | |
166 | ||
167 | <input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login"> | |
168 | ||
169 | <div class='header'> | |
170 | <img src="images/logo_wide.png"> | |
171 | </div> | |
172 | ||
173 | <div class='form'> | |
174 | ||
175 | <fieldset> | |
176 | <?php if ($_SESSION["login_error_msg"]) { ?> | |
177 | <div class="row-error"> | |
178 | <?php echo $_SESSION["login_error_msg"] ?> | |
179 | </div> | |
180 | <?php $_SESSION["login_error_msg"] = ""; ?> | |
181 | <?php } ?> | |
182 | <div class="row"> | |
183 | <label><?php echo __("Login:") ?></label> | |
184 | <input name="login" class="input" | |
185 | onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()" | |
186 | style="width : 220px" | |
187 | required="1" | |
188 | value="<?php echo $_SESSION["fake_login"] ?>" /> | |
189 | </div> | |
190 | ||
191 | <div class="row"> | |
192 | <label><?php echo __("Password:") ?></label> | |
193 | <input type="password" name="password" required="1" | |
194 | style="width : 220px" class="input" | |
195 | value="<?php echo $_SESSION["fake_password"] ?>"/> | |
196 | <label></label> | |
197 | <a class='forgotpass' href="public.php?op=forgotpass"><?php echo __("I forgot my password") ?></a> | |
198 | </div> | |
199 | ||
200 | <div class="row"> | |
201 | <label><?php echo __("Language:") ?></label> | |
202 | <?php | |
203 | print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(), | |
204 | "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'"); | |
205 | ?> | |
206 | </div> | |
207 | ||
208 | <div class="row"> | |
209 | <label><?php echo __("Profile:") ?></label> | |
210 | ||
211 | <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select' | |
212 | style='width : 220px; margin : 0px'> | |
213 | <option><?php echo __("Default profile") ?></option></select></span> | |
214 | ||
215 | </div> | |
216 | ||
217 | <div class="row"> | |
218 | <label> </label> | |
219 | <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox" | |
220 | onchange="bwLimitChange(this)"> | |
221 | <label style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label> | |
222 | </div> | |
223 | ||
224 | <?php if (SESSION_COOKIE_LIFETIME > 0) { ?> | |
225 | ||
226 | <div class="row"> | |
227 | <label> </label> | |
228 | <input dojoType="dijit.form.CheckBox" name="remember_me" id="remember_me" type="checkbox"> | |
229 | <label style='display : inline' for="remember_me"><?php echo __("Remember me") ?></label> | |
230 | </div> | |
231 | ||
232 | <?php } ?> | |
233 | ||
234 | <div class="row" style='text-align : right'> | |
235 | <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button> | |
236 | <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?> | |
237 | <button onclick="return gotoRegForm()" dojoType="dijit.form.Button"> | |
238 | <?php echo __("Create new account") ?></button> | |
239 | <?php } ?> | |
240 | </div> | |
241 | ||
242 | </fieldset> | |
243 | ||
244 | ||
245 | </div> | |
246 | ||
247 | <div class='footer'> | |
248 | <a href="http://tt-rss.org/">Tiny Tiny RSS</a> | |
249 | <?php if (!defined('HIDE_VERSION')) { ?> | |
250 | v<?php echo VERSION ?> | |
251 | <?php } ?> | |
252 | © 2005–<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a> | |
253 | </div> | |
254 | ||
255 | </form> | |
256 | ||
257 | </body></html> |