]> git.wh0rd.org - tt-rss.git/blob - include/login_form.php
@FIXED dijit modules aren't cached even all the js files are compressed
[tt-rss.git] / include / login_form.php
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="css/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/dojo/tt-rss-layer.js"></script>
10 <script type="text/javascript" src="lib/prototype.js"></script>
11 <script type="text/javascript" src="js/functions.js"></script>
12 <script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script>
13 <script type="text/javascript">
14 require({cache:{}});
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
108 require(['dojo/parser','dijit/form/Button','dijit/form/CheckBox','dijit/form/Form',
109 'dijit/form/Select','dijit/form/TextBox','dijit/form/ValidationTextBox'],function(parser){
110 parser.parse();
111 //show tooltip node only after this widget is instaniated.
112 dojo.query('div[dojoType="dijit.Tooltip"]').style({
113 display:''
114 });
115 fetchProfiles();
116 dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
117 document.forms.loginForm.login.focus();
118 });
119
120 }
121
122 function fetchProfiles() {
123 try {
124 var query = "op=getProfiles&login=" + param_escape(document.forms["loginForm"].login.value);
125
126 if (query) {
127 new Ajax.Request("public.php", {
128 parameters: query,
129 onComplete: function(transport) {
130 if (transport.responseText.match("select")) {
131 $('profile_box').innerHTML = transport.responseText;
132 dojo.parser.parse('profile_box');
133 }
134 } });
135 }
136
137 } catch (e) {
138 exception_error("fetchProfiles", e);
139 }
140 }
141
142
143 function gotoRegForm() {
144 window.location.href = "register.php";
145 return false;
146 }
147
148 function bwLimitChange(elem) {
149 try {
150 var limit_set = elem.checked;
151
152 setCookie("ttrss_bwlimit", limit_set,
153 <?php print SESSION_COOKIE_LIFETIME ?>);
154
155 } catch (e) {
156 exception_error("bwLimitChange", e);
157 }
158 }
159 </script>
160
161 <?php $return = urlencode($_SERVER["REQUEST_URI"]) ?>
162
163 <form action="public.php?return=<?php echo $return ?>"
164 dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm">
165
166 <input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login">
167
168 <div class='header'>
169 <img src="images/logo_wide.png">
170 </div>
171
172 <div class='form'>
173
174 <fieldset>
175 <?php if ($_SESSION["login_error_msg"]) { ?>
176 <div class="row-error">
177 <?php echo $_SESSION["login_error_msg"] ?>
178 </div>
179 <?php $_SESSION["login_error_msg"] = ""; ?>
180 <?php } ?>
181 <div class="row">
182 <label><?php echo __("Login:") ?></label>
183 <input name="login" class="input"
184 onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()"
185 style="width : 220px"
186 required="1"
187 value="<?php echo $_SESSION["fake_login"] ?>" />
188 </div>
189
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 <?php if (strpos(PLUGINS, "auth_internal") !== FALSE) { ?>
198 <a class='forgotpass' href="public.php?op=forgotpass"><?php echo __("I forgot my password") ?></a>
199 <?php } ?>
200 </div>
201
202
203 <div class="row">
204 <label><?php echo __("Profile:") ?></label>
205
206 <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select'
207 style='width : 220px; margin : 0px'>
208 <option><?php echo __("Default profile") ?></option></select></span>
209
210 </div>
211
212 <div class="row">
213 <label>&nbsp;</label>
214 <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox"
215 onchange="bwLimitChange(this)">
216 <label id="bw_limit_label" style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
217 </div>
218
219 <div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below" style="display:none">
220 <?php echo __("Does not display images in articles, reduces automatic refreshes."); ?>
221 </div>
222
223 <?php if (SESSION_COOKIE_LIFETIME > 0) { ?>
224
225 <div class="row">
226 <label>&nbsp;</label>
227 <input dojoType="dijit.form.CheckBox" name="remember_me" id="remember_me" type="checkbox">
228 <label style='display : inline' for="remember_me"><?php echo __("Remember me") ?></label>
229 </div>
230
231 <?php } ?>
232
233 <div class="row" style='text-align : right'>
234 <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button>
235 <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
236 <button onclick="return gotoRegForm()" dojoType="dijit.form.Button">
237 <?php echo __("Create new account") ?></button>
238 <?php } ?>
239 </div>
240
241 </fieldset>
242
243
244 </div>
245
246 <div class='footer'>
247 <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
248 <?php if (!defined('HIDE_VERSION')) { ?>
249 v<?php echo VERSION ?>
250 <?php } ?>
251 &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
252 </div>
253
254 </form>
255
256 </body></html>