Remember last entered login in connection form

This commit is contained in:
Phyks 2013-08-09 23:47:01 +02:00
parent 8970322808
commit ffdee544cb
4 changed files with 5 additions and 4 deletions

2
TODO
View File

@ -1,11 +1,11 @@
* i18n
* Vérification des variables dans les classes + throw exception
* tokens + ban system
* TRUNCATE before CREATE TABLE in install.php
install.php :
=============
* Link beside password field to toggle visible / not visible
* TRUNCATE before CREATE TABLE in install.php
index.php :
===========

View File

@ -7,7 +7,7 @@
raintpl::$cache_dir = 'tmp/';
$tpl = new raintpl();
$tpl->assign('instance_title', INSTANCE_TITLE);
$tpl->assign('instance_title', htmlspecialchars(INSTANCE_TITLE));
$tpl->assign('connection', false);
$tpl->assign('notice', '');
$tpl->assign('error', '');
@ -42,6 +42,7 @@
}
}
$tpl->assign('connection', true);
$tpl->assign('user_post', (!empty($_POST['login'])) ? htmlspecialchars($_POST['login']) : '');
$tpl->draw('connexion');
break;

View File

@ -4,7 +4,7 @@
<h1 id="title"><?php echo $instance_title;?> - Connexion</h1>
<form method="post" action="index.php?do=connect" id="connexion_form">
<p><label for="login" class="label-block">Username : </label><input type="text" name="login" id="login"/></p>
<p><label for="login" class="label-block">Username : </label><input type="text" name="login" id="login" value="<?php echo $user_post;?>"/></p>
<p><label for="password" class="label-block">Password : </label><input type="password" name="password" id="password"/></p>
<p><input type="submit" value="Connect"/></p>
</form>

View File

@ -3,7 +3,7 @@
<h1 id="title">{$instance_title} - Connexion</h1>
<form method="post" action="index.php?do=connect" id="connexion_form">
<p><label for="login" class="label-block">Username : </label><input type="text" name="login" id="login"/></p>
<p><label for="login" class="label-block">Username : </label><input type="text" name="login" id="login" value="{$user_post}"/></p>
<p><label for="password" class="label-block">Password : </label><input type="password" name="password" id="password"/></p>
<p><input type="submit" value="Connect"/></p>
</form>