Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fawno/drupalpasswordhasher

DrupalPasswordHasher for CakePHP
https://github.com/fawno/drupalpasswordhasher

cakephp php

Last synced: about 1 month ago
JSON representation

DrupalPasswordHasher for CakePHP

Awesome Lists containing this project

README

        

[![](https://img.shields.io/github/license/fawno/DrupalPasswordHasher.svg?style=plastic)](https://github.com/fawno/DrupalPasswordHasher/blob/master/LICENSE)

# DrupalPasswordHasher
DrupalPasswordHasher for CakePHP 3.x

## Install
```bash
composer require fawno/drupal-password-hasher
```

## Config AppController.php
```php
use Fawno\Auth\DrupalPasswordHasher;

$this->loadComponent('Auth', [
'authenticate' => [
'Form' => [
'passwordHasher' => DrupalPasswordHasher::class,
'fields' => [
'username' => 'username',
'password' => 'password',
]
]
],
]);
```
## Config Model/Entity/User.php
```php
use Fawno\Auth\DrupalPasswordHasher;

class User extends Entity {
protected function _setPassword ($value) {
if (strlen($value)) {
$hasher = new DrupalPasswordHasher();

return $hasher->hash($value);
}
}
}
```