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