Ok, I've got this legacy database app (VisualBasic and Access - Bleck!) that I'm moving to Apache/Zope/PostgreSQL. One of the existing database tables is user info, i.e. userid, password, real name, an "account disabled" boolean, etc. I've figured out a really stupid way to "solve" the problem, essentially doing queries against the user table and having conditionals in every DTML object to determine if the user should be there or not. (Actually, I negated some of that silliness by incorporating SQLSession into the mix.) Still, I'm faced with needing some way to check the user/session against each requested object. And no, there's not much access granularity here - the user should either have access to the whole folder, or not. LoginManager looks promising, but I'm still enough of a Zope newbie that I've hit a bit of a roadblock, boiling down (boiled roadblock?!?) to 2 fundemental questions: 1. Can LoginManager be (easily?) made to meet my specific need? 2. Has anyone done an SQL UserSource yet, or can anyone give me a clue how to make one? I've tried "creating" another US, but after that Zope just sits there, quietly mocking me. I did read the API stuff and that actually makes a little sense to me, but I don't know what types of objects (or external methods?) would need to be created as part of a new US interface. In other words, I more or less understand the API calls, I can do SQL queries in my sleep, but how does one tie it all together into a new US? Does it involve (*shudder*) writing Python? ;) I'd be happy to share back any useful results of this exercise. Thanks for any help, Charlie -- Charlie Wilkinson - TRIS Development Systems Administrator IS:SD:CT:CC:TD Phone: 202-283-3241 MSMail: Charlie E Wilkinson <mailto:Charlie E Wilkinson> SMTP: cwilkins@tris.irs.gov <mailto:cwilkins@tris.irs.gov> Home: cwilkins@boinklabs.com This message constructed from 90% post-consumer electrons.
Wilkinson Charlie E writes:
1. Can LoginManager be (easily?) made to meet my specific need?
Probably, it includes a GenericUserSource, which is essentially a clone of Generic User Folder (see below).
2. Has anyone done an SQL UserSource yet, or can anyone give me a clue how to make one?
You should look at Generic User Folder, and the HowTo that tell how to set it up with Postgressql. Basically, you need to create a number of SQLMethods to query your database and some wrappers for these methods. The SQLMethods are the only thing that has to care about the details of your database format.
I think this is what you want... http://www.zope.org/Members/hippy/GUF_SQL_crypt_1_2 How To: Use GenericUserFolder with an SQL database Version 1.1 J From: Wilkinson Charlie E <Charlie.E.Wilkinson@irs.gov> Date: Tue, 13 Jun 2000 11:29:48 -0400 To: zope@zope.org Subject: [Zope] Q: LoginManager and SQL-US? Ok, I've got this legacy database app (VisualBasic and Access - Bleck!) that I'm moving to Apache/Zope/PostgreSQL. One of the existing database tables is user info, i.e. userid, password, real name, an "account disabled" boolean, etc. I've figured out a really stupid way to "solve" the problem, essentially doing queries against the user table and having conditionals in every DTML object to determine if the user should be there or not. (Actually, I negated some of that silliness by incorporating SQLSession into the mix.) Still, I'm faced with needing some way to check the user/session against each requested object. And no, there's not much access granularity here - the user should either have access to the whole folder, or not. LoginManager looks promising, but I'm still enough of a Zope newbie that I've hit a bit of a roadblock, boiling down (boiled roadblock?!?) to 2 fundemental questions: 1. Can LoginManager be (easily?) made to meet my specific need? 2. Has anyone done an SQL UserSource yet, or can anyone give me a clue how to make one? I've tried "creating" another US, but after that Zope just sits there, quietly mocking me. I did read the API stuff and that actually makes a little sense to me, but I don't know what types of objects (or external methods?) would need to be created as part of a new US interface. In other words, I more or less understand the API calls, I can do SQL queries in my sleep, but how does one tie it all together into a new US? Does it involve (*shudder*) writing Python? ;) I'd be happy to share back any useful results of this exercise. Thanks for any help, Charlie -- Charlie Wilkinson - TRIS Development Systems Administrator IS:SD:CT:CC:TD Phone: 202-283-3241 MSMail: Charlie E Wilkinson <mailto:Charlie E Wilkinson> SMTP: cwilkins@tris.irs.gov <mailto:cwilkins@tris.irs.gov> Home: cwilkins@boinklabs.com This message constructed from 90% post-consumer electrons.
The Generic User Folder (GUF) Product seems broken with the new beta relaese. Has anybody the same problem? I use a kind of thing modelled after http://www.zope.org/Members/hippy/GUF_SQL_crypt_1_2 I imported the folder from an older installation, but the underlying Zope-API which GUF uses seems changed, so it does not work. Even adding a GUF-folder by hand does not work: Error Type: KeyError Error Value: PARENT_URL Traceback (innermost last): File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope-2.2.0/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope-2.2.0/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_addGenericUserFolder) File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_addGenericUserFolder) File /usr/local/Zope-2.2.0/lib/python/Products/GenericUserFolder/GenericUserFolder.py, line 576, in manage_addGenericUserFolder File /usr/local/Zope-2.2.0/lib/python/ZPublisher/HTTPRequest.py, line 809, in __getitem__ KeyError: (see above) Any hints? -- Tom Schwaller http://www.linux-magazin.de http://www.linux-community.de
On Thu, 15 Jun 2000, Tom Schwaller wrote:
I imported the folder from an older installation, but the underlying Zope-API which GUF uses seems changed, so it does not work.
Quite possibly. No testing has been done under 2.2 yet - I know there will be issues with it as I have been watching pje & ty tackle them with the LoginManager product.
Even adding a GUF-folder by hand does not work:
Error Type: KeyError Error Value: PARENT_URL
This looks like you are trying to create a GUF in a folder that already has an acl_users folder. This bug will be fixed in the next release, which should be shortly after Zope 2.2 is released. You still won't be able to create an acl_users folder in a folder that already contains one, but the error message will actually render :-)
line 576, in manage_addGenericUserFolder File /usr/local/Zope-2.2.0/lib/python/ZPublisher/HTTPRequest.py, line 809, in __getitem__ KeyError: (see above)
-- Stuart Bishop Work: zen@cs.rmit.edu.au Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au Computer Science, RMIT University
participants (5)
-
Dan L. Pierson -
J. Atwood -
Stuart 'Zen' Bishop -
Tom Schwaller -
Wilkinson Charlie E