當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。