This class performs the access control users on a system.
This class can authenticate users in a database.
it's performs a query to the database, retrieve the hashed password
of the user account via e-mail.
The class compares the typed password
with the password database to verify that it is correct for the given user.
EXAMPLE :
$endereco = new Lou_Auth_User('mail@domain.com', 'xxxxxxxxxx');
var_dump($endereco->isAuthUser());
If you do not want to use the Lou_registo.php file,
you can create the table "users" in the database "test" and visit the site
http://online-code-generator.com/md5-hash-with-optional-salt.php
to generate the md5 hash.
Must then insert it into the database table.
//criar tabela users
'CREATE TABLE IF NOT EXISTS users (
id INT(5) NOT NULL AUTO_INCREMENT,
password VARCHAR(128) NOT NULL,
email VARCHAR(255) NOT NULL,
PRIMARY KEY(id),
UNIQUE KEY(email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1';
|