For IntranetWikis it could be useful to have a mechanism to create multiple UserProfiles at once. Starting base could be a text-file with a WikiName in each line, or a query to a database or LDAP server.

see also MoinMoinQuestions question "User Registration Query".

see also UserPreferencesRedesign (if profiles are always created by a script then the current UserPreferences form would not be appropriate).

Creating User Profiles

Python Script

/moin_addsubscription.py - creates one user (not tested under 1.3 yet)

I'm calling this module based on information from an LDAP server. If you would like to create multiple users from a text file etc. please tell me what format you would like. I personally don't like to put the passwords in a file; I would rather use random passwords and get the users to email themselves using the wiki itself. To make this a bit easier I've hacked my installation of moin 1.2.3 to modify the UserPreferences page (http://mirriwinni.it.jcu.edu.au/studentwiki/UserPreferences). - ChrisGaskett

Other Languages

I was using an awk/sh script written by Phillip Musumeci to generate UserProfiles, but am now using the Python script above. The basic task is to create an appropriate file in the MoinMoin data/user directory, similar to those already found in that directory. - ChrisGaskett

Some notes:

passwd for htaccess

If we are using apache htaccess for access control, we need to create the passwd-file:

import os

# First create the file (option -c)
os.system("htpasswd -cb passwd_new WikiMaster topsecret")

# read the list and append eacht name
inputfile = open("names.txt", "r")

for workline in inputfile.readline():
  os.system("htpasswd -b passwd_new " + name +  " topsecret")

ToDo:

Managing Existing Users

Checking Validity

MoinMoin comes with a script, moin_usercheck-jh-new.py

Managing Subscriptions

If your users fall into natural groups, for example students enrolled in different subjects, it can be useful to have a method to subscribe them to pages in bulk (of course, they can unsubscribe themselves later). The following script is added as a subpage rather than an attachment because it could really use some improvement from someone with more knowledge of MoinMoin and/or python and I want to see the differences. - ChrisGaskett

/moin_addsubscription.py

MoinMoin: CreateMultipleUserProfiles (last edited 2007-10-29 19:21:12 by localhost)