[Zope] howto set up a large set of users in a school

Mark Gibson mark@kaivo.com
Fri, 18 Oct 2002 23:05:10 -0600


I've used the following as an external method to import users into acl_users.

Mark
-----
import string
def addAuthUsers(self, REQUEST, infile='/home1/sepg/auth.txt'):
   """
    import users from infile, a space delimited file...
   """
   #output - just used to let me know who got imported.
   output=open('/home1/sepg/userout.txt','w')
   infile=open( infile ,'r')
   output.write('opened %s\n'%infile)
   for line in infile.readlines():
      line=string.strip(line)
      (name,password)=string.split(line,' ')
      try:
         self.acl_users.manage_users(submit='Add',REQUEST={'name':name,'password
':password,'confirm':password,'roles':['member',]}) 
output.write("added user name=%s, password=%s\n"%(name,password))
      except:
         output.write("couldn't add user name=%s, password=%s\n"%(name,password)
)


Suneil Basu wrote:

> Hi
> I would like to set up a zope site for my school with user profiles and 
> authentication (1200 high school students in my London based school). At 
> the moment I have a php/mysql solution.
> How do I set up 1300 users (100 teacher accounts)? I don't fancy adding 
> manually into acl_users?
> 
> Suneil
> 
> 
> 
> 
> _______________________________________________
> 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 )