Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Here is the documentation of Login and authentication
Yes, I saw this. But I can't understand how can I access the database? So my problem is related to the access to database. I have to select the user that have certain username in the database and I have to check the password. Can I use the "DataSource" module? and How? or I have to use the "php mysqli"? so creating a connection with the database
In our example you use AutoMaker datasource, so in the authenticate() function you simply do.
->authenticate(function($username,$password) {
$users = AutoMaker::table("users")
->where("username",$username)
->where("password",md5($password))
->run();
// The $users is DataStore object which contain list of user,
// something like Collection class in Laravel if you know.
$user = $users->get(0);
if($user==null) return false;
return User::create()
->id($user["id"])
->name($user["name"]);
})
Above code is just an example of how to use DataSource.
Hope that helps.
Please refer to this answer to know how to create the data connection to your database.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo