当前位置: 首页>>代码示例>>PHP>>正文


PHP ISession::remove方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:13,代码来源:Session.php

示例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');
 }
开发者ID:evanjt,项目名称:core,代码行数:12,代码来源:session.php

示例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;
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:20,代码来源:Manager.php

示例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');
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:60,代码来源:LoginController.php

示例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');
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:27,代码来源:TwoFactorChallengeController.php

示例6: removeToken

 /**
  * Removes the current token.
  */
 public function removeToken()
 {
     $this->session->remove('requesttoken');
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:7,代码来源:SessionStorage.php

示例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);
 }
开发者ID:hyb148,项目名称:core,代码行数:11,代码来源:cryptosessiondata.php

示例8: remove

 /**
  * Remove a $key/$value pair from the session
  *
  * @param string $key
  */
 public function remove($key)
 {
     $this->session->remove($key);
 }
开发者ID:rosarion,项目名称:core,代码行数:9,代码来源:cryptosessiondata.php


注:本文中的OCP\ISession::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。