summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/util.php17
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);
}