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