[Zope] persistent form variables and user login

Dieter Maurer dieter at handshake.de
Sun Dec 21 13:32:56 EST 2003


cheng saimun wrote at 2003-12-21 07:50 -0500:
>Right now, i would like to solve some doubts in this area. I have a
>few folders eg.  folders A, B, C ) in my website and each folder has an
>acl_users folder storing the users allowed to access the particular
>folder. Also I have a acl_users folder at my root to contain all the users
>which i have registered for this website. Yes, the users in this acl_users
>folder are the users in A,B ,C. Using cookiecrumbler, i have a login form
>for the user to login by checking against this acl_users at root. 
>
>My questions lie here:
>1. After logging in, the user will click on the link ( which is 
>folder A), which contains a form which the authorized user can select
>the conditions and save this report. 

This does not seem to be a question...

>2. I understand that using ZODB (outside of zope framework) can do the job in storing the variables. But how do I associate this user with the variables? What is the code used to find out what the login user at folder A is? 

Maybe, you should look at CMF/Plone. They have a standard solution
(called "MemberData").

In plain Zope, you could make a "Folder" containing an object for
each user with the relevant information.

You cannot get the "login user at folder A" but you can
get information about the current user:

  in ZPT:	"user"
  in Python	from AccessControl import getSecurityManager; 
		user = getSecurityManager().getUser()
  in DTML:	"_.getSecurityUser()"

>3. It seems that using zodb, that's very few how-tos within the zope framework itself especially when i need to do a persistent data storing for a user. 

Plain Zope (unlike CMF/Plone) does not provide for a special
solution.
You store information about users the same way as you do
it for anything else.
Such things need not be documented...

-- 
Dieter



More information about the Zope mailing list