Tags:
admin_tool1Add my vote for this tag users1Add my vote for this tag create new tag
, view all tags
ALERT! NOTE: This is a DistributionDocument. Please help maintain high quality documentation: This is a wiki, please fix the documentation if you find errors or incomplete content. Put questions and suggestions concerning the documentation of this topic in the comments section below. Use the Support web for problems you are having using TWiki.

Manage Users

Register users on your TWiki site; change/reset/install passwords; remove user accounts

ALERT! Some of the features below may be disabled, depending on your TWiki configuration.

Authentication and Access Control

Register User

You don't have to have user home pages in TWiki for Authentication to work - see TWikiUserAuthentication for details.

Change, Reset and Install Passwords

Note that the below features are only relevant when you use an internal password manager where TWiki can set and reset passwords.

  • ChangePassword is for users who can remember their password and want to change it
  • ResetPassword is for users who cannot remember their password; a system generated password is e-mailed to them
  • BulkResetPassword if for administrators who want to reset many passwords at once
  • ChangeEmailAddress changes the hidden email address stored in the password file

Changing User Account Names

To change the user's WikiName:

  • Rename the user's TWiki homepage in the Main web, such as from JaneSmith to JaneMiller.
    • Fix backlinks in the Main web only
    • Make sure the group topics are updated (if any.)
  • Edit the Main.TWikiUsers topic and move the user's entry so that the list is in proper alphabetical order.
  • Recreate the old topic with a pointer to the new topic, so that links in other webs work properly. Example content:
    %M% Jane Smith is now known as JaneMiller

If external authentication is used and you want to change the login name:

  • The login name needs to be changed in the authentication server (e.g. Active Directory)
  • In TWiki's Main.TWikiUsers topic, fix the mapping from login name to WikiName:
       * JaneSmith - jsmith - 13 Sep 2006
    to:
       * JaneMiller - jmiller - 13 Sep 2006

Removing User Accounts

To remove a user account (FredQuimby, who logs in as "fred"):

  1. 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 TWiki! htpasswd wipes out email addresses that TWiki plants in the info fields of this file.
  2. Remove the FredQuimby - fred line from the Main.TWikiUsers topic
  3. 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.
  4. [optional] Delete their user topic Main.FredQuimby (including attachments, if any.)

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..

Customizing registration Emails.

TWiki's Registration can send 3 emails who's output is governed by templates:

  1. User registration confirmation - templates/registerconfirm.tmpl
  2. User registration notification - templates/registernotify.tmpl
  3. Email to notify the TWiki admin of registration - templates/registernotifyadmin.tmpl

As these are TWikiTemplates, they can be customized and selected using the SKIN path setting. Because there are default tmpl files in the templates dir, this cannot use Template topics.

These template files have a specific format that matches the raw format of emails sent via SMTP, so be careful and test your changes. It is easiest to start by copying the default templates:

cd twiki/templates
cp registernotify.tmpl registernotify.myskin.tmpl
cp registerconfirm.tmpl registerconfirm.myskin.tmpl
cp registernotifyadmin.tmpl registernotifyadmin.myskin.tmpl
then add myskin to the beginning of the SKIN setting in TWikiPreferences.

From this point on, your myskin templates will be used for the registration emails.

To make it possible for TWikiUsers to modify the email contents, you could use a parameterized %INCLUDE% statement in your customized version. e.g.:

From: %WIKIWEBMASTERNAME% <%WIKIWEBMASTER%>
To: %FIRSTLASTNAME% <%EMAILADDRESS%>
Subject: %MAKETEXT{"[_1] - Registration for [_2] ([_3])" args="%WIKITOOLNAME%, %WIKINAME%, %EMAILADDRESS%"}%
MIME-Version: 1.0
Content-Type: text/plain; charset=%CHARSET%
Content-Transfer-Encoding: 8bit

%INCLUDE{
    "Main.RegistrationNotification"
    WIKINAME="%WIKINAME%"
    FIRSTLASTNAME="%FIRSTLASTNAME%"
    EMAILADDRESS="%EMAILADDRESS%"
}%

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 TWiki 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%

Note: Remember to secure the topic appropriately to prevent attackers from getting emailed sensitive passwords.

Related Topics: AdminDocumentationCategory



Comments & Questions about this Distribution Document Topic

Would it be appropriate to add some words somewhere, like: I guess I think it would be appropriate, for people who may find this page but are maintaining an older TWiki, or, maybe the words can include just the first paragraph without the details (as they are (mostly) already covered above).

In older versions of TWiki (some still in use on the web), if a user lost his password, the only recourse was to delete the user and then allow him to reregister while creating a new password.

In that case, the three essential steps are: I'm not 100% sure all three steps are essential

  • delete his password entry from .htpasswd
  • delete his name from the Main.TWikiUsers topic
  • delete his home page (Main.<UserName>, or data/Main/<UserName>.txt and data/Main/<UserName>.txt,v)
  • optional (if there is any doubt about him re-registering, or perhaps after a few days if he doesn't re-register) Remove user from all groups and from all the ALLOWWEB/ALLOWTOPIC... declarations, if any.
    Note: Otherwise this is a security hole as the first one to re-register with this name will be granted the permissions of the previous user.

-- RandyKramer - 22 Jul 2003

Randy, I think the "lost password" problem should be a separate entry because it is a different problem. It's just that the solution overlaps.

-- MattWilkie - 13 Aug 2003

I wonder. Would it be useful to have a pointer or pointers to the documentation on the relevant DotPms here?

-- AntonAylward - 28 Feb 2005

What about disabeling user accounts? I want to keep the users history, settings and everything, but don't want him to be able to log in again. I guess a workaround would be to remove the crypted password and the email address from the htpasswd file, but keep the login there. Is there anything like this existing as plugin?

-- KevinGoeser - 19 Feb 2006

Removing user account is missing one step ...

  5 Remove any files the user has uploaded (look in ./twiki/pub/Main/<username>) and remove the upload directory for the user.

-- ThomasSchodt - 07 Jul 2006

Deleting a topic moves also its attachments to the Trash web. I changed the text to be a bit more explicit.

-- PeterThoeny - 07 Jul 2006

Ah, ok - so, it's:

  4 Using your web browser move the user topic Main/FredQuimby to the Trash web

This was probably comprehensive before HtmlAttachmentSpam, but I think it may confuse many hobby "TWiki-ists" as one then has to run a shell and go delete the files ./twiki/data/Trash/<username>.txt* - and any attachments from ./twiki/pub/Trash/<username>

Maybe there should be a separate entry for how to deal with HtmlAttachmentSpam - in general, most of the discussion on HtmlAttachmentSpam will be beyond many hobby "TWiki-ists" - what is needed is a simple set of preventive actions - install BlackListPlugin - and a simple set of reactive actions - how to permanently delete a user topic and all associated attachments.

-- ThomasSchodt - 08 Jul 2006

I see now where you are coming from. Yes, a "how to remove spam" help would be useful on the BlackListPlugin topic. I added a note accordingly to BlackListPluginDev.

-- PeterThoeny - 08 Jul 2006

To delete an account, I found I have to delete that user's files in Main directory too. For example, the user is FredQuimby. I need to delete FredQuimby.txt and FredQuimby.txt,v in the twiki/data/Main directory. Otherwise, I got the user-has-been-registered error when I tried to register with the same name.

-- AlanZhang - 15 Mar 2007

Yes, this is indicated with "delete their user topic Main.FredQuimby"

-- PeterThoeny - 15 Mar 2007

Passwords is all very well, but what if a user has a bad e-mail address? How do I (as admin) fix the user's private e-mail address? Until that is fixed, resetting the user's password does nothing because they won't get the system notifications anyway?

-- AndrewWhite - 07 Apr 2007

In case of bad email address the admin has to edit twiki/data/.htpasswd. At least that's the way I did it today

-- HolgerHellmuth - 09 Apr 2008

Please use the Support forum if you have questions about TWiki features. This comment section is about the documentation of this topic.
Edit | Attach | Watch | Print version | History: r27 < r26 < r25 < r24 < r23 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r27 - 2010-05-31 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.