I've been asked to use mysql users to login in a cakephp application.
I want to use the username and password from a login form and use it like this in the database.php config file.
class DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => $user,
'password' => $password,
'database' => 'cakephp',
'prefix' => '',
//'encoding' => 'utf8',
);
}
To use the existing users in the mysql database, if it is possible this way. If it´s not, is there any other way to do this??
I´ve just found this to add to the class:
function __construct(){
$this->default['login'] = $userSentFromForm;
$this->default['password'] = $passwordSentFromForm;
}
But i don't get how to retrieve the login and password from the form and send it to the constructor in the $userSentFromForm and $passwordSentFromForm variables.