本文整理汇总了PHP中OC::tryApacheAuth方法的典型用法代码示例。如果您正苦于以下问题:PHP OC::tryApacheAuth方法的具体用法?PHP OC::tryApacheAuth怎么用?PHP OC::tryApacheAuth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC
的用法示例。
在下文中一共展示了OC::tryApacheAuth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleLogin
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);
}
示例2: handleLogin
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);
}
示例3: handleLogin
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));
}
示例4: handleLogin
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));
}
示例5: handleLogin
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';
}
if (!\OC::$server->getUserSession()->isLoggedIn()) {
$loginMessages = array(array_unique($error), $messages);
\OC::$server->getSession()->set('loginMessages', $loginMessages);
// Read current user and append if possible
$args = [];
if (isset($_POST['user'])) {
$args['user'] = $_POST['user'];
}
$redirectionTarget = \OC::$server->getURLGenerator()->linkToRoute('core.login.showLoginForm', $args);
header('Location: ' . $redirectionTarget);
}
}