]> git.wh0rd.org - tt-rss.git/blame - include/login_form.php
drop undesired shilling
[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>
675f198a 26</head>
a598370d 27
09bc54c6 28<body class="claro ttrss_main ttrss_login">
675f198a
AD
29
30<script type="text/javascript">
31function init() {
675f198a 32
44bf49d4 33 require(['dojo/parser','dijit/form/Button','dijit/form/CheckBox','dijit/form/Form',
34 'dijit/form/Select','dijit/form/TextBox','dijit/form/ValidationTextBox'],function(parser){
35 parser.parse();
67e0cf9a 36 //show tooltip node only after this widget is instaniated.
44bf49d4 37 dojo.query('div[dojoType="dijit.Tooltip"]').style({
38 display:''
39 });
40 fetchProfiles();
41 dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
42 document.forms.loginForm.login.focus();
67e0cf9a 43 });
97acbaf1 44
01a87dff 45}
0456176a 46
d9084cf2
AD
47function fetchProfiles() {
48 try {
8f2ad8e1 49 var query = "op=getProfiles&login=" + param_escape(document.forms["loginForm"].login.value);
7b26a148 50
d9084cf2 51 if (query) {
5334e1ec 52 new Ajax.Request("public.php", {
d9084cf2 53 parameters: query,
97acbaf1
AD
54 onComplete: function(transport) {
55 if (transport.responseText.match("select")) {
56 $('profile_box').innerHTML = transport.responseText;
6cf3a572 57 //dojo.parser.parse('profile_box');
97acbaf1
AD
58 }
59 } });
d9084cf2
AD
60 }
61
62 } catch (e) {
63 exception_error("fetchProfiles", e);
64 }
65}
66
67
0136468d
AD
68function gotoRegForm() {
69 window.location.href = "register.php";
70 return false;
71}
72
a598370d
AD
73function bwLimitChange(elem) {
74 try {
75 var limit_set = elem.checked;
76
7b26a148 77 setCookie("ttrss_bwlimit", limit_set,
a598370d
AD
78 <?php print SESSION_COOKIE_LIFETIME ?>);
79
80 } catch (e) {
81 exception_error("bwLimitChange", e);
82 }
83}
675f198a 84</script>
a598370d 85
675f198a 86<?php $return = urlencode($_SERVER["REQUEST_URI"]) ?>
ec6b7ada 87
675f198a
AD
88<form action="public.php?return=<?php echo $return ?>"
89 dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm">
ec6b7ada 90
675f198a 91<input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login">
ec6b7ada 92
675f198a
AD
93<div class='header'>
94 <img src="images/logo_wide.png">
95</div>
a0b9990a 96
675f198a 97<div class='form'>
01a87dff 98
675f198a 99 <fieldset>
eeee2ccf
AD
100 <?php if ($_SESSION["login_error_msg"]) { ?>
101 <div class="row-error">
102 <?php echo $_SESSION["login_error_msg"] ?>
103 </div>
104 <?php $_SESSION["login_error_msg"] = ""; ?>
105 <?php } ?>
675f198a
AD
106 <div class="row">
107 <label><?php echo __("Login:") ?></label>
7d73cc41 108 <input name="login" class="input input-text" type="text"
97acbaf1 109 onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()"
eeee2ccf 110 style="width : 220px"
c82c2aa4 111 required="1"
675f198a
AD
112 value="<?php echo $_SESSION["fake_login"] ?>" />
113 </div>
114
3921f508 115
675f198a
AD
116 <div class="row">
117 <label><?php echo __("Password:") ?></label>
c82c2aa4 118 <input type="password" name="password" required="1"
7d73cc41 119 style="width : 220px" class="input input-text"
675f198a 120 value="<?php echo $_SESSION["fake_password"] ?>"/>
f43e9e97 121 <label></label>
13db181d 122 <?php if (strpos(PLUGINS, "auth_internal") !== FALSE) { ?>
f43e9e97 123 <a class='forgotpass' href="public.php?op=forgotpass"><?php echo __("I forgot my password") ?></a>
13db181d 124 <?php } ?>
675f198a
AD
125 </div>
126
3921f508 127
675f198a
AD
128 <div class="row">
129 <label><?php echo __("Profile:") ?></label>
d9084cf2 130
eeee2ccf
AD
131 <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select'
132 style='width : 220px; margin : 0px'>
675f198a 133 <option><?php echo __("Default profile") ?></option></select></span>
d9084cf2 134
675f198a 135 </div>
4fc1580a 136
675f198a
AD
137 <div class="row">
138 <label>&nbsp;</label>
139 <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox"
140 onchange="bwLimitChange(this)">
a62337b3
AD
141 <label id="bw_limit_label" style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
142 </div>
143
44bf49d4 144 <div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below" style="display:none">
a62337b3 145<?php echo __("Does not display images in articles, reduces automatic refreshes."); ?>
675f198a
AD
146 </div>
147
aadd636a 148 <?php if (SESSION_COOKIE_LIFETIME > 0) { ?>
f231f438
AD
149
150 <div class="row">
151 <label>&nbsp;</label>
152 <input dojoType="dijit.form.CheckBox" name="remember_me" id="remember_me" type="checkbox">
153 <label style='display : inline' for="remember_me"><?php echo __("Remember me") ?></label>
154 </div>
155
156 <?php } ?>
157
675f198a
AD
158 <div class="row" style='text-align : right'>
159 <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button>
4f7956b3 160 <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
675f198a 161 <button onclick="return gotoRegForm()" dojoType="dijit.form.Button">
2ec990ab 162 <?php echo __("Create new account") ?></button>
4fc1580a 163 <?php } ?>
675f198a 164 </div>
4fc1580a 165
675f198a 166 </fieldset>
a598370d 167
a598370d 168
675f198a 169</div>
a598370d 170
675f198a 171<div class='footer'>
ce72cb95 172 <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
675f198a 173</div>
01a87dff
AD
174
175</form>
176
5a68dec1 177</body></html>