Hello all,
Here’s the thing:
Scheme:
I have a classDAO that extends abstractDAO and that abstract DAO requires on his constructor a myPDO singleton class.
On each class DAO I can now successfully prepare statements and execute queries into the database;
On this scheme I need to put a login class and here’s what I’m thinking:
On a given php file I will:
1- Instantiate a DAOobject
2- Instantiate a LoginObject
This LoginObject will have a method called logIn;
That logIn will accept three params (one optional): $user, $pass, $redirect = false;
Since I don’t need the DAO object on all the extension of the LoginObject,
I’m thinking on doing a require_once of the DAO inside the logIn method. After that, I was thinking on doing the query that verifies is the $user and $pass are correct and if so, put them on a session and (if set, do the $redirect).
Question:
Before I spend long time into this. -
Will we be able to query the database on our logIn method like we do on the other DAO classes, or that require will not properly work ?
Any suggestion about a better way to integrate the login into the scheme mentioned above?
Thanks a lot,
Márcio