How to Maintain User Data
Contents
To speed up processing, MoinMoin also maintains a mapping from user name to user id and saves it under <cache_dir>/.../user/name2id - these are internal data structures and you must not change those files. If you are in doubt whether name2id is correct or up-to-date, then just delete it and it will be re-generated automatically by moin. If you run a persistent (non-cgi) moin, restart MoinMoin.
Disable a user account
A disabled account cannot log in any more. Its name, email address, password and page subscriptions are kept, nobody else can register its name or email meanwhile, and it can be enabled again at any time. A disabled user gets no notification emails.
You can disable an account:
as a superuser (see HelpOnSuperUser): open a page with the <<SystemAdmin>> macro, e.g. SystemAdmin, click "User account browser" and use the "Disable user" button of the account;
on the command line: moin ... account disable --name=NAME (see HelpOnMoinCommand);
- in the user preferences, with "Disable this account (an administrator can enable it again)"; a superuser can reach them with "Switch user" in the settings.
Enable a disabled account
In the "User account browser" of the SystemAdmin page: "Enable user" button.
On the command line: moin ... account enable --name=NAME
Older versions (MoinMoin 1.9, moinmoin-py3-md up to 1.12.0) renamed a disabled account to "NAME-<user id>", and its email too. moin ... account enable --name=NAME gives such an account its original name and email back.
Removing a user account
In the "User account browser" of the SystemAdmin page: "Delete user" button (the browser asks for a confirmation first).
On the command line: moin ... account delete --name=NAME
This removes the user file in data/user for good, and the name and the email can be used by a new account. It cannot be undone, so keep a backup of data/user if unsure.
Be aware that if you do that, you will destroy the edit history of that user. Moin won't be able to show this user in page history, because this user id will then be unknown. So better disable an account rather than removing it.
Sharing user accounts in wiki farms
On single wikis you don't do anything special, each wiki will have a separate data/user/ directory and nothing will be shared. In a wiki farm with two or more wikis you can share user accounts and data. Add to farmconfig.py
user_dir = '/farm/user' # common user directory for all farm wikis
if you want that all farm wikis share user accounts, or put the respective absolute path name of the shared user directory in the wikiconfig.py file of the wikis, you want them to share data. Make sure that all of your wikis have some unique interwiki name set in their wikiconfig.py files:
interwikiname = "WikiOne" # others: WikiTwo, WikiThree or whatever you like
Do also add the interwiki names of all farm wikis to the interwiki lists of the wikis so that the wikis can resolve these new names. If you don't set interwiki names, page trail, page subscriptions and quicklinks won't work properly.
In farmconfig.py you can also set the value user_homewiki to have one wiki where all the user home pages are stored. This could be useful if you have many users. You could even link to nonwiki "user pages" if the wiki username is in the target URL. See HelpOnConfiguration for more on that.
If you don't set a unique interwiki name, MoinMoin might not work correctly. You also should strongly avoid changing the interwiki name.