GithubHelp home page GithubHelp logo

Too few fields for users about gatekeeper HOT 4 OPEN

psecio avatar psecio commented on August 21, 2024
Too few fields for users

from gatekeeper.

Comments (4)

enygma avatar enygma commented on August 21, 2024

Good point - the library this was modeled after (Sentry) only had a few user fields in it. I think it's definitely reasonable to add a "user attributes" kind of setup to allow for much more flexible user details to be stored along with the core information. I'd say that username, password, email and things like that should stay in the users table but I could definitely see the attributes being used for other things.

from gatekeeper.

Ser5 avatar Ser5 commented on August 21, 2024

I can think of a few more ways of implementing additional fields. Don't know if they are "Gatekeeper-way" or easy to code, though.
1.) Most straightforward is inheriting UserModel, adding some fields to $properties variable, adding fields to database accordingly, then use Gatekeeper::init() to force usage of inherited class, something like Gatekeeper::init(blah, array('UserModel' => '\My\User\Model'))
2.) Make UserModel configurable, so one can pass his own array of properties to UserModel constructor. Then you pass configured UserModel to Gatekeeper::init(). Of course manual adjustment of users table is required too.
3.) Doctrine & Symfony2 way. You create your own User class containing any set of fields then say "Doctrine, use it, please", then magic occurs, users table modified automatically and everything works. Kind of. Both Doctrine and Symfony2 are too much complicated and I doubt that it will be easy to implement and use.

from gatekeeper.

Ser5 avatar Ser5 commented on August 21, 2024

0.) Mostest of the most simple variants: you add dozen more of fields into UserModel, enough for 99% of users - middleName, homeAddress, homePhone, workAddress, workPhone, mobilePhone etc - and make a new release =)

from gatekeeper.

Swader avatar Swader commented on August 21, 2024

I would recommend against having non-auth info in Gatekeeper - you can easily extend the model and DB setup to have linked followup tables etc. Have a table in your own app logic like users_contact or users_personal etc and just link them to the gatekeeper tables - that way we keep GK lean, and you still get full flexibility for your app.

from gatekeeper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.