Beispiel #1
0
 protected static function handleLogin()
 {
     OC_App::loadApps(array('prelogin'));
     $error = array();
     $messages = [];
     try {
         // auth possible via apache module?
         if (OC::tryApacheAuth()) {
             $error[] = 'apacheauthfailed';
         } elseif (OC::tryRememberLogin()) {
             $error[] = 'invalidcookie';
         } elseif (OC::tryFormLogin()) {
             $error[] = 'invalidpassword';
         }
     } catch (\OC\User\LoginException $e) {
         $messages[] = $e->getMessage();
     } catch (\Exception $ex) {
         \OCP\Util::logException('handleLogin', $ex);
         // do not disclose information. show generic error
         $error[] = 'internalexception';
     }
     OC_Util::displayLoginPage(array_unique($error), $messages);
 }
Beispiel #2
0
 protected static function handleLogin()
 {
     OC_App::loadApps(array('prelogin'));
     $error = array();
     // remember was checked after last login
     if (OC::tryRememberLogin()) {
         $error[] = 'invalidcookie';
         // Someone wants to log in :
     } elseif (OC::tryFormLogin()) {
         $error[] = 'invalidpassword';
         // The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP
     } elseif (OC::tryBasicAuthLogin()) {
         $error[] = 'invalidpassword';
     }
     OC_Util::displayLoginPage(array_unique($error));
 }
Beispiel #3
0
	protected static function handleLogin() {
		OC_App::loadApps(array('prelogin'));
		$error = array();
		$messages = [];

		try {
			// auth possible via apache module?
			if (OC::tryApacheAuth()) {
				$error[] = 'apacheauthfailed';
			} // remember was checked after last login
			elseif (OC::tryRememberLogin()) {
				$error[] = 'invalidcookie';
			} // logon via web form
			elseif (OC::tryFormLogin()) {
				$error[] = 'invalidpassword';
			}
		} catch (\OC\User\LoginException $e) {
			$messages[] = $e->getMessage();
		}

		OC_Util::displayLoginPage(array_unique($error), $messages);
	}
Beispiel #4
0
 protected static function handleLogin()
 {
     OC_App::loadApps(array('prelogin'));
     $error = array();
     // auth possible via apache module?
     if (OC::tryApacheAuth()) {
         $error[] = 'apacheauthfailed';
     } elseif (OC::tryRememberLogin()) {
         $error[] = 'invalidcookie';
     } elseif (OC::tryFormLogin()) {
     } elseif (OC::tryBasicAuthLogin()) {
         $error[] = 'invalidpassword';
     }
     OC_Util::displayLoginPage(array_unique($error));
 }
Beispiel #5
0
 protected static function handleLogin()
 {
     OC_App::loadApps(array('prelogin'));
     $error = false;
     // remember was checked after last login
     if (OC::tryRememberLogin()) {
         // nothing more to do
         // Someone wants to log in :
     } elseif (OC::tryFormLogin()) {
         $error = true;
         // The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP
     } elseif (OC::tryBasicAuthLogin()) {
         $error = true;
     }
     OC_Util::displayLoginPage($error);
 }
Beispiel #6
0
 protected static function handleLogin()
 {
     OC_App::loadApps(array('prelogin'));
     $error = array();
     // auth possible via apache module?
     if (OC::tryApacheAuth()) {
         $error[] = 'apacheauthfailed';
     } elseif (OC::tryRememberLogin()) {
         $error[] = 'invalidcookie';
     } elseif (OC::tryFormLogin()) {
         $error[] = 'invalidpassword';
         if (OC_Config::getValue('log_authfailip', false)) {
             OC_Log::write('core', 'Login failed: user \'' . $_POST["user"] . '\' , wrong password, IP:' . $_SERVER['REMOTE_ADDR'], OC_Log::WARN);
         } else {
             OC_Log::write('core', 'Login failed: user \'' . $_POST["user"] . '\' , wrong password, IP:set log_authfailip=true in conf', OC_Log::WARN);
         }
     }
     OC_Util::displayLoginPage(array_unique($error));
 }