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


PHP UserModule::encryptPassword方法代码示例

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


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

示例1: verifyPassword

 /**
  * Phương thức verifyPassword($attribute, $params) dùng để xác thực mật khẩu của user
  *
  * @param type $attribute
  * @param type $params 
  */
 public function verifyPassword($attribute, $params)
 {
     $strPassword = UserModule::encryptPassword($this->verifyPassword, $this->__user->saltkey);
     if ($strPassword != $this->__user->password) {
         $this->addError('verifyPassword', UserModule::t('The password you gave is incorrect.'));
     }
 }
开发者ID:qkongvan,项目名称:k6-thuc-pham,代码行数:13,代码来源:ChangeEmailForm.php

示例2: authenticate

 /**
  * Phương thức authenticate() dùng để xác thực username và password của User có đúng không
  *  
  * @return boolean whether authentication succeeds.
  */
 public function authenticate()
 {
     //$record = User::model()->findByAttributes(array('username'=>$this->username));
     if (strpos($this->username, "@")) {
         $record = User::model()->notsafe()->findByAttributes(array('email' => $this->username));
     } else {
         $record = User::model()->notsafe()->findByAttributes(array('username' => $this->username));
     }
     if ($record === null) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     } else {
         if ($record->password !== UserModule::encryptPassword($this->password, $record->saltkey)) {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         } else {
             $this->_id = $record->id;
             $this->setState('superuser', $record->superuser);
             $this->errorCode = self::ERROR_NONE;
         }
     }
     return !$this->errorCode;
 }
开发者ID:qkongvan,项目名称:k6-thuc-pham,代码行数:26,代码来源:HUserIdentity.php

示例3: createCodeActivation

 /**
  * Phương thức dùng để tạo ra mã activate code
  */
 public function createCodeActivation()
 {
     $codeActivation = UserModule::encryptPassword(microtime(), UserModule::createSalt());
     $this->activkey = $codeActivation;
     return $codeActivation;
 }
开发者ID:qkongvan,项目名称:k6-thuc-pham,代码行数:9,代码来源:User.php


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