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


PHP opToolkit::generatePasswordString方法代码示例

本文整理汇总了PHP中opToolkit::generatePasswordString方法的典型用法代码示例。如果您正苦于以下问题:PHP opToolkit::generatePasswordString方法的具体用法?PHP opToolkit::generatePasswordString怎么用?PHP opToolkit::generatePasswordString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在opToolkit的用法示例。


在下文中一共展示了opToolkit::generatePasswordString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendMail

 public function sendMail()
 {
     $token = md5(opToolkit::generatePasswordString());
     $this->member->setConfig('password_recovery_token', $token);
     $params = array('token' => $token, 'id' => $this->member->id, 'subject' => '【' . opConfig::get('sns_name') . '】パスワード再設定用URL発行のお知らせ');
     sfOpenPNEMailSend::sendTemplateMail('passwordRecovery', $this->member->getEMailAddress(), opConfig::get('admin_mail_address'), $params);
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:7,代码来源:opAuthMailAddressPasswordRecoveryForm.class.php

示例2: preSave

 public function preSave($event)
 {
     if (!$this->exists()) {
         $this->key_string = opToolkit::generatePasswordString(16, false);
         $this->secret = opToolkit::generatePasswordString(32);
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:7,代码来源:OAuthConsumerInformation.class.php

示例3: new_access_token

 public function new_access_token($token, $consumer)
 {
     $information = Doctrine::getTable('OAuthConsumerInformation')->findByKeyString($consumer->key);
     if ($information) {
         $key = opToolkit::generatePasswordString(16, false);
         $secret = opToolkit::generatePasswordString(32, false);
         $tokenRecord = $this->queryTemplate->andWhere('oauth_consumer_id = ?', $information->id)->andWhere('type = ?', 'access')->fetchOne();
         if (!$tokenRecord) {
             $tokenRecord = $this->recordTemplate;
         }
         $tokenRecord->setKeyString($key);
         $tokenRecord->setSecret($secret);
         $tokenRecord->setConsumer($information);
         $tokenRecord->setType('access');
         $tokenRecord->save();
         return new OAuthToken($key, $secret);
     }
     return null;
 }
开发者ID:kawahara,项目名称:OpenPNE3,代码行数:19,代码来源:opOAuthDataStore.class.php

示例4: executeUpdateConsumerSecret

 /**
  * Executes update consumer secret
  *
  * @param sfWebRequest $request
  */
 public function executeUpdateConsumerSecret(sfWebRequest $request)
 {
     if ($request->isMethod(sfWebRequest::POST)) {
         if (!$this->application->getConsumerKey()) {
             $this->application->setConsumerKey(opToolkit::generatePasswordString(16, false));
         }
         $this->application->setConsumerSecret(opToolkit::generatePasswordString(32));
         $this->application->save();
         $this->redirect('@op_opensocial_info?id=' . $this->application->getId());
     }
     return sfView::INPUT;
 }
开发者ID:niryuu,项目名称:opOpenSocialPlugin,代码行数:17,代码来源:actions.class.php

示例5: setRememberLoginCookie

 /**
  * set remember login cookie
  */
 protected function setRememberLoginCookie($isDeleteCookie = false)
 {
     $key = md5(sfContext::getInstance()->getRequest()->getHost());
     $path = sfContext::getInstance()->getRequest()->getRelativeUrlRoot();
     if (!$path) {
         $path = '/';
     }
     if ($isDeleteCookie) {
         if (!sfContext::getInstance()->getRequest()->getCookie($key)) {
             return;
         }
         if ($this->getMemberId()) {
             $this->getMember()->setConfig('remember_key', '');
         }
         $value = null;
         $expire = time() - 3600;
     } else {
         $rememberKey = opToolkit::generatePasswordString();
         if (!$this->getMemberId()) {
             throw new LogicException('No login');
         }
         $this->getMember()->setConfig('remember_key', $rememberKey);
         $value = base64_encode(serialize(array($this->getMemberId(), $rememberKey)));
         $expire = time() + sfConfig::get('op_remember_login_limit', 60 * 60 * 24 * 30);
     }
     sfContext::getInstance()->getResponse()->setCookie($key, $value, $expire, $path, '', false, true);
 }
开发者ID:nagata,项目名称:OpenPNE3,代码行数:30,代码来源:opSecurityUser.class.php

示例6: save

 public function save()
 {
     $member = $this->memberForm->save();
     $this->setMember($member);
     $profile = $this->profileForm->save($this->getMember()->getId());
     $config = $this->configForm->save($this->getMember()->getId());
     $auth = $this->doSave();
     if ($member && $profile && $auth && $config) {
         if ($this->getValue('mobile_uid')) {
             $this->getMember()->setConfig('mobile_uid', $this->getValue('mobile_uid'));
         }
         $communities = Doctrine::getTable('Community')->getDefaultCommunities();
         foreach ($communities as $community) {
             Doctrine::getTable('CommunityMember')->join($this->getMember()->getId(), $community->getId());
         }
         if (sfConfig::get('op_is_mail_address_contain_hash')) {
             $str = opToolkit::generatePasswordString(sfConfig::get('op_mail_address_hash_length', 12), false);
             $this->getMember()->setConfig('mail_address_hash', strtolower($str));
         }
         return $this->getMember()->getId();
     }
     return false;
 }
开发者ID:phenom,项目名称:OpenPNE3,代码行数:23,代码来源:opAuthRegisterForm.class.php

示例7: executeUpdateConsumerSecret

 /**
  * Executes update consumer secret
  *
  * @param sfWebRequest $request
  */
 public function executeUpdateConsumerSecret(sfWebRequest $request)
 {
     $this->forward404Unless($this->member->getId() === $this->application->getMemberId());
     if ($request->isMethod(sfWebRequest::POST)) {
         if (!$this->application->getConsumerKey()) {
             $this->application->setConsumerKey(opToolkit::generatePasswordString(16, false));
         }
         $this->application->setConsumerSecret(opToolkit::generatePasswordString(32));
         $this->application->save();
         $this->redirect('@application_info?id=' . $this->application->getId());
     }
     return sfView::INPUT;
 }
开发者ID:niryuu,项目名称:opOpenSocialPlugin,代码行数:18,代码来源:actions.class.php

示例8: executeUpdateBackendConsumerSecret

 /**
  * Executes update backend consumer secret
  *
  * @param sfWebRequest $request
  */
 public function executeUpdateBackendConsumerSecret(sfWebRequest $request)
 {
     if ($request->isMethod(sfWebRequest::POST)) {
         $request->checkCSRFProtection();
         $snsConfigTable = Doctrine::getTable('SnsConfig');
         if (!$snsConfigTable->get('shindig_backend_key')) {
             $snsConfigTable->set('shindig_backend_key', opToolkit::generatePasswordString(16, false));
         }
         $snsConfigTable->set('shindig_backend_secret', opToolkit::generatePasswordString(32));
         $this->redirect('@op_opensocial_container_config');
     }
     return sfView::INPUT;
 }
开发者ID:rysk92,项目名称:opOpenSocialPlugin,代码行数:18,代码来源:actions.class.php


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