本文整理汇总了PHP中OCP\ISession::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP ISession::remove方法的具体用法?PHP ISession::remove怎么用?PHP ISession::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\ISession
的用法示例。
在下文中一共展示了ISession::remove方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setLoginName
/**
* set the login name
*
* @param string|null $loginName for the logged in user
*/
public function setLoginName($loginName)
{
if (is_null($loginName)) {
$this->session->remove('loginname');
} else {
$this->session->set('loginname', $loginName);
}
}
示例2: clear
/**
* remove keys from session
*/
public function clear()
{
$this->session->remove('publicSharePrivateKey');
$this->session->remove('privateKey');
$this->session->remove('encryptionInitialized');
$this->session->remove('decryptAll');
$this->session->remove('decryptAllKey');
$this->session->remove('decryptAllUid');
}
示例3: verifyChallenge
/**
* Verify the given challenge
*
* @param string $providerId
* @param IUser $user
* @param string $challenge
* @return boolean
*/
public function verifyChallenge($providerId, IUser $user, $challenge)
{
$provider = $this->getProvider($user, $providerId);
if (is_null($provider)) {
return false;
}
$result = $provider->verifyChallenge($user, $challenge);
if ($result) {
$this->session->remove(self::SESSION_UID_KEY);
}
return $result;
}
示例4: showLoginForm
/**
* @PublicPage
* @NoCSRFRequired
* @UseSession
*
* @param string $user
* @param string $redirect_url
* @param string $remember_login
*
* @return TemplateResponse|RedirectResponse
*/
public function showLoginForm($user, $redirect_url, $remember_login)
{
if ($this->userSession->isLoggedIn()) {
return new RedirectResponse(OC_Util::getDefaultPageUrl());
}
$parameters = array();
$loginMessages = $this->session->get('loginMessages');
$errors = [];
$messages = [];
if (is_array($loginMessages)) {
list($errors, $messages) = $loginMessages;
}
$this->session->remove('loginMessages');
foreach ($errors as $value) {
$parameters[$value] = true;
}
$parameters['messages'] = $messages;
if (!is_null($user) && $user !== '') {
$parameters['loginName'] = $user;
$parameters['user_autofocus'] = false;
} else {
$parameters['loginName'] = '';
$parameters['user_autofocus'] = true;
}
if (!empty($redirect_url)) {
$parameters['redirect_url'] = $redirect_url;
}
$parameters['canResetPassword'] = true;
$parameters['resetPasswordLink'] = $this->config->getSystemValue('lost_password_link', '');
if (!$parameters['resetPasswordLink']) {
if (!is_null($user) && $user !== '') {
$userObj = $this->userManager->get($user);
if ($userObj instanceof IUser) {
$parameters['canResetPassword'] = $userObj->canChangePassword();
}
}
}
$parameters['alt_login'] = OC_App::getAlternativeLogIns();
$parameters['rememberLoginAllowed'] = OC_Util::rememberLoginAllowed();
$parameters['rememberLoginState'] = !empty($remember_login) ? $remember_login : 0;
if (!is_null($user) && $user !== '') {
$parameters['loginName'] = $user;
$parameters['user_autofocus'] = false;
} else {
$parameters['loginName'] = '';
$parameters['user_autofocus'] = true;
}
return new TemplateResponse($this->appName, 'login', $parameters, 'guest');
}
示例5: showChallenge
/**
* @NoAdminRequired
* @NoCSRFRequired
* @UseSession
*
* @param string $challengeProviderId
* @param string $redirect_url
* @return TemplateResponse
*/
public function showChallenge($challengeProviderId, $redirect_url)
{
$user = $this->userSession->getUser();
$provider = $this->twoFactorManager->getProvider($user, $challengeProviderId);
if (is_null($provider)) {
return new RedirectResponse($this->urlGenerator->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
}
if ($this->session->exists('two_factor_auth_error')) {
$this->session->remove('two_factor_auth_error');
$error = true;
} else {
$error = false;
}
$tmpl = $provider->getTemplate($user);
$tmpl->assign('redirect_url', $redirect_url);
$data = ['error' => $error, 'provider' => $provider, 'logout_attribute' => $this->getLogoutAttribute(), 'template' => $tmpl->fetchPage()];
return new TemplateResponse($this->appName, 'twofactorshowchallenge', $data, 'guest');
}
示例6: removeToken
/**
* Removes the current token.
*/
public function removeToken()
{
$this->session->remove('requesttoken');
}
示例7: remove
/**
* Remove a $key/$value pair from the session
*
* @param string $key
*/
public function remove($key)
{
$this->isModified = true;
unset($this->sessionValues[$key]);
$this->session->remove(self::encryptedSessionName);
}
示例8: remove
/**
* Remove a $key/$value pair from the session
*
* @param string $key
*/
public function remove($key)
{
$this->session->remove($key);
}