Excercise Sheet 4.0 1. Add a user in plone.
Duration:
1 hour
To Add a user navigate to the following page Preferences-> Zope Management Interface -> acl_user(Group-aware User Folder ) Click Source User Click Add a user Provide user Id and password and click add user Navigate back to acl_user Click portal_role_manager Click on ? infront of member Search for the user id to be assigned role Select the user in available box and transfer that to the active box by clicking on the ->
2. Add a group in plone. Navigate to acl_users as described in ex-1 above. Click source_group Click add a group Provide the credentials and click add group 3. Assigning Groups to User Navigate to acl_user as described in ex-1 above. Click Source_group Click ? Search the userSelect the user in available box and transfer that to the active box by clicking on the -> 4. Create a csv file.( For Batch User Creation) Open Microsoft excel Create a excel sheet with the following columns i. Username ii. Name iii. Designation Save that sheet as .csv format Please Refer a user.csv file in ezpphelp site. Alternatively you can type the following fields in a notepad separated by a comma(,) and the records separated by a line break and save that file as user.csv ( or the name you want but extension should be .csv) 5. Create add_user_page Navigate to ZMI->portal_skin->customs Add a DTML Document with id as add_user_page and add the following code. 6. Create create_user python script
Navigate to ZMI -> portal_skin ->Customs Add a python script with id as create_user and add the following code import string file = context.REQUEST.form['file_attachment'] out=[] for line in file.readlines(): #line = string.replace(line,'\"','') item = map(string.strip, line.split(',')) id=item[0] password=id #name=item[1] email="" if(email==""): email="youremailID@indiapost.gov.in" try: pr.addMember(id = id, password = password, roles = ["Member"], properties = {'username' :id,'email':email}) out.append("Added user %s \n"%(id)) except ValueError, msg: out.append("Skipped %s, reason: %s\n"%(id, msg)) return "\n".join(out) Please note the indentation of python script must be accurate.