[BlueBream] ZOPE: user registration module and session handling

KK CHN kkchn.in at gmail.com
Tue Mar 8 00:55:22 EST 2011


List,

Let me  request  your patience and time,   I am a zope newbe  trying to get
some light in the darkness.




 I am  trying to learn zope2 for the last couple of months, reading and
doing  zope2 documentations and sample  file based python product
developments.

I know  Zope s advanced  a lot more than a decade(and zope3 / bluebream is
the there now)  but I just started few months back, sorry for my ignorance
and lack of opportunity to start at the early stage.


I have gone through zope2 docs and other tutorials on zope, and tried  a
couple of file base zope products.

But I am unable to find/ do  a complete user  registration module for  zope
sites.   and small session handling  applications  like  a shopping cart
which use  session management techniques.


1     how  zope.org  is doing  user login/register/password retrieval
module,  or how  people like you  add a user registration/login/password
retrieval module for your zope sites.

I searched a lot and learned the acl_users  folder properites,

and  can do manually add users    with  these code excerpts.

self.manage_addUserFolder()

        self.acl_users.
userFolderAddUser('user1', 'passwd', ['Member','Admin'], [] )
         self.acl_users.userFolderAddUser('user2', 'passwd', ['Member',
'Managers'], [] )
        self.acl_users.userFolderAddUser('user3', 'passwd', ['Member',
'Manager','Admin'], [])



etc.  but  unable to do a  user registration module using  acl_users  and
its web interface .



By reading  BetaBoring  and some other  tutorials  in upfront systems zope
course,  devshed.com  tutorials  I think   I am in the right track of
zope2  learning.


2.  I have done a sample application,   but I dont know how to clear  the
normal zope user credentials  when a sample user clicks   a logout   link

here some sample code :

I added an anchor       <a href ="logout" > Logout </a> tag   for logout in
my   pageTemplate  name as  myPage.zpt

from AccessControl import ClassSecurityInfo
security = ClassSecurityInfo()
security.declareProtected('adminroles', 'myPage')
myPage = PageTemplateFile(
                    os.path.join('views', 'myPage.zpt'), globals())



and  I added  few sample  users   such as  user1,   user2, user3  etc  to
acl_users  with sample password  'passwd'

        self.acl_users.userFolderAddUser('user1', 'passwd',
['Member','Admin'], [] )
        self.acl_users.userFolderAddUser('user2', 'passwd', ['Member',
'Managers'], [] )
        self.acl_users.userFolderAddUser('user3', 'passwd', ['Member',
'Manager','Admin'], [])



and when I access the   protected page  'myPage'  it asks me for acl_user
credentials  and I am able to enter   sample users  and password  and it
allows me to view the  page  'myPage'

But problem  when I click  the Logout  Link  in the myPage( <a
href="logout"> Logout</a>)    then  it call  a logout.zpt
page template there  I  display a message  you logged out , and  return  the
login.zpt    page.

but   in the login.zpt  page  if you enter anything   I mean  garbage for
username  and password  field   it allows to view the myPage.( this happens
once you logged in first time with the credentials).

How to clear these  zope acl_users  credentials  once you click the logout
link  which in turn call a logout.zpt  template.



If  you have  some sample / demo applications  to show how to do these
issues,  can you share me those. I am stuck in this  point  in zope.

if any such application code/related works to follow it will help me a lot.

Thank You
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/bluebream/attachments/20110308/41e9ad0b/attachment.html 


More information about the bluebream mailing list