Removing User Accounts

If you are using a .htpasswd file, edit the .htpasswd file to delete the line starting fred:

Warning: Do not use the Apache htpasswd program with .htpasswd files generated by Foswiki! htpasswd wipes out email addresses that Foswiki plants in the info fields of this file.

Remove the FredQuimby - fred line from the Main.WikiUsers topic

Remove FredQuimby from all groups and from all the ALLOWWEB/ALLOWTOPIC... declarations, if any.Note: If you fail to do this you risk creating a security hole, as the next user to register with the wikiname FredQuimby will inherit the old FredQuimby's permissions.

Note: Consider leaving the user topic file in place so their past signatures and revision author entries don't end up looking like AnUncreatedTopic.
If you want to make it clear the user is no longer around, replace the topic content with a note to that effect.
The existence of the UserName topic should also prevent that user name from being re-used, sealing the potential security hole regarding inherited permissions..

See the AntiWikiSpamPlugin extension for another method of removing users. It provides a rest handler to:

Other registration controls

Confirmation

Registration can be configured to require a confirmation via the registered email address:

An email is sent to the email address entered by the new user with a confirmation code.

The user must enter the confirmation code into a dialog on the wiki to confirm the registration.

The pending registration lifetime defaults to 6 hours. If the user does not confirm within that time, the pending registration will be removed.

Registration Email Requirements

Normally Foswiki does not require unique email addresses. Multiple users can register using the same email address. Enable the setting {Register}{UniqueEmail} to prevent use of the same email by multiple users.

Normally any email domain can be used for registration. Set the expert setting {Register}{EmailFilter} to restrict the domains usable for registration. See the configure help for more details.

Note the use of %WIKINAME%, %FIRSTLASTNAME%, %EMAILADDRESS% passed in from the INCLUDE so that the topic below is similar to the original template

and then create a topic Main.RegisterNotifyEmail:

Welcome to %WIKITOOLNAME%.
%MAKETEXT{"Your personal [_1] topic is located at [_2]. You can customize it as you like:" args="%WIKITOOLNAME%, %SCRIPTURL{"view"}%/%USERSWEB%/%WIKINAME%"}%
* %MAKETEXT{"Some people turn it into a personal portal with favorite links, what they work on, what help they'd like, etc."}%
* %MAKETEXT{"Some add schedule information and vacation notice."}%
Regards
%WIKIWEBMASTERNAME%
Your Wiki Admin
%MAKETEXT{"Note:"}%
2 %MAKETEXT{"You can change your password at via [_1]" args="%SCRIPTURL{"view"}%/%SYSTEMWEB%/ChangePassword"}%
3 %MAKETEXT{"If you haven't set a password yet or you want to reset it, go to: [_1]" args="%SCRIPTURL{"view"}%/%SYSTEMWEB%/ResetPassword"}%
%MAKETEXT{"Submitted content:"}%
%FORMDATA%

Manually approving registrations

In some installations, registration requests should be forwarded to an administrator for approval. This can be accomplished relatively easily by
modifying the registration email template to send the "Verification" request to an approval address instead of returning to the user.

This will be accomplished by creating a new skin to override the templates used in the registration process. By creating a new skin, you avoid modifying
any files that are replaced when Foswiki is upgraded.

Summary of steps:

Name a new skin for the registration email: ex. approval

Copy and modify the registration confirmation - templates/registerconfirm.tmpl to templates/registerconfirm.approval.tmpl

Copy the template: cp templates/registerconfirm.tmpl templates/registerconfirm.approval.tmpl and edit to appear as follows.
This email message will be sent to the address responsible for approving registrations.

Create a new template: templates/messages.approval.tmpl This template will
override one message from the large collection of messages in templates/messages.tmpl

This "confirm" message will be returned to the user when they submit the registration request.

%TMPL:INCLUDE{"messages"}%
%TMPL:DEF{"confirm"}%
---+++ %MAKETEXT{"Thank you for registering"}%
Your request has been sent to %REGISTRATIONAPPROVAL% <%REGISTRATIONAPPROVALEMAIL%> who will normally approve your
registration within 1-2 working days.
Return to %USERSWEB%.%HOMETOPIC%
%TMPL:END%

Site preferences Main.SitePreferences(Step 6)

Edit your Main.SitePreferences topic and enable the new skin, and set the %REGISTRATIONAPPROVAL% and %REGISTRATIONAPPROVALEMAIL% variables. (Do not include the # shown in the below example.)

Note Be sure to add the REGISTRATIONAPPROVAL and REGISTRATIONAPPROVALEMAIL to the Set FINALPREFERENCES line.

Edit the Registration Configuration (Steps 7-8)

{Register}{NeedVerification}

This checkbox should be enabled in the "Security and Authentication" -> "Registration" tab.

{Register}{ExpireAfter}

Set to a value that is > than the longest delay expected for approval. For ex. a "Holiday weekend" - 3-day lifetime would require 259200 seconds.

Set the pending registration timeout, in seconds. The pending registration
will be cleared after this amount of time. The default is 6 hours (21600
seconds). This is only used if {Register}{NeedVerification} is enabled.

Note By default, registration expiry is done "on the fly" during the
registration process. For best performance, you can set
{Register}{ExpireAfter} to a negative number, which will mean that Foswiki
won't try to clean up expired registrations durning registration. Instead you
should use a cron job to clean up expired sessions. The standard maintenance
cron script tools/tick_foswiki.pl includes this function.

Note that if you are using registration approval by 3rd party reviewers, this
timer should most likely be significantly increased. 24 hours = 86400, 3 days
= 259200.

Pending registration requests are stored in the
{WorkingDir}/registration_approvals directory.