aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-05-14 11:09:39 +0200
committerArthur <arthur@hoa.ro>2016-05-14 11:09:39 +0200
commit52ccf0d7ee25eb0b6fc405aafcf7211ef07307e1 (patch)
tree404379a9cea49201b3950de88c6f731a24349bb0 /index.php
parent765391cb376500a8372aedd426dd4bfbe04ee8ec (diff)
parent85c4bdc23581b91971315c42508c2d8f7a5fa738 (diff)
downloadShaarli-52ccf0d7ee25eb0b6fc405aafcf7211ef07307e1.tar.gz
Shaarli-52ccf0d7ee25eb0b6fc405aafcf7211ef07307e1.tar.zst
Shaarli-52ccf0d7ee25eb0b6fc405aafcf7211ef07307e1.zip
Merge pull request #556 from ArthurHoaro/login-refill
Prefill the login field when the authentication has failed
Diffstat (limited to 'index.php')
-rw-r--r--index.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/index.php b/index.php
index 6b02942f..1eaf70ce 100644
--- a/index.php
+++ b/index.php
@@ -495,9 +495,9 @@ if (isset($_POST['login']))
495 else 495 else
496 { 496 {
497 ban_loginFailed(); 497 ban_loginFailed();
498 $redir = ''; 498 $redir = '&username='. $_POST['login'];
499 if (isset($_GET['post'])) { 499 if (isset($_GET['post'])) {
500 $redir = '?post=' . urlencode($_GET['post']); 500 $redir .= '&post=' . urlencode($_GET['post']);
501 foreach (array('description', 'source', 'title') as $param) { 501 foreach (array('description', 'source', 'title') as $param) {
502 if (!empty($_GET[$param])) { 502 if (!empty($_GET[$param])) {
503 $redir .= '&' . $param . '=' . urlencode($_GET[$param]); 503 $redir .= '&' . $param . '=' . urlencode($_GET[$param]);
@@ -943,6 +943,9 @@ function renderPage()
943 if ($GLOBALS['config']['OPEN_SHAARLI']) { header('Location: ?'); exit; } // No need to login for open Shaarli 943 if ($GLOBALS['config']['OPEN_SHAARLI']) { header('Location: ?'); exit; } // No need to login for open Shaarli
944 $token=''; if (ban_canLogin()) $token=getToken(); // Do not waste token generation if not useful. 944 $token=''; if (ban_canLogin()) $token=getToken(); // Do not waste token generation if not useful.
945 $PAGE->assign('token',$token); 945 $PAGE->assign('token',$token);
946 if (isset($_GET['username'])) {
947 $PAGE->assign('username', escape($_GET['username']));
948 }
946 $PAGE->assign('returnurl',(isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']):'')); 949 $PAGE->assign('returnurl',(isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']):''));
947 $PAGE->renderPage('loginform'); 950 $PAGE->renderPage('loginform');
948 exit; 951 exit;