]> git.wh0rd.org Git - tt-rss.git/blob - include/login_form.php
do not use dojo for login/password fields
[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="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/dijit/dijit.js"></script>
10         <script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script>
11         <script type="text/javascript" src="lib/prototype.js"></script>
12         <script type="text/javascript" src="js/functions.js"></script>
13         <script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script>
14         <script type="text/javascript">
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         div.footer a {
69                 color : gray;
70         }
71
72         div.footer a:hover {
73                 color : #88b0f0;
74         }
75
76         div.row {
77                 padding : 0px 0px 5px 0px;
78         }
79
80         div.row-error {
81                 color : red;
82                 text-align : center;
83                 padding : 0px 0px 5px 0px;
84         }
85
86         </style>
87 </head>
88
89 <body id="ttrssLogin" class="claro">
90
91 <script type="text/javascript">
92 function init() {
93         dojo.require("dijit.form.Button");
94         dojo.require("dijit.form.CheckBox");
95         dojo.require("dijit.form.Form");
96         dojo.require("dijit.form.Select");
97         dojo.require("dijit.form.TextBox");
98         dojo.require("dijit.form.ValidationTextBox");
99
100         dojo.parser.parse();
101
102         fetchProfiles();
103
104         dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
105 }
106
107 function fetchProfiles() {
108         try {
109                 var query = "?op=getProfiles&login=" + param_escape(document.forms["loginForm"].login.value);
110
111                 if (query) {
112                         new Ajax.Request("public.php",  {
113                                 parameters: query,
114                                 onComplete: function(transport) {
115                                         if (transport.responseText.match("select")) {
116                                                 $('profile_box').innerHTML = transport.responseText;
117                                                 dojo.parser.parse('profile_box');
118                                         }
119                         } });
120                 }
121
122         } catch (e) {
123                 exception_error("fetchProfiles", e);
124         }
125 }
126
127
128 function gotoRegForm() {
129         window.location.href = "register.php";
130         return false;
131 }
132
133 function bwLimitChange(elem) {
134         try {
135                 var limit_set = elem.checked;
136
137                 setCookie("ttrss_bwlimit", limit_set,
138                         <?php print SESSION_COOKIE_LIFETIME ?>);
139
140         } catch (e) {
141                 exception_error("bwLimitChange", e);
142         }
143 }
144 </script>
145
146 <?php $return = urlencode($_SERVER["REQUEST_URI"]) ?>
147
148 <form action="public.php?return=<?php echo $return ?>"
149         dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm">
150
151 <input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login">
152
153 <div class='header'>
154         <img src="images/logo_wide.png">
155 </div>
156
157 <div class='form'>
158
159         <fieldset>
160                 <?php if ($_SESSION["login_error_msg"]) { ?>
161                 <div class="row-error">
162                         <?php echo $_SESSION["login_error_msg"] ?>
163                 </div>
164                         <?php $_SESSION["login_error_msg"] = ""; ?>
165                 <?php } ?>
166                 <div class="row">
167                         <label><?php echo __("Login:") ?></label>
168                         <input name="login" class="input"
169                                 onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()"
170                                 style="width : 220px"
171                                 required="1"
172                                 value="<?php echo $_SESSION["fake_login"] ?>" />
173                 </div>
174
175                 <div class="row">
176                         <label><?php echo __("Password:") ?></label>
177                         <input type="password" name="password" required="1"
178                                         style="width : 220px" class="input"
179                                         value="<?php echo $_SESSION["fake_password"] ?>"/>
180                 </div>
181
182                 <div class="row">
183                         <label><?php echo __("Language:") ?></label>
184                         <?php
185                                 print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
186                                         "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
187                         ?>
188                 </div>
189
190                 <div class="row">
191                         <label><?php echo __("Profile:") ?></label>
192
193                         <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select'
194                                 style='width : 220px; margin : 0px'>
195                                 <option><?php echo __("Default profile") ?></option></select></span>
196
197                 </div>
198
199                 <div class="row">
200                         <label>&nbsp;</label>
201                         <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox"
202                                 onchange="bwLimitChange(this)">
203                         <label style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
204                 </div>
205
206                 <div class="row" style='text-align : right'>
207                         <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button>
208                         <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
209                                 <button onclick="return gotoRegForm()" dojoType="dijit.form.Button">
210                                         <?php echo __("Create new account") ?></button>
211                         <?php } ?>
212                 </div>
213
214         </fieldset>
215
216
217 </div>
218
219 <div class='footer'>
220         <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
221         <?php if (!defined('HIDE_VERSION')) { ?>
222                  v<?php echo VERSION ?>
223         <?php } ?>
224         &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
225 </div>
226
227 </form>
228
229 </body></html>