Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Creating my own login driver - some questions.
  • Hi everyone, I'm creating a login driver based on SimpleAuth, and some questions came to mind.
    From what I can see, the 'profile_fields' column in the user table is not mandatory, being just part of the SimpleAuth implementation, right?
    I need some extra columns (name, age, country, ...) that the SimpleAuth doesn't account for at this time.
    Does it make sense to add them to the table, or just add them to a serialized array stored in the 'profile_fields' column?
    My main concern here is validation, since the Orm/Validation are not suposed to validate that kind of data, forcing me to validate in another way. Also, for the moment I don't want to associate users to groups (I just don't need it).
    Does implementing the get_groups() method to return false or an empty array makes sense? Cheers,
    Quetzy
  • This depends on whether you're extending SimpleAuth or the Auth_Login_Driver. Based on the latter no field is mandatory, only the methods from the abstract base driver are mandatory where you get the information from and how that looks is completely up to you.
    If you are extending SimpleAuth you are of course bound to that implementation and you'll have to work with what that already has. In general for any serious application you'd write you own driver, SimpleAuth is meant as an example and quickstart option. Thus of course it's better to add those columns as properties instead of into a serialized field. Implementing the get_groups() method should return an empty array if you don't want to use it. (check out the base driver code comments, those describe the expected output)
  • Hi Jelmer, Yes, I'm currently extending the Auth_Login_Driver, using SimpleAuth only as a base for better understanding. Thanks for your time :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion