]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Merge pull request #556 from ArthurHoaro/login-refill
[github/shaarli/Shaarli.git] / index.php
index 6b02942f99359629cd11370f931e0d74b5d902d4..1eaf70cefbc0d898b7bcc20062613f354ccea1b8 100644 (file)
--- 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;