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