]>
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 | |
c82c2aa4 AD |
41 | input.input { |
42 | font-family : sans-serif; | |
43 | font-size : medium; | |
44 | border-spacing : 2px; | |
45 | border : 1px solid #b5bcc7; | |
46 | padding : 2px; | |
47 | } | |
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; | |
60 | border-color : #88b0f0; | |
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; | |
70 | border-color : #88b0f0; | |
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 { | |
83 | color : #4684ff; | |
84 | } | |
85 | ||
86 | a:hover { | |
87 | color : black; | |
88 | } | |
89 | ||
675f198a AD |
90 | div.footer a { |
91 | color : gray; | |
68535211 AD |
92 | } |
93 | ||
675f198a AD |
94 | div.footer a:hover { |
95 | color : #88b0f0; | |
96 | } | |
a598370d | 97 | |
675f198a AD |
98 | div.row { |
99 | padding : 0px 0px 5px 0px; | |
a598370d | 100 | } |
eeee2ccf AD |
101 | |
102 | div.row-error { | |
103 | color : red; | |
104 | text-align : center; | |
105 | padding : 0px 0px 5px 0px; | |
106 | } | |
107 | ||
675f198a AD |
108 | </style> |
109 | </head> | |
a598370d | 110 | |
675f198a AD |
111 | <body id="ttrssLogin" class="claro"> |
112 | ||
113 | <script type="text/javascript"> | |
114 | function init() { | |
675f198a | 115 | |
44bf49d4 | 116 | require(['dojo/parser','dijit/form/Button','dijit/form/CheckBox','dijit/form/Form', |
117 | 'dijit/form/Select','dijit/form/TextBox','dijit/form/ValidationTextBox'],function(parser){ | |
118 | parser.parse(); | |
67e0cf9a | 119 | //show tooltip node only after this widget is instaniated. |
44bf49d4 | 120 | dojo.query('div[dojoType="dijit.Tooltip"]').style({ |
121 | display:'' | |
122 | }); | |
123 | fetchProfiles(); | |
124 | dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true'); | |
125 | document.forms.loginForm.login.focus(); | |
67e0cf9a | 126 | }); |
97acbaf1 | 127 | |
01a87dff | 128 | } |
0456176a | 129 | |
d9084cf2 AD |
130 | function fetchProfiles() { |
131 | try { | |
8f2ad8e1 | 132 | var query = "op=getProfiles&login=" + param_escape(document.forms["loginForm"].login.value); |
7b26a148 | 133 | |
d9084cf2 | 134 | if (query) { |
5334e1ec | 135 | new Ajax.Request("public.php", { |
d9084cf2 | 136 | parameters: query, |
97acbaf1 AD |
137 | onComplete: function(transport) { |
138 | if (transport.responseText.match("select")) { | |
139 | $('profile_box').innerHTML = transport.responseText; | |
675f198a | 140 | dojo.parser.parse('profile_box'); |
97acbaf1 AD |
141 | } |
142 | } }); | |
d9084cf2 AD |
143 | } |
144 | ||
145 | } catch (e) { | |
146 | exception_error("fetchProfiles", e); | |
147 | } | |
148 | } | |
149 | ||
150 | ||
0136468d AD |
151 | function gotoRegForm() { |
152 | window.location.href = "register.php"; | |
153 | return false; | |
154 | } | |
155 | ||
a598370d AD |
156 | function bwLimitChange(elem) { |
157 | try { | |
158 | var limit_set = elem.checked; | |
159 | ||
7b26a148 | 160 | setCookie("ttrss_bwlimit", limit_set, |
a598370d AD |
161 | <?php print SESSION_COOKIE_LIFETIME ?>); |
162 | ||
163 | } catch (e) { | |
164 | exception_error("bwLimitChange", e); | |
165 | } | |
166 | } | |
675f198a | 167 | </script> |
a598370d | 168 | |
675f198a | 169 | <?php $return = urlencode($_SERVER["REQUEST_URI"]) ?> |
ec6b7ada | 170 | |
675f198a AD |
171 | <form action="public.php?return=<?php echo $return ?>" |
172 | dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm"> | |
ec6b7ada | 173 | |
675f198a | 174 | <input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login"> |
ec6b7ada | 175 | |
675f198a AD |
176 | <div class='header'> |
177 | <img src="images/logo_wide.png"> | |
178 | </div> | |
a0b9990a | 179 | |
675f198a | 180 | <div class='form'> |
01a87dff | 181 | |
675f198a | 182 | <fieldset> |
eeee2ccf AD |
183 | <?php if ($_SESSION["login_error_msg"]) { ?> |
184 | <div class="row-error"> | |
185 | <?php echo $_SESSION["login_error_msg"] ?> | |
186 | </div> | |
187 | <?php $_SESSION["login_error_msg"] = ""; ?> | |
188 | <?php } ?> | |
675f198a AD |
189 | <div class="row"> |
190 | <label><?php echo __("Login:") ?></label> | |
c82c2aa4 | 191 | <input name="login" class="input" |
97acbaf1 | 192 | onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()" |
eeee2ccf | 193 | style="width : 220px" |
c82c2aa4 | 194 | required="1" |
675f198a AD |
195 | value="<?php echo $_SESSION["fake_login"] ?>" /> |
196 | </div> | |
197 | ||
3921f508 | 198 | |
675f198a AD |
199 | <div class="row"> |
200 | <label><?php echo __("Password:") ?></label> | |
c82c2aa4 AD |
201 | <input type="password" name="password" required="1" |
202 | style="width : 220px" class="input" | |
675f198a | 203 | value="<?php echo $_SESSION["fake_password"] ?>"/> |
f43e9e97 | 204 | <label></label> |
13db181d | 205 | <?php if (strpos(PLUGINS, "auth_internal") !== FALSE) { ?> |
f43e9e97 | 206 | <a class='forgotpass' href="public.php?op=forgotpass"><?php echo __("I forgot my password") ?></a> |
13db181d | 207 | <?php } ?> |
675f198a AD |
208 | </div> |
209 | ||
3921f508 | 210 | |
675f198a AD |
211 | <div class="row"> |
212 | <label><?php echo __("Profile:") ?></label> | |
d9084cf2 | 213 | |
eeee2ccf AD |
214 | <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select' |
215 | style='width : 220px; margin : 0px'> | |
675f198a | 216 | <option><?php echo __("Default profile") ?></option></select></span> |
d9084cf2 | 217 | |
675f198a | 218 | </div> |
4fc1580a | 219 | |
675f198a AD |
220 | <div class="row"> |
221 | <label> </label> | |
222 | <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox" | |
223 | onchange="bwLimitChange(this)"> | |
a62337b3 AD |
224 | <label id="bw_limit_label" style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label> |
225 | </div> | |
226 | ||
44bf49d4 | 227 | <div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below" style="display:none"> |
a62337b3 | 228 | <?php echo __("Does not display images in articles, reduces automatic refreshes."); ?> |
675f198a AD |
229 | </div> |
230 | ||
aadd636a | 231 | <?php if (SESSION_COOKIE_LIFETIME > 0) { ?> |
f231f438 AD |
232 | |
233 | <div class="row"> | |
234 | <label> </label> | |
235 | <input dojoType="dijit.form.CheckBox" name="remember_me" id="remember_me" type="checkbox"> | |
236 | <label style='display : inline' for="remember_me"><?php echo __("Remember me") ?></label> | |
237 | </div> | |
238 | ||
239 | <?php } ?> | |
240 | ||
675f198a AD |
241 | <div class="row" style='text-align : right'> |
242 | <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button> | |
4f7956b3 | 243 | <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?> |
675f198a | 244 | <button onclick="return gotoRegForm()" dojoType="dijit.form.Button"> |
2ec990ab | 245 | <?php echo __("Create new account") ?></button> |
4fc1580a | 246 | <?php } ?> |
675f198a | 247 | </div> |
4fc1580a | 248 | |
675f198a | 249 | </fieldset> |
a598370d | 250 | |
a598370d | 251 | |
675f198a | 252 | </div> |
a598370d | 253 | |
675f198a | 254 | <div class='footer'> |
ce72cb95 | 255 | <a href="http://tt-rss.org/">Tiny Tiny RSS</a> |
ce72cb95 | 256 | © 2005–<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a> |
675f198a | 257 | </div> |
01a87dff AD |
258 | |
259 | </form> | |
260 | ||
5a68dec1 | 261 | </body></html> |