Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://wiki.cmc.msu.ru/System/ManagingUsers?cover=print;rev=1
Дата изменения: Unknown Дата индексирования: Mon Apr 11 00:51:50 2016 Кодировка: |
Some of the features below may be disabled, depending on your Foswiki configuration.
JaneSmith
to JaneMiller
. %M% Jane Smith is now known as JaneMiller
* JaneSmith - jsmith - 13 Sep 2006
* JaneMiller - jmiller - 13 Sep 2006
To remove a user account (FredQuimby, who logs in as "fred"):
.htpasswd
file, edit the .htpasswd
file to delete the line starting fred:
htpasswd
program with .htpasswd
files generated by Foswiki! htpasswd
wipes out email addresses that Foswiki plants in the info fields of this file.
FredQuimby - fred
line from the Main.WikiUsers topic
FredQuimby
from all groups and from all the ALLOWWEB/ALLOWTOPIC...
declarations, if any.rest
handler to: {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.
See the configure help at http://wiki.cmc.msu.ru/bin/configure#Registration$SecurityAndAuthentication for more details.
templates/registerconfirm.tmpl
templates/registernotify.tmpl
templates/registernotifyadmin.tmpl
.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 templates cp registernotify.tmpl registernotify.myskin.tmpl cp registerconfirm.tmpl registerconfirm.myskin.tmpl cp registernotifyadmin.tmpl registernotifyadmin.myskin.tmplthen add
myskin
to the beginning of the SKIN
setting in SitePreferences.
From this point on, your myskin templates will be used for the registration emails.
To make it possible for users to modify the email contents, you could use a parameterized%INCLUDE%
statement in your customized version, eg:
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{ "%USERSWEB%.RegisterNotifyEmail" 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 templateand 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%
Remember to secure the topic appropriately to prevent attackers from getting emailed sensitive passwords.
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.
approval
templates/registerconfirm.tmpl
to templates/registerconfirm.approval.tmpl
templates/registernotify.tmpl
to templates/registernotify.approval.tmpl
templates/registernotifyadmin.tmpl
to templates/registernotifyadmin.approval.tmpl
templates/messages.approval.tmpl
{Register}{NeedVerification}
{Register}{ExpireAfter}
setting to a value long enough to ensure that the approver has a chance to process the request before it expires.
approval
as the skin name. And the registration notifications sent to the user and Wiki admin do not need to be modified.
templates/registerconfirm.approval.tmpl
(Step 2) 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.
%{ This is a default template }%From: %WIKIWEBMASTERNAME% <%WIKIWEBMASTER%> To: %REGISTRATIONAPPROVAL% <%REGISTRATIONAPPROVALEMAIL%> CC: %WIKIWEBMASTERNAME% <%WIKIWEBMASTER%> Subject: Registration request by %FIRSTLASTNAME% <%EMAILADDRESS%> MIME-Version: 1.0 Content-Type: text/plain; charset=%CHARSET% Content-Transfer-Encoding: 8bit Registration request by %FIRSTLASTNAME% <%EMAILADDRESS%> for %WIKITOOLNAME% needs your approval. Verification code %VERIFICATIONCODE% %SCRIPTURL{"register"}%?action=verify;code=%VERIFICATIONCODE%
Note The line following the Content-Transfer
must be completely empty, with no spaces, or the email wil fail.
templates/registernotifyadmin.approval.tmpl
(Step 4) This is sent to the Admin upon successful registration. This message is extended to provide confirmation to the approver that the registration succeeded.
%{ This is a default template }%From: %WIKIWEBMASTERNAME% <%WIKIWEBMASTER%> To: %WIKIWEBMASTERNAME% <%WIKIWEBMASTER%> Cc: %REGISTRATIONAPPROVAL% <%REGISTRATIONAPPROVALEMAIL%> 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 %MAKETEXT{"This is an automated e-mail notification of user registration in [_1]." args="%WIKITOOLNAME%"}% %MAKETEXT{"[_1] has been approved and registered with e-mail [_2]" args="%WIKINAME%, %EMAILADDRESS%"}% %MAKETEXT{"Submitted content:"}% %FORMDATA% %MAKETEXT{"Saved to:"}% %SCRIPTURL{"view"}%/%USERSWEB%/%WIKINAME%
templates/messages.approval.tmpl
(Step 5) 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%
Main.SitePreferences
(Step 6) #
shown in the below example.)
* #Set SKIN=approval,pattern * #Set REGISTRATIONAPPROVAL=Registraions * #Set REGISTRATIONAPPROVALEMAIL=registrations@mycompany.com
Note Be sure to add the REGISTRATIONAPPROVAL and REGISTRATIONAPPROVALEMAIL to the Set FINALPREFERENCES
line.
{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 scripttools/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.