當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Token::setUserId方法代碼示例

本文整理匯總了PHP中Token::setUserId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Token::setUserId方法的具體用法?PHP Token::setUserId怎麽用?PHP Token::setUserId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Token的用法示例。


在下文中一共展示了Token::setUserId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createToken

 /**
  * @param int $userId
  * @param string $token
  * @return Token
  */
 public static function createToken($userId, $token)
 {
     $newToken = new Token();
     $newToken->setUserId($userId);
     $newToken->setToken($token);
     return $newToken;
 }
開發者ID:euBatham,項目名稱:javacature,代碼行數:12,代碼來源:TokenFactory.class.php

示例2: createAutologinToken

 /**
  * @param integer $user_id
  * @return Token
  */
 public function createAutologinToken($user_id)
 {
     $token = new Token();
     $token->setUserId($user_id);
     $token->setAction(Token::$ACTION_AUTOLOGIN);
     return $token;
 }
開發者ID:newZinc,項目名稱:timehive,代碼行數:11,代碼來源:TokenTable.class.php

示例3: getTokenUserCloud

 public function getTokenUserCloud($user, $cloud)
 {
     $token = new Token();
     $token->setUserId($user);
     $token->setCloudspaceName($cloud);
     try {
         $toReturn = current($this->dao->search($token));
     } catch (EyeResultNotFoundException $e) {
     }
     return $toReturn;
 }
開發者ID:sebasalons,項目名稱:eyeos-u1db,代碼行數:11,代碼來源:OAuthProvider.php

示例4: executeSendPassword

 public function executeSendPassword(sfWebRequest $request)
 {
     // try to find the user by the given E-Mail-Address
     $user = Doctrine::getTable('User')->findOneByEmail($request->getParameter('email'));
     if ($user) {
         // delete all previous recovery tokens
         Doctrine_Query::create()->delete('Token t')->where('t.user_id=? AND action=?', array($user->getId(), Token::$ACTION_RECOVER))->execute();
         // generate recover token
         $token = new Token();
         $token->setUserId($user->getId());
         $token->setAction(Token::$ACTION_RECOVER);
         $token->save();
         // sending user email
         $html = $this->getPartial('recoverEmail', array('user' => $user, 'token' => $token));
         $subject = sfContext::getInstance()->getI18N()->__('Your TimeHive password');
         MailSender::createInstance()->send($user['email'], $subject, $html);
         $this->getUser()->setFlash('send_pwd_failure', $this->getContext()->getI18N()->__('An email with instructions to choose a new password has been sent to you.'));
         $this->redirect('login/index');
     } else {
         $this->getUser()->setFlash('send_pwd_failure', $this->getContext()->getI18N()->__('There is no such e-mail address in the our database!'));
         $this->redirect('login/index');
     }
 }
開發者ID:newZinc,項目名稱:timehive,代碼行數:23,代碼來源:actions.class.php


注:本文中的Token::setUserId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。