How can I show the user's e-mail address in the Users topic?
The
UserForm does not show the e-mail address, and with
TopicUserMapping, the e-mail address is never copied to the
UserForm.
The e-mail address can be retrieved using the %USERINFO% macro. This macro follows the User security setting
{AntiSpam}{HideUserDetails}
which is managed in the
configure
interface. In order to automatically display the user's e-mail address in the User's topic:
The user form will then follow the setting of
{AntiSpam}{HideUserDetails}
. If disabled, all users including guest will see the user's e-mail address in the User's topic. If enabled, then users can see their own addresses, and administrators will see all addresses.
In order to automate this for new users, add the macro to the
NewUserTemplate
With
TopicUserMapping, and
HtPasswdUser, e-mails are
never stored in the user's topic. Emails are written to the
.htpasswd
file.
The register function
lib/Foswiki/UI/Register.pm
copies the fields from the registration form to the User topic. It explicitly omits the email address. There is an option in the code specifying which fields are skipped, defined right at the top of the module.
If this option is changed, the email will be copied, but Foswiki will still use the hidden email in
.htpasswd
. The email in the User topic will be visible but unused by Foswiki.
Changes to this module are not recommended.
HtPasswdUser.pm
controls whether or not it manages email addresses. The function
isManagingEmails
returns 1 (true) and passwords are written to and managed in
.htpasswd
. If this is changed to return 0 (false), then
TopicUserMapping.pm takes over and manages the passwords directly in the
UserForm in the User's topic. Note that it is recommended that this modules
not be modified. It should be copied to a custom Password manager so that Foswiki upgrades don't revert the changes.