else
{
ban_loginFailed();
- $redir = '';
+ $redir = '&username='. $_POST['login'];
if (isset($_GET['post'])) {
- $redir = '?post=' . urlencode($_GET['post']);
+ $redir .= '&post=' . urlencode($_GET['post']);
foreach (array('description', 'source', 'title') as $param) {
if (!empty($_GET[$param])) {
$redir .= '&' . $param . '=' . urlencode($_GET[$param]);
if ($GLOBALS['config']['OPEN_SHAARLI']) { header('Location: ?'); exit; } // No need to login for open Shaarli
$token=''; if (ban_canLogin()) $token=getToken(); // Do not waste token generation if not useful.
$PAGE->assign('token',$token);
+ if (isset($_GET['username'])) {
+ $PAGE->assign('username', escape($_GET['username']));
+ }
$PAGE->assign('returnurl',(isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']):''));
$PAGE->renderPage('loginform');
exit;
<html>
<head>{include="includes"}</head>
<body
-{if="ban_canLogin()"} onload="document.loginform.login.focus();"{/if}>
+{if="ban_canLogin()"}
+ {if="empty($username)"}
+ onload="document.loginform.login.focus();"
+ {else}
+ onload="document.loginform.password.focus();"
+ {/if}
+{/if}>
<div id="pageheader">
{include="page.header"}
You have been banned from login after too many failed attempts. Try later.
{else}
<form method="post" name="loginform">
- <label for="login">Login: <input type="text" id="login" name="login" tabindex="1"></label>
- <label for="password">Password: <input type="password" id="password" name="password" tabindex="2"></label>
+ <label for="login">Login: <input type="text" id="login" name="login" tabindex="1"
+ {if="!empty($username)"}value="{$username}"{/if}>
+ </label>
+ <label for="password">Password: <input type="password" id="password" name="password" tabindex="2">
+ </label>
<input type="submit" value="Login" class="bigbutton" tabindex="4">
<label for="longlastingsession">
<input type="checkbox" name="longlastingsession" id="longlastingsession" tabindex="3">