PHP Class FOC\Authenticate\Auth\MultiColumnAuthenticate
Provides the ability to authenticate using POST data. The username form input
can be checked against multiple table columns, for instance username and email
$this->Auth->config('authenticate', [
'Authenticate.MultiColumn' => [
'fields' => [
'username' => 'username',
'password' => 'password'
],
'columns' => ['username', 'email'],
'userModel' => 'Users',
'scope' => ['User.active' => 1]
]
]);
Licensed under The MIT License
For full copyright and license information, please see the LICENSE.txt
Show file
Open project: friendsofcake/authenticate
Public Methods
Method |
Description |
|
__construct ( Cake\Controller\ComponentRegistry $registry, array $config ) |
Constructor |
|
Protected Methods
Method Details
__construct()
public method
Besides the keys specified in BaseAuthenticate::$_defaultConfig,
MultiColumnAuthenticate uses the following extra keys:
- 'columns' Array of columns to check username form input against
public __construct ( Cake\Controller\ComponentRegistry $registry, array $config ) |
$registry |
Cake\Controller\ComponentRegistry |
The Component registry
used on this request. |
$config |
array |
Array of config to use. |
_findUser()
protected method
Find a user record using the standard options.
protected _findUser ( string $username, string $password = null ) : boolean | array |
$username |
string |
The username/identifier. |
$password |
string |
The password, if not provide password checking is
skipped and result of find is returned. |
return |
boolean | array |
Either false on failure, or an array of user data. |