summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-09 18:27:59 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-10 11:43:04 +0200
commit667cd318fe19c11a19883536501d9cd562cd6201 (patch)
treef12ef528ee4edd823dd18baf16be7f1e44203b18 /lib
parentaa9fbf6639e2ce2fa2e8549d2d82d54a745d5327 (diff)
downloadnextcloud-server-667cd318fe19c11a19883536501d9cd562cd6201.tar.gz
nextcloud-server-667cd318fe19c11a19883536501d9cd562cd6201.zip
Use OC_Util::displayLoginPage and cleanup the function
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);
}