Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Relating ORM Models to Users, using simpleauth
  • Not really sure how to approach this. Using SimpleAuth There isn't a model defined for Users so how do you go about relating other ORM objects to users in the users table?
  • The layout has been completely changed recently, there are still quite a few issues that need to be fixed.
  • Just make a model.
    class Model_Users extends Orm/Model {}
    

    The auth package is for auth work. ORM models are for interacting with ORM.
  • To use simple auth I created a scaffold for the users table...I don't have the migration available, but here is the SQL you need.
    CREATE TABLE `simpleusers` (
    `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `username` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
    `password` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
    `group` INT NOT NULL DEFAULT 1 ,
    `email` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
    `last_login` VARCHAR( 25 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
    `login_hash` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
    `profile_fields` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
    UNIQUE (
    `username` ,
    `email`
    )
    ) http://fuelphp.com/docs/packages/auth/simpleauth/login.html Team: not sure what's going on... but I'm using Firefox 3.6.17 on WinXP (work computer, ugh) and it won't let me use the formatting toolbar.

Howdy, Stranger!

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

In this Discussion