+1 for Niels. Massimo, your too good a guy to help us. :P I am sure you know people in this. There are people all around the world ready to help you out. I wish I knew more, then I would help. But I am sure I can do something in the documentation. Don't be scared to ask people for help. :D Regards, Jason Brower On Sun, 2009-03-22 at 08:31 -0700, notabene wrote: > Hi Massimo > > Thank You for Your great work. I have the impression that You are a > "one-man army", that design, develop, make documentation, teach and > support. > > But (always a but?) if I may suggest an improvement: When You get > these questions. Why not refer to the best available documentation? In > this case to http://web2py.com/examples/default/tools. And then if > there is no available documentation - try get the time to update the > documentation. > > Best regards > > Niels Bjerre > > On Mar 21, 8:38 pm, mdipierro <[email protected]> wrote: > > 1. is correct. You can create your own tables but I would let web2py > > do it for you. Here is the minimal *complete* code you need > > > > #in model db.py > > from gluon.tools import * > > auth=Auth(globals(),db) > > auth.define_tables() > > > > #in default.py > > def user(): return auth() > > > > The latter action will > > exposehttp://..../yourapp/default/user/loginhttp://..../yourapp/default/user/logouthttp://..../yourapp/default/user/registerhttp://..../yourapp/default/user/retrieve_passwordhttp://..../yourapp/default/user/change_passwordhttp://..../yourapp/default/user/profile > > > > You can check if a user is logged in by auth.is_logged_in(). You can > > get the current user with auth.user. You can decorate actions that > > need login > > > > @auth.requires_login() > > > > This can do a lot more like role based access control. > > > > The plan is to create Auth implementations on top of LDAP, etc. > > exposing the same interface. We could use help in this direction. > > > > Massimo > > > > On Mar 21, 10:42 am, Anand Vaidya <[email protected]> wrote: > > > > > Hi > > > > > I am a bit lost with the Authentication / Authorization in web2py. I > > > am using v1.58 > > > > > What I need: > > > > > My current needs are quite minimal. Given a username and password (in > > > a form), verify the user:pass and let the user in. Block all functions > > > if anonymous or failed auth. I do not want to use any db (sqlite/ > > > mysql) for storage of these info, but need to use an ASCII text file. > > > > > I am generating a simple file that looks like apache htpasswd ( user : > > > md5hashed-password) using python md5 module. I am avoiding Apache's > > > own htpasswd since the algorithm is too complicated. > > > > > My understanding from the docs and this list is that , the web2py > > > provided Auth controller will work only with a DB and also generates > > > Login, Register , Recaptcha etc which I do not need (In fact the app > > > owner does not allow new self-registrations) > > > > > My questions: > > > > > 1. Is my statement above correct? > > > > > 2. How do solve the auth part? > > > > > 3. If we need to extend the auth to AD, LDAP, /etc/passwd, NIS, > > > htpasswd, Samba, MySQL etc , is there a generic solution? Are there > > > any plans in web2py development to abstract out the steps? > > > > > I have already completed the project with CherryPy and Genshi but was > > > forced to abandon the work due to problems with IE and am recoding in > > > Web2Py > > > > > Regards > > > Anand > >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

