X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;fp=index.php;h=dd876a660528d4f5e98b728fd4011e058db8d23c;hb=85c4bdc23581b91971315c42508c2d8f7a5fa738;hp=47bae6e87a943a1b26d5af2d1558053e2909f2fb;hpb=dbcd06e988d8434f125b8a5ee8f5bbcb7cd87874;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 47bae6e8..dd876a66 100644 --- a/index.php +++ b/index.php @@ -495,9 +495,9 @@ if (isset($_POST['login'])) 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]); @@ -943,6 +943,9 @@ function renderPage() 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;