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


PHP Auth\DefaultPasswordHasher類代碼示例

本文整理匯總了PHP中Cake\Auth\DefaultPasswordHasher的典型用法代碼示例。如果您正苦於以下問題:PHP DefaultPasswordHasher類的具體用法?PHP DefaultPasswordHasher怎麽用?PHP DefaultPasswordHasher使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: _setPassword

 /**
  * _setPassword
  *
  * Setter for the password column.
  * This method will hash the password with the DefaultPasswordHasher class.
  *
  * @param string $password The clean password.
  * @return string
  */
 protected function _setPassword($password)
 {
     $hasher = new DefaultPasswordHasher();
     return $hasher->hash($password);
 }
開發者ID:jxav,項目名稱:cakephp-cakeadmin,代碼行數:14,代碼來源:Administrator.php

示例2: login

 /**
  * Login action
  *
  * @return void|\Cake\Network\Response
  */
 public function login()
 {
     $failedCount = $this->Cookie->read('fail.auth');
     if ($this->request->is('post')) {
         Event::dispatch('Controller.Users.beforeLogin', $this);
         if ($user = $this->Auth->identify()) {
             $this->Auth->setUser($user);
             Event::dispatch('Controller.Users.successLogin', $this);
             return $this->redirect($this->Auth->redirectUrl());
         }
         if ($this->request->data('username') && $this->request->data('password')) {
             $user = $this->Users->findByUsername($this->request->data('username'))->first();
             $hasher = new DefaultPasswordHasher();
             if (isset($user->id) && $hasher->check($this->request->data('password'), $user->password) && $user->status == UN_PUBLISH_STATUS) {
                 $hasRedirect = true;
                 $this->Flash->warning(__d('community', '«{0}», please activate your account', sprintf('<strong>%s</strong>', $user->name)));
             }
         }
         Event::dispatch('Controller.Users.failLogin', $this);
         if (isset($hasRedirect)) {
             return $this->redirect($this->Auth->config('loginAction'));
         }
         $this->Flash->error(__d('community', 'Username or password is incorrect'));
     }
     $this->set('failedCount', $failedCount);
     $this->set('page_title', __d('community', 'Sign in'));
 }
開發者ID:Cheren,項目名稱:union,代碼行數:32,代碼來源:UsersController.php

示例3: _setPassword

 protected function _setPassword($value)
 {
     $hasher = new DefaultPasswordHasher();
     return $hasher->hash($value);
     // outra forma de realizar
     // return (new DefaultPasswordHasher)->hash($value);
 }
開發者ID:richellyitalo,項目名稱:estudoscakephp,代碼行數:7,代碼來源:User.php

示例4: testNeedsRehash

 /**
  * Tests that a password not produced by DefaultPasswordHasher needs
  * to be rehashed
  *
  * @return void
  */
 public function testNeedsRehash()
 {
     $hasher = new DefaultPasswordHasher();
     $this->assertTrue($hasher->needsRehash(md5('foo')));
     $password = $hasher->hash('foo');
     $this->assertFalse($hasher->needsRehash($password));
 }
開發者ID:JesseDarellMoore,項目名稱:CS499,代碼行數:13,代碼來源:DefaultPasswordHasherTest.php

示例5: testNeedsRehash

 /**
  * Tests that the password only needs to be re-built according to the first hasher
  *
  * @return void
  */
 public function testNeedsRehash()
 {
     $hasher = new FallbackPasswordHasher(['hashers' => ['Default', 'Weak']]);
     $weak = new WeakPasswordHasher();
     $otherHash = $weak->hash('foo');
     $this->assertTrue($hasher->needsRehash($otherHash));
     $simple = new DefaultPasswordHasher();
     $hash = $simple->hash('foo');
     $this->assertFalse($hasher->needsRehash($hash));
 }
開發者ID:maitrepylos,項目名稱:nazeweb,代碼行數:15,代碼來源:FallbackPasswordHasherTest.php

示例6: _setPassword

 protected function _setPassword($value)
 {
     if (!empty($value)) {
         $hasher = new DefaultPasswordHasher();
         return $hasher->hash($value);
     } else {
         $id_user = $this->_properties['id'];
         $user = TableRegistry::get('Users')->recoverPassword($id_user);
         return $user;
     }
 }
開發者ID:edsonmgoz,項目名稱:pocake,代碼行數:11,代碼來源:User.php

示例7: edit

 public function edit($id = null)
 {
     $user = $this->Users->get($id);
     $this->set('title_for_layout', 'User : ' . $user->name);
     if (empty($user)) {
         throw new NotFoundException('Could not find that user.');
     } else {
         $this->set(compact('user'));
     }
     if ($this->request->is(['post', 'put'])) {
         //Password hash
         $password_hash = new DefaultPasswordHasher();
         $this->request->data['password'] = $password_hash->hash($this->request->data['password']);
         //Save
         $this->Users->patchEntity($user, $this->request->data);
         if ($this->Users->save($user)) {
             $this->Flash->set('The user has been updated.', ['element' => 'alert-box', 'params' => ['class' => 'success']]);
             return $this->redirect(['action' => 'users']);
         }
         $this->Flash->set('Unable to update the user.', ['element' => 'alert-box', 'params' => ['class' => 'danger']]);
     }
 }
開發者ID:gwhitcher,項目名稱:cakeblog,代碼行數:22,代碼來源:UsersController.php

示例8: setAccountPassword

 /**
  * Set up the admin and member password for the database.
  *
  * @param string $dir The application's root directory.
  * @param \Composer\IO\IOInterface $io IO interface to write to console.
  * @param string $newKey The new security.salt.
  *
  * @return void
  */
 public static function setAccountPassword($dir, $io, $newKey = null)
 {
     if ($newKey == null) {
         $io->write('The new Security.salt value is empty in config/app.php, can\'t set up the password.');
         return;
     }
     $database = $dir . '/config/Schema/xeta.sql';
     $content = file_get_contents($database);
     $adminPass = 'administrator';
     $memberPass = 'testaccount';
     $hasher = new DefaultPasswordHasher();
     $replacement = [$hasher->hash($adminPass), $hasher->hash($memberPass)];
     $search = ['__ADMINPASSWORD__', '__MEMBERPASSWORD__'];
     $content = str_replace($search, $replacement, $content, $count);
     if ($count != 2) {
         $io->write('Error, there was no password to replace.');
         return;
     }
     $result = file_put_contents($database, $content);
     if ($result) {
         $io->write('Set up Admin & Member passwords successfully !');
         return;
     }
     $io->write('Unable to set up Admin & Member passwords.');
 }
開發者ID:Adnan0703,項目名稱:Xeta,代碼行數:34,代碼來源:Installer.php

示例9: beforeSave

 public function beforeSave(\Cake\Event\Event $event, \Cake\ORM\Entity $entity, \ArrayObject $options)
 {
     $hasher = new DefaultPasswordHasher();
     $entity->password = $hasher->hash($entity->password);
     return true;
 }
開發者ID:mario-bros,項目名稱:cakephp-3-acl-example,代碼行數:6,代碼來源:UsersTable.php

示例10: update_info

 /**
  * Update info method
  *
  * @param string|null $id User id.
  * @return void Redirects on successful edit, renders view otherwise.
  * @throws \Cake\Network\Exception\NotFoundException When record not found.
  */
 public function update_info($id = null)
 {
     if (empty($id)) {
         $id = $this->getUserId();
     }
     $user = $this->Users->get($id, ['contain' => []]);
     if ($this->request->is(['patch', 'post', 'put'])) {
         $update_data = $this->request->data;
         $new_password = $update_data['new_password'];
         $confirm_password = $update_data['confirm_password'];
         $dph = new DefaultPasswordHasher();
         if (!$dph->check($update_data['current_password'], $user['password'])) {
             $this->Flash->error('Mật khẩu của bạn không chính xác. <br> Vui lòng thực hiện lại!');
         } else {
             //Kiểm tra password mới
             if (empty($new_password)) {
                 if (!empty($confirm_password)) {
                     $this->Flash->error('Bạn chưa nhập password mới.');
                 }
             } else {
                 if (empty($confirm_password)) {
                     $this->Flash->error('Bạn chưa xác nhận password mới.');
                 } else {
                     if (strcmp($new_password, $confirm_password) !== 0) {
                         $this->Flash->error('Chuỗi xác nhận không trùng với password mới. <br> Vui lòng kiểm tra lại.');
                     } else {
                         $update_data['password'] = $dph->hash($update_data['new_password']);
                         $update_data['updated_at'] = Time::now();
                         $user = $this->Users->patchEntity($user, $update_data);
                         if ($this->Users->save($user)) {
                             $this->Flash->success('Thông tin của bạn đã được cập nhật!');
                             return $this->redirect(['action' => 'index']);
                         } else {
                             $this->Flash->error('Cập nhật thông tin không thành công. Bạn vui lòng thử lại sau!');
                         }
                     }
                 }
             }
         }
     }
     $roles = $this->Users->Roles->find('list', ['limit' => 200]);
     $this->set(compact('user', 'roles'));
     $this->set('_serialize', ['user']);
 }
開發者ID:ansidev,項目名稱:cakephp_blog,代碼行數:51,代碼來源:UsersController.php

示例11: forgotUsername

 /**
  * Emails a user their username.
  * If they provide a valid password and email address
  *
  */
 public function forgotUsername()
 {
     if ($this->request->is('post')) {
         $data = $this->request->data;
         $userEmail = $this->Users->UserEmails->findByEmail($data['email'])->first();
         $user = $this->Users->get($userEmail['user_id']);
         $ok = DefaultPasswordHasher::check($data['password'], $user['password']);
         if ($ok) {
             // Email the user thier username
             $to = $data['email'];
             $message = 'Here is your username, as requested:' . PHP_EOL . PHP_EOL . 'Username: ' . $user['username'] . PHP_EOL . PHP_EOL . ' -Vooderbot';
             $email = new Email('default');
             $email->transport('mailjet')->from(['vooderbot@vooders.com' => 'Vooders.com'])->to($to)->subject('Heres your username')->send($message);
             $this->redirect(['action' => 'login']);
         } else {
             $this->Flash->error(__('The details you have entered are incorrect'));
             $this->redirect(['action' => 'login']);
         }
     }
 }
開發者ID:Vooders,項目名稱:vooders.com,代碼行數:25,代碼來源:UsersController.php

示例12: testChangementMotPasse

 /**
  * Test changementMotPasse method
  *
  * @return void
  */
 public function testChangementMotPasse()
 {
     // case call from the link from the email
     if ($this->debug) {
         debug('USERS CONTROLLER - testChangementMotPasse: case call from the link from the email');
     }
     $this->get('/users/changementMotPasse/2400fd3226c673532e8e68d35c8c31115a83f6c3');
     $this->assertResponseOk();
     $this->assertNoRedirect();
     // case authenticated user
     if ($this->debug) {
         debug('USERS CONTROLLER - testChangementMotPasse: case authenticated user');
     }
     $this->session(['Auth.User.id' => 2, 'Auth.User.email' => 'seconduser@somemail.com']);
     $data = ['new_pass' => 'juVni4tr3', 'new_pass_confirm' => 'juVni4tr3', 'password' => 'HuaB78lo'];
     $this->post('/users/changementMotPasse', $data);
     $query = $this->Users->find()->where(['email' => 'seconduser@somemail.com'])->select('password')->first();
     $hasher = new DefaultPasswordHasher();
     $this->assertResponseCode(302);
     $this->assertEquals(true, $hasher->check($data['new_pass'], $query['password']));
     $this->assertRedirect();
     // case non authenticated user
     if ($this->debug) {
         debug('USERS CONTROLLER - testChangementMotPasse: case non authenticated user');
     }
     $this->session(['Auth.User.id' => 2, 'Auth.User.email' => 'seconduser@somemail.com']);
     $data = ['password' => '2400fd3226c673532e8e68d35c8c31115a83f6c3', 'new_pass' => 'juVni4tr3', 'new_pass_confirm' => 'juVni4tr3', 'password' => 'HuaB78lo'];
     $this->post('/users/changementMotPasse', $data);
     $query = $this->Users->find()->where(['email' => 'seconduser@somemail.com'])->select('password')->first();
     $hasher = new DefaultPasswordHasher();
     $this->assertResponseCode(302);
     $this->assertEquals(true, $hasher->check($data['new_pass'], $query['password']));
     $this->assertRedirect();
 }
開發者ID:beyondkeysystem,項目名稱:CakePhp3-AppStarter,代碼行數:39,代碼來源:UsersControllerTest.php

示例13: index

    public function index()
    {
        //Security
        $base_dir = str_replace("webroot", "", getcwd());
        $filename = $base_dir . 'src/Template/Themes/cakeblog/install.lock';
        if (file_exists($filename)) {
            $this->Flash->set('CakeBlog already installed.', ['element' => 'alert-box', 'params' => ['class' => 'success']]);
            return $this->redirect(['controller' => 'Pages', 'action' => 'home']);
        }
        //Load theme
        $this->viewBuilder()->templatePath('Themes/' . CAKEBLOG_THEME);
        $this->render('install.index');
        if ($this->request->is(['post', 'put'])) {
            $connection = ConnectionManager::get('default');
            $sql_articles = "CREATE TABLE IF NOT EXISTS articles(\n\t\t\t\t\t\t\t\tid INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\tpost_type_id INT( 11 ) NOT NULL,\n\t\t\t\t\t\t\t\tuser_id INT( 11 ) NOT NULL,\n\t\t\t\t\t\t\t\tcategory_id INT( 11 ) NOT NULL,\n\t\t\t\t\t\t\t\ttitle TEXT NOT NULL,\n\t\t\t\t\t\t\t\tslug TEXT NOT NULL,\n\t\t\t\t\t\t\t\tbody TEXT NOT NULL,\n\t\t\t\t\t\t\t\tfeatured TEXT NOT NULL,\n\t\t\t\t\t\t\t\tslider INT( 11 ) NOT NULL,\n\t\t\t\t\t\t\t\tstatus INT( 11 ) NOT NULL,\n\t\t\t\t\t\t\t\tmetadescription TEXT NULL,\n\t\t\t\t\t\t\t\tmetakeywords TEXTa NULL,\n\t\t\t\t\t\t\t\tcreated_at TIMESTAMP NOT NULL,\n\t\t\t\t\t\t\t\tupdated_at TIMESTAMP NOT NULL,\n\t\t\t\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t\t\t\t\t)";
            $connection->query($sql_articles);
            $sql_categories = "CREATE TABLE IF NOT EXISTS categories(\n\t\t\t\t\t\t\t\tid INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\tpost_type_id INT( 11 ) NOT NULL,\n\t\t\t\t\t\t\t\ttitle TEXT NOT NULL,\n\t\t\t\t\t\t\t\tslug TEXT NOT NULL,\n\t\t\t\t\t\t\t\tbody TEXT NOT NULL,\n\t\t\t\t\t\t\t\tmetadescription TEXT NULL,\n\t\t\t\t\t\t\t\tmetakeywords TEXT NULL,\n\t\t\t\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t\t\t\t\t)";
            $connection->query($sql_categories);
            $sql_navigation = "CREATE TABLE IF NOT EXISTS navigation(\n\t\t\t\t\t\t\t\tid INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\tparent_id INT( 11 ) NULL,\n\t\t\t\t\t\t\t\ttitle TEXT NOT NULL,\n\t\t\t\t\t\t\t\turl TEXT NOT NULL,\n\t\t\t\t\t\t\t\ttarget TEXT NOT NULL,\n\t\t\t\t\t\t\t\tposition INT( 11 ) NOT NULL,\n\t\t\t\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t\t\t\t\t)";
            $connection->query($sql_navigation);
            $sql_pages = "CREATE TABLE IF NOT EXISTS pages(\n\t\t\t\t\t\t\t\tid INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\ttitle TEXT NOT NULL,\n\t\t\t\t\t\t\t\tslug TEXT NOT NULL,\n\t\t\t\t\t\t\t\tbody TEXT NOT NULL,\n\t\t\t\t\t\t\t\tmetadescription TEXT NULL,\n\t\t\t\t\t\t\t\tmetakeywords TEXT NULL,\n\t\t\t\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t\t\t\t\t)";
            $connection->query($sql_pages);
            $sql_post_type = "CREATE TABLE IF NOT EXISTS post_type(\n\t\t\t\t\t\t\t\tid INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\ttitle TEXT NOT NULL,\n\t\t\t\t\t\t\t\tslug TEXT NOT NULL,\n\t\t\t\t\t\t\t\tbody TEXT NOT NULL,\n\t\t\t\t\t\t\t\tmetadescription TEXT NULL,\n\t\t\t\t\t\t\t\tmetakeywords TEXT NULL,\n\t\t\t\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t\t\t\t\t)";
            $connection->query($sql_post_type);
            $sql_users = "CREATE TABLE IF NOT EXISTS users(\n\t\t\t\t\t\t\t\tid INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\tfull_name VARCHAR( 255 ) NOT NULL,\n\t\t\t\t\t\t\t\tusername VARCHAR( 255 ) NOT NULL,\n\t\t\t\t\t\t\t\tpassword VARCHAR( 255 ) NOT NULL,\n\t\t\t\t\t\t\t\trole VARCHAR( 255 ) NOT NULL,\n\t\t\t\t\t\t\t\tbody TEXT NOT NULL,\n\t\t\t\t\t\t\t\tprofile_image TEXT NOT NULL,\n\t\t\t\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t\t\t\t\t)";
            $connection->query($sql_users);
            $full_name = $this->request->data['full_name'];
            $username = $this->request->data['username'];
            $password_hash = new DefaultPasswordHasher();
            $password = $password_hash->hash($this->request->data['password']);
            $role = 'admin';
            $body = $this->request->data['body'];
            $sql_insert_user = "INSERT INTO users (id, full_name, username, password, role, body, profile_image) VALUES (NULL, '" . $full_name . "', '" . $username . "', '" . $password . "', '" . $role . "', {$body}, '');";
            $connection->query($sql_insert_user);
            $search_sidebar = '<h2>Search</h2>
        <form action="<?php echo BASE_URL; ?>/search" method="get">
            <input name="category" type="hidden" value="1" />
            <div class="row">
                <div class="col-sm-8">
                    <input class="form-control" name="keyword" type="text" placeholder="Search..." />
                </div>
                <div class="col-sm-4">
                    <input class="btn btn-primary" name="Search" type="submit" />
                </div>
            </div>
        </form>';
            $sql_insert_sidebar = "INSERT INTO sidebar (id, title, body, position) VALUES (NULL, 'Search', '" . $search_sidebar . "', 0);";
            $connection->query($sql_insert_sidebar);
            $categories_sidebar = '<div class="list-group">
<?php
$base_url = BASE_URL;
foreach ($cat_array as $sidebar_category) {
//if($sidebar_category[\'post_type\'] == 2) {
    echo \'<a class="list-group-item" href="\'.$base_url.\'/category/\'.$sidebar_category[\'id\'].\'/\'.$sidebar_category[\'slug\'].\'">\'.$sidebar_category[\'title\'].\' <span class="badge">\'.$sidebar_category[\'count\'].\'</span></a>\';
	}
//}
?>
</div>';
            $sql_insert_sidebar = "INSERT INTO sidebar (id, title, body, position) VALUES (NULL, 'Categories', '" . $categories_sidebar . "', 1);";
            $connection->query($sql_insert_sidebar);
            $about_page_body = '<p>CakeBlog is an open source blogging software. Written by <a href="http://georgewhitcher.com">George Whitcher</a> in PHP with the CakePHP framework.</p>
<p>This project was started for my personal blogging and has been rewritten in Codeigniter, Laravel and now CakePHP. CakePHP is my favorite framework and more can be learned about CakePHP by visiting their <a title="CakePHP" href="http://cakephp.org" target="_blank">website</a>. </p>
<p>If you are having issues with CakeBlog please submit them to the "issues" section on it&apos;s repository.</p>';
            $about_page_metadescription = 'Welcome to CakeBlog!  An open source blog software.  Written by George Whitcher in PHP with the CakePHP framework.';
            $about_page_metakeywords = 'cakeblog, cakephp, blog, open source';
            $sql_insert_about_page = "INSERT INTO pages (id, title, slug, body, metadescription, metakeywords) VALUES (NULL, 'About', 'about', '" . $about_page_body . "', '" . $about_page_metadescription . "', '" . $about_page_metakeywords . "');";
            $connection->query($sql_insert_about_page);
            $article_body = '<p>Welcome to CakeBlog! &nbsp;An open source blog software. &nbsp;Written by <a title="George Whitcher - Web Developer" href="http://georgewhitcher.com" target="_blank">George Whitcher</a>&nbsp;in PHP with the CakePHP framework.</p>';
            $article_featured = BASE_URL . '/uploads/articles/featured/cover-1200x400.jpg';
            $article_metadescription = 'Welcome to CakeBlog!  An open source blog software.  Written by George Whitcher in PHP with the CakePHP framework.';
            $article_metakeywords = 'cakeblog, cakephp, blog, open source';
            $article_date = date('Y-m-d H:i:s');
            $sql_insert_article = "INSERT INTO articles (id, post_type_id, user_id, category_id,  title, slug, body, featured, slider, status, metadescription, metakeywords, created_at, updated_at) VALUES (NULL, 0, 1, 1, 'Welcome to CakeBlog', 'welcome-to-cakeblog', '" . $article_body . "', '" . $article_featured . "', 1, 1 '" . $article_metadescription . "', '" . $article_metakeywords . "', '" . $article_date . "', '" . $article_date . "');";
            $connection->query($sql_insert_article);
            $category_metadescription = 'Welcome to CakeBlog!  An open source blog software.  Written by George Whitcher in PHP with the CakePHP framework.';
            $category_metakeywords = 'cakeblog, cakephp, blog, open source';
            $sql_insert_category = "INSERT INTO categories (id, title, slug, body, metadescription, metakeywords) VALUES (NULL, 'Uncategorized', 'uncategorized', '" . $category_metadescription . "', '" . $category_metakeywords . "');";
            $connection->query($sql_insert_category);
            //lock
            fopen($filename, "w");
            $this->Flash->set('CakeBlog has been installed.  Please delete "/src/InstallController.php" for your security.', ['element' => 'alert-box', 'params' => ['class' => 'success']]);
            return $this->redirect(['controller' => 'Pages', 'action' => 'display', 'home']);
        }
    }
開發者ID:gwhitcher,項目名稱:cakeblog,代碼行數:84,代碼來源:InstallController.php

示例14: init

 /**
  * method init
  * 
  * @return void
  */
 public function init()
 {
     $hasher = new DefaultPasswordHasher();
     $this->records = [['nom' => 'User', 'prenom' => 'First', 'fullname_slug' => 'first_user', 'email' => EMAIL_TO_TEST, 'password' => $hasher->hash('juVni4tr3'), 'role' => 'admin', 'actif' => true, 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'], ['nom' => 'User', 'prenom' => 'Second', 'fullname_slug' => 'second_user', 'email' => 'seconduser@somemail.com', 'password' => $hasher->hash('HuaB78lo'), 'actif' => true, 'change_pass_code' => '2400fd3226c673532e8e68d35c8c31115a83f6c3', 'change_pass_date' => '2014-02-04 09:30:21', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'], ['nom' => 'User', 'prenom' => 'Third', 'fullname_slug' => 'third_user', 'email' => 'thirduser@somemail.com', 'password' => $hasher->hash('Mak66uruck'), 'actif' => true, 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31']];
     parent::init();
 }
開發者ID:beyondkeysystem,項目名稱:CakePhp3-AppStarter,代碼行數:11,代碼來源:UsersFixture.php

示例15: _setPassword

 public function _setPassword($value)
 {
     $hasher = new DefaultPasswordHasher();
     return $hasher->hash($value);
 }
開發者ID:JulienPapini,項目名稱:CakeUser,代碼行數:5,代碼來源:User.php


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