Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Save duplicate emails, username and password
  • With our recent development, I have this scenario:

    -We have two websites (contains lesson reservation) and they are sharing the same database. 
    -Upon signing up for the both websites, they have to save it in "users" table and they will be categorized if they are from the first website or the other.

    Here's the problem:
    When I try to signup for both websites using the same email, username and password, it doesn't allow me. It keeps on telling "Email address already exists". I trace this error and I found it in "packages" folder, someone told us not to touch this since frameworks keeps on updating its default files. 

    I also tried to override this "packages" conditions using the bootstrap Autoloader, when I tried to do so, it just replace the existing data, it does not make a new row of data in the database.

    Is there anyway I could get out from this situation?
  • HarroHarro
    Accepted Answer
    Auth uses the email address as a login name, so it has to be unique.

    If you want to change this, you need a migration to remove the unique index on the email column (and add it again on a down migration), and you need to overload the login() and create_user() methods of the Auth login driver you use to remove the check of a unique email address, and remove the option to login with email address.

Howdy, Stranger!

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

In this Discussion