Allright, I'm not really sure where to start. I'm trying to get a generic user folder working with SQL in order to allow me to insert users using OBDC to the database from another computer. I've managed to get the userList and userRoles returning data from the database fine. What I'm stuck on is getting userAuthenticate to work, I've made a dtml method named userAuthenticate that's a proxy with manager access. The Z SQL method is GetAuthInfo and does a select of the username and password fields from the database when the fields match the username and password that is passed to them. That works great. Only thing I'm missing is how to get my DTML in userAuthenticate to work and return a 1 when GetAuthInfo finds matching username/password fields, and return 0 when it doesn't. Am I missing something really silly here? Are there examples out there of what I'm trying to do? Am I going about this all wrong? I'm completly lost here and would be gratefull for any and all sugestions. # Daniel Pfile # I have no cool signature. # pfiled@marietta.edu # Finger for free illegal software.
hi daniel, <untested> have you looked at the <dtml-return> - tag? it is described in the <dtml-return> section of the Z Document Template Markup Language Reference under http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.12.html it sounds like what you're looking for. you could test for the return value in the calling document/method. </untested> jens
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Daniel Pfile Sent: Sunday, November 28, 1999 07:56 To: zope@zope.org Subject: [Zope] Generic User Folder and SQL
Allright, I'm not really sure where to start. I'm trying to get a generic user folder working with SQL in order to allow me to insert users using OBDC to the database from another computer. I've managed to get the userList and userRoles returning data from the database fine. What I'm stuck on is getting userAuthenticate to work, I've made a dtml method named userAuthenticate that's a proxy with manager access. The Z SQL method is GetAuthInfo and does a select of the username and password fields from the database when the fields match the username and password that is passed to them. That works great. Only thing I'm missing is how to get my DTML in userAuthenticate to work and return a 1 when GetAuthInfo finds matching username/password fields, and return 0 when it doesn't.
Am I missing something really silly here? Are there examples out there of what I'm trying to do? Am I going about this all wrong?
I'm completly lost here and would be gratefull for any and all sugestions.
# Daniel Pfile # I have no cool signature. # pfiled@marietta.edu # Finger for free illegal software.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Sun, 28 Nov 1999, Daniel Pfile wrote:
that is passed to them. That works great. Only thing I'm missing is how to get my DTML in userAuthenticate to work and return a 1 when GetAuthInfo finds matching username/password fields, and return 0 when it doesn't.
Am I missing something really silly here? Are there examples out there of what I'm trying to do? Am I going about this all wrong?
It would look something like this: <dtml-in "GetAuthInfo(username=username,password=password"> <dtml-return "_.int(1)"> <dtml-else> <dtml-return "_.int(0)"> </dtml-in> -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen
Ok, my stupidity is showing again. I think that last error was lack of my understanding of OOP and dtml-in (doesn't seem like username=username should work) Ok, now, I'm trying to get some roles returned from GUF so I can actually limit access. I have two user roles defined STUD (student) and FULL (full access). There is a dtml method called userRoles that looks like this: <dtml-in GetuserRoles> <dtml-var access> </dtml-in> It has proxy access as the Manager. My ZSQL method named GetuserRoles has username as it's argument and looks like this: select access from webusers where usersname = <dtml-sqlvar username type=string> The column access contains either STUD or FULL, with username being an exact match of the users's login name. I have a dtml document to show what kind of access a user has, using the following dtml: <dtml-if "AUTHENTICATED_USER.has_role('STUD')"> You have student access <dtml-if "AUTHENTICATED_USER.has_role('FULL')"> You have full access </dtml-if> <dtml-else> You have no access </dtml-if> When I log in and hit the page with that dtml in it, sometimes i get the proper thing back, sometimes I get 'You have no access' showing that it's not picking up the role info. Sometimes I get an error saying 'username' is a bad request. And sometimes I can't log in at all. I've tried every combination of clearing the GUF cache, and restarting netscape that I can think of. I've tried about 5 different ways of modifying the userRoles method, including making it an SQL method it's self (i'm running out of ideas). Once I figure this stuff out I'm gonna write a HOWTO on using GUF with SQL. Once again, thankyou for your help. # Daniel Pfile # I have no cool signature. # pfiled@marietta.edu # Finger for free illegal software.
participants (3)
-
Daniel Pfile -
Jens Vagelpohl -
Stuart 'Zen' Bishop