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


PHP BlowfishPasswordHasher::check方法代码示例

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


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

示例1: beforeFilter

 public function beforeFilter()
 {
     if ($this->request->is('ajax')) {
         $this->response->type("application/json");
         $this->layout = "ajax";
     } elseif ($this->request->params['controller'] != 'installers' && !$this->__isInstalled()) {
         $this->redirect(array('controller' => 'installers', 'action' => 'index'));
     } elseif ($this->request->params['controller'] == 'installers' && $this->__isInstalled()) {
         $this->Session->setFlash(__('Sonerezh is already installed. Remove or rename app/Config/database.php to run the installation again.'), 'flash_info');
         $this->redirect(array('controller' => 'songs', 'action' => 'index'));
     }
     if ($this->__isInstalled() && !$this->Auth->user() && $this->Cookie->check('auth')) {
         $this->loadModel('User');
         $cookie = $this->Cookie->read('auth');
         $authCookie = explode(':', $cookie);
         $user = $this->User->find('first', array('conditions' => array('id' => $authCookie[0])));
         $passwordHasher = new BlowfishPasswordHasher();
         if ($passwordHasher->check($user['User']['email'], $authCookie[1]) && $passwordHasher->check($user['User']['password'], $authCookie[2])) {
             unset($user['User']['password']);
             $this->Auth->login($user['User']);
             $this->Cookie->write('auth', $this->Cookie->read('auth'));
         } else {
             $this->Cookie->delete('auth');
         }
     }
     if (!$this->request->is('ajax') && $this->Auth->user()) {
         $this->loadModel('Setting');
         $setting = $this->Setting->find('first', array('fields' => array('sync_token')));
         $this->set('sync_token', $setting['Setting']['sync_token']);
     }
     $this->__setLanguage();
 }
开发者ID:inscriptionweb,项目名称:sonerezh,代码行数:32,代码来源:AppController.php

示例2: comparePassword

 public function comparePassword($id = null, $password = null)
 {
     $passwordHasher = new BlowfishPasswordHasher();
     $this->id = $id;
     $hashPasswordData = $this->field('password');
     return $passwordHasher->check($password, $hashPasswordData);
 }
开发者ID:sonnt1991,项目名称:Goikenban,代码行数:7,代码来源:Administrator.php

示例3: checkCurrentPassword

 public function checkCurrentPassword($current_password)
 {
     $this->id = AuthComponent::user('id');
     $saved_password = $this->field('password');
     $hasher = new BlowfishPasswordHasher();
     return $hasher->check($current_password, $saved_password);
 }
开发者ID:PaulArijit,项目名称:euro-psf,代码行数:7,代码来源:User.php

示例4: login

 public function login($user, $pass)
 {
     $passwordHasher = new BlowfishPasswordHasher();
     $x = $this->find('first', array('conditions' => array('User.email' => $user)));
     //debug($x);
     //exit;
     if (!empty($x)) {
         return $passwordHasher->check($pass, $x['User']['clave']);
     } else {
         return false;
     }
 }
开发者ID:earea2,项目名称:cde_rojo,代码行数:12,代码来源:User.php

示例5: checkPassword

 /**
  * Function to check the users old password is correct
  *
  * @param array $data The users data
  * @return booleen true is it matches, false otherwise
  */
 public function checkPassword($check)
 {
     $value = array_shift($check);
     if (strlen($value) == 0) {
         return true;
     }
     // if no userId is set
     if (empty($this->data['User']['id'])) {
         return false;
     }
     $this->contain();
     $user = $this->findById($this->data['User']['id'], 'password');
     if (!$user) {
         return false;
     }
     $passwordHasher = new BlowfishPasswordHasher();
     return $passwordHasher->check($value, $user['User']['password']);
 }
开发者ID:trungpm-evolable,项目名称:app,代码行数:24,代码来源:User.php

示例6: checkPassword

 /**
  * 現在のパスワードと確認パスワードが一致するかを判定する
  *
  * @return boolean
  */
 public function checkPassword()
 {
     $passwordHasher = new BlowfishPasswordHasher();
     $current_pass = $this->User->getPasswordById($this->Auth->user('id'));
     // パスワードの正誤判定
     if ($passwordHasher->check($this->request->data['User']['old_password'], $current_pass)) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:shranes,项目名称:hics,代码行数:16,代码来源:UsersController.php

示例7: matchCurrentPassword

 /**
  * Validation rule
  * Check value is equal current password
  * @author thientd
  */
 public function matchCurrentPassword($check)
 {
     $check = array_values($check);
     $check = $check[0];
     if (!$check) {
         return empty($this->data[$this->name]['password']);
     }
     if (empty($this->id)) {
         return false;
     }
     $user = $this->find('first', array('fields' => array('password'), 'conditions' => array($this->primaryKey => $this->id), 'recursive' => -1));
     if (!$user) {
         return false;
     }
     App::uses('BlowfishPasswordHasher', 'Controller/Component/Auth');
     $passwordHasher = new BlowfishPasswordHasher();
     return $passwordHasher->check($check, $user[$this->alias]['password']);
 }
开发者ID:sonnt1991,项目名称:Goikenban,代码行数:23,代码来源:AppModel.php


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