diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-08-09 18:27:59 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-08-10 11:43:04 +0200 |
commit | 667cd318fe19c11a19883536501d9cd562cd6201 (patch) | |
tree | f12ef528ee4edd823dd18baf16be7f1e44203b18 /lib | |
parent | aa9fbf6639e2ce2fa2e8549d2d82d54a745d5327 (diff) | |
download | nextcloud-server-667cd318fe19c11a19883536501d9cd562cd6201.tar.gz nextcloud-server-667cd318fe19c11a19883536501d9cd562cd6201.zip |
Use OC_Util::displayLoginPage and cleanup the function
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/util.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php index 4c5d416f9f2..732acbb9205 100755 --- a/lib/util.php +++ b/lib/util.php @@ -271,15 +271,26 @@ class OC_Util { return $errors; } - public static function displayLoginPage($parameters = array()){ - if(isset($_COOKIE["username"])){ - $parameters["username"] = $_COOKIE["username"]; + public static function displayLoginPage($display_lostpassword) { + $parameters = array(); + $parameters['display_lostpassword'] = $display_lostpassword; + if (!empty($_POST['user'])) { + $parameters["username"] = + OC_Util::sanitizeHTML($_POST['user']).'"'; + $parameters['user_autofocus'] = false; } else { $parameters["username"] = ''; + $parameters['user_autofocus'] = true; } $sectoken=rand(1000000,9999999); $_SESSION['sectoken']=$sectoken; $parameters["sectoken"] = $sectoken; + if (isset($_REQUEST['redirect_url'])) { + $redirect_url = OC_Util::sanitizeHTML($_REQUEST['redirect_url']); + } else { + $redirect_url = $_SERVER['REQUEST_URI']; + } + $parameters['redirect_url'] = $redirect_url; OC_Template::printGuestPage("", "login", $parameters); } |