]> git.wh0rd.org Git - tt-rss.git/blob - include/login_form.php
mail plugin: fix typo
[tt-rss.git] / include / login_form.php
1 <?php startup_gettext(); ?>
2 <html>
3 <head>
4         <title>Tiny Tiny RSS : Login</title>
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") ?>
8         <link rel="shortcut icon" type="image/png" href="images/favicon.png">
9         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
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
21         <script type="text/javascript">
22                 require({cache:{}});
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         }
32
33         fieldset {
34                 margin-left : auto;
35                 margin-right : auto;
36                 display : block;
37                 width : 400px;
38                 border-width : 0px;
39         }
40
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
49         label {
50                 width : 120px;
51                 margin-right : 20px;
52                 display : inline-block;
53                 text-align : right;
54                 color : gray;
55         }
56
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         }
64
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         }
75
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
90         div.footer a {
91                 color : gray;
92         }
93
94         div.footer a:hover {
95                 color : #88b0f0;
96         }
97
98         div.row {
99                 padding : 0px 0px 5px 0px;
100         }
101
102         div.row-error {
103                 color : red;
104                 text-align : center;
105                 padding : 0px 0px 5px 0px;
106         }
107
108         </style>
109 </head>
110
111 <body id="ttrssLogin" class="claro">
112
113 <script type="text/javascript">
114 function init() {
115
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();
119                 //show tooltip node only after this widget is instaniated.
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();
126         });
127
128 }
129
130 function fetchProfiles() {
131         try {
132                 var query = "op=getProfiles&login=" + param_escape(document.forms["loginForm"].login.value);
133
134                 if (query) {
135                         new Ajax.Request("public.php",  {
136                                 parameters: query,
137                                 onComplete: function(transport) {
138                                         if (transport.responseText.match("select")) {
139                                                 $('profile_box').innerHTML = transport.responseText;
140                                                 dojo.parser.parse('profile_box');
141                                         }
142                         } });
143                 }
144
145         } catch (e) {
146                 exception_error("fetchProfiles", e);
147         }
148 }
149
150
151 function gotoRegForm() {
152         window.location.href = "register.php";
153         return false;
154 }
155
156 function bwLimitChange(elem) {
157         try {
158                 var limit_set = elem.checked;
159
160                 setCookie("ttrss_bwlimit", limit_set,
161                         <?php print SESSION_COOKIE_LIFETIME ?>);
162
163         } catch (e) {
164                 exception_error("bwLimitChange", e);
165         }
166 }
167 </script>
168
169 <?php $return = urlencode($_SERVER["REQUEST_URI"]) ?>
170
171 <form action="public.php?return=<?php echo $return ?>"
172         dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm">
173
174 <input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login">
175
176 <div class='header'>
177         <img src="images/logo_wide.png">
178 </div>
179
180 <div class='form'>
181
182         <fieldset>
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 } ?>
189                 <div class="row">
190                         <label><?php echo __("Login:") ?></label>
191                         <input name="login" class="input"
192                                 onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()"
193                                 style="width : 220px"
194                                 required="1"
195                                 value="<?php echo $_SESSION["fake_login"] ?>" />
196                 </div>
197
198
199                 <div class="row">
200                         <label><?php echo __("Password:") ?></label>
201                         <input type="password" name="password" required="1"
202                                         style="width : 220px" class="input"
203                                         value="<?php echo $_SESSION["fake_password"] ?>"/>
204                         <label></label>
205                 <?php if (strpos(PLUGINS, "auth_internal") !== FALSE) { ?>
206                         <a class='forgotpass' href="public.php?op=forgotpass"><?php echo __("I forgot my password") ?></a>
207                 <?php } ?>
208                 </div>
209
210
211                 <div class="row">
212                         <label><?php echo __("Profile:") ?></label>
213
214                         <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select'
215                                 style='width : 220px; margin : 0px'>
216                                 <option><?php echo __("Default profile") ?></option></select></span>
217
218                 </div>
219
220                 <div class="row">
221                         <label>&nbsp;</label>
222                         <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox"
223                                 onchange="bwLimitChange(this)">
224                         <label id="bw_limit_label" style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
225                 </div>
226
227                 <div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below" style="display:none">
228 <?php echo __("Does not display images in articles, reduces automatic refreshes."); ?>
229                 </div>
230
231                 <?php if (SESSION_COOKIE_LIFETIME > 0) { ?>
232
233                 <div class="row">
234                         <label>&nbsp;</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
241                 <div class="row" style='text-align : right'>
242                         <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button>
243                         <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
244                                 <button onclick="return gotoRegForm()" dojoType="dijit.form.Button">
245                                         <?php echo __("Create new account") ?></button>
246                         <?php } ?>
247                 </div>
248
249         </fieldset>
250
251
252 </div>
253
254 <div class='footer'>
255         <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
256         &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
257 </div>
258
259 </form>
260
261 </body></html>