diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2012-10-15 03:52:11 -0700 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2012-10-15 03:52:11 -0700 |
commit | c930ac9f881930f9b4cf93534135dc15aa570444 (patch) | |
tree | fd9e09311c5eaeab347a934143d710d60b454e27 /lib | |
parent | cf7df2db7a4e729c0cef5932b1aed792390bb7d3 (diff) | |
parent | 7095b3a083041a435adc50afbec397bd9be614c6 (diff) | |
download | nextcloud-server-c930ac9f881930f9b4cf93534135dc15aa570444.tar.gz nextcloud-server-c930ac9f881930f9b4cf93534135dc15aa570444.zip |
Merge pull request #30 from visit1985/logonpage
extend logon page to display multiple error messages
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 10 | ||||
-rwxr-xr-x | lib/util.php | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/base.php b/lib/base.php index 51f8f4efc5b..9f21e26279f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -494,20 +494,20 @@ class OC{ protected static function handleLogin() { OC_App::loadApps(array('prelogin')); - $error = false; + $error = array(); // remember was checked after last login if (OC::tryRememberLogin()) { - // nothing more to do + $error[] = 'invalidcookie'; // Someone wants to log in : } elseif (OC::tryFormLogin()) { - $error = true; + $error[] = 'invalidpassword'; // The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP } elseif (OC::tryBasicAuthLogin()) { - $error = true; + $error[] = 'invalidpassword'; } - OC_Util::displayLoginPage($error); + OC_Util::displayLoginPage(array_unique($error)); } protected static function tryRememberLogin() { diff --git a/lib/util.php b/lib/util.php index 68c4920258f..315e33e96e2 100755 --- a/lib/util.php +++ b/lib/util.php @@ -310,9 +310,11 @@ class OC_Util { return $errors; } - public static function displayLoginPage($display_lostpassword) { + public static function displayLoginPage($errors = array()) { $parameters = array(); - $parameters['display_lostpassword'] = $display_lostpassword; + foreach( $errors as $key => $value ) { + $parameters[$value] = true; + } if (!empty($_POST['user'])) { $parameters["username"] = OC_Util::sanitizeHTML($_POST['user']).'"'; |