本文整理匯總了PHP中PMF_User_CurrentUser::enableRememberMe方法的典型用法代碼示例。如果您正苦於以下問題:PHP PMF_User_CurrentUser::enableRememberMe方法的具體用法?PHP PMF_User_CurrentUser::enableRememberMe怎麽用?PHP PMF_User_CurrentUser::enableRememberMe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PMF_User_CurrentUser
的用法示例。
在下文中一共展示了PMF_User_CurrentUser::enableRememberMe方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: trim
// authenticate current user
$auth = null;
$error = '';
$faqusername = PMF_Filter::filterInput(INPUT_POST, 'faqusername', FILTER_SANITIZE_STRING);
$faqpassword = PMF_Filter::filterInput(INPUT_POST, 'faqpassword', FILTER_SANITIZE_STRING);
$faqremember = PMF_Filter::filterInput(INPUT_POST, 'faqrememberme', FILTER_SANITIZE_STRING);
// Set username via SSO
if ($faqConfig->get('security.ssoSupport') && isset($_SERVER['REMOTE_USER'])) {
$faqusername = trim($_SERVER['REMOTE_USER']);
$faqpassword = '';
}
// Login via local DB or LDAP or SSO
if (!is_null($faqusername) && !is_null($faqpassword)) {
$user = new PMF_User_CurrentUser($faqConfig);
if (!is_null($faqremember) && 'rememberMe' === $faqremember) {
$user->enableRememberMe();
}
if ($faqConfig->get('security.ldapSupport') && function_exists('ldap_connect')) {
$authLdap = new PMF_Auth_Ldap($faqConfig);
$user->addAuth($authLdap, 'ldap');
}
if ($faqConfig->get('security.ssoSupport')) {
$authSso = new PMF_Auth_Sso($faqConfig);
$user->addAuth($authSso, 'sso');
}
if ($user->login($faqusername, $faqpassword)) {
// login, if user account is NOT blocked
if ($user->getStatus() != 'blocked') {
$auth = true;
} else {
$error = $PMF_LANG['ad_auth_fail'];