[Zope] How to know if a user already exists?

Sylvain Boureliou sylvain.boureliou@msg-software.com
Fri, 17 Aug 2001 10:30:17 +0200


Sorry for the last empty Re:


Hi Juan

You can try :

    confirmation = "ok"

    for x in self.acl_users.getUserNames():
      if (x==username):
         confirmation="error"
         break

    if confirmation=='ok':
        self.acl_users._addUser(username,password,confirmpass,liste_role,0)


Sylvain



-----Message d'origine-----
De : zope-admin@zope.org [mailto:zope-admin@zope.org]De la part de Juan
Garcia Garcia
Envoyé : vendredi 17 août 2001 10:11
À : zope@zope.org
Objet : [Zope] How to know if a user already exists?


I have a form with two fields, one to write a login and the other for the
password. When the anonymous user pushs the submit button I will create a
new user with the id and password written. But I want to know, before
doing this action, if the login already exists in the folder 'acl_users'.
I tried with the function 'has_key' but it didn't work. If anyone has do
it before, please send me the answer.

Thank you.