Skip to content

Commit

Permalink
Merge branch 'master' into Item14288
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Feb 27, 2017
2 parents 11cd873 + b130e82 commit 0410a3b
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 64 deletions.
20 changes: 5 additions & 15 deletions TopicUserMappingContrib/data/System/BulkRegistration.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1487815547" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1487907314" format="1.1" version="1"}%
%META:TOPICPARENT{name="AdminToolsCategory"}%
%ADDTOZONE{"head" text="<style type='text/css'>
#bulkReg .col1 {float:left; width:30%; margin:0 3% 0 0;}
Expand Down Expand Up @@ -95,13 +95,14 @@ Use the following form to create a new Unprocessed Registration topic.
<div class="col1">
<p>
<select multiple='on' name='fields'>
%FORMAT{"%CALCULATE{$LISTUNIQUE(%QUERY{"'%URLPARAM{"usertemplate" default="System.NewUserTemplate"}%'/fields.name"}%)}%" type="string" format="<option value='$item'>$item</option>"}%
%FORMAT{"%CALCULATE{$LISTUNIQUE($FILTER(\b(((FirstName($comma?))|(LastName($comma)?)|(Email($comma)?))),$LISTSORT(%QUERY{"'%URLPARAM{"usertemplate" default="System.NewUserTemplate"}%'/fields.name"}%)))}%" type="string" format="<option value='$item'>$item</option>"}%
</select>
</p>
</div><!--//col1-->
<div class="col2">
Use Ctrl-click to select multiple fields. (LastName and FirstName
will be included even if not selected. They are required for registration.)
Use Ctrl-click to select multiple fields. (LastName, FirstName,
Email, and wikiName are always included in the table. They are
required for registration.)
</div><!--//col2-->
<div class="foswikiClear"></div>
</div> <!-- foswikiFormStep -->
Expand Down Expand Up @@ -134,17 +135,6 @@ You can write additional data to the new user topics. Do this by enhancing the u

Any fields you define in this table will end up in the User's topic. If a form (such as %SYSTEMWEB%.UserForm) is attached to NewUserTemplate then the data will go in as META:FIELDS, meaning that you can use SEARCH formfield constructs to search.

---++++ Mandatory fields
* =WikiName=

---++++ Optional fields
* =LoginName= - __Required if the system is configured to__ ==AllowLoginName== (Commonly referred to as the UserName).
* =Email= - If not provided, you must set a password, or password reset will not be possible.
* =Password= - If not provided, set passwords later using BulkResetPassword.
* =Confirm= - If provided, it must match the =Password= field. If missing, it will not be checked.
* =templatetopic= - Template used when creating the User topic. If not provided, defaults to [[%USERSWEB%.NewUserTemplate]], or [[%SYSTEMWEB%.NewUserTemplate]].
* =AddToGroups= - A comma-separated list of groups. When user is registered, they will be added to the listed groups. The groups must exist.

---

%IF{
Expand Down
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1487815547" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1487907314" format="1.1" version="1"}%
%META:TOPICPARENT{name="BulkRegister"}%
%{<verbatim class="tml">
===================================================
Expand All @@ -18,22 +18,22 @@
---+ %SPACEOUT{"%TOPIC%"}%
%TEXT%
---
_Be sure to remember to save any table changes!_
%MAKETEXT{"_Be sure to remember to save any table changes!_"}%
%IF{"context isadmin" then="
<form name='bulkRegister' action='%SCRIPTURLPATH{"manage"}%/%TOPIC%' method='post'>
<input type='hidden' name='action' value='bulkRegister' /><sticky>&nbsp;</sticky>
<input type='submit' class='foswikiSubmit' value='Bulk Register these people' />
<input type='submit' class='foswikiSubmit' value='%MAKETEXT{"Bulk Register these users"}%' />
<input type='hidden' name='topic' value='%USERSWEB%.%TOPIC%' />
<input type='hidden' name='redirectto' value='%TOPIC%' />
<input type='hidden' name='redirectto' value='%TOPIC%#RegResults' />
<input type='hidden' name='LogTopic' value='%TOPIC%Log' />
<input type='hidden' name='templatetopic' value='%USER_TEMPLATE{default=""}%' />
</form> "
else="<div class='foswikiAlert'> *Bulk registration is restricted to Administrators.* </div>"}%
else="<div class='foswikiAlert'> %MAKETEXT{"*Bulk registration is restricted to Administrators.*"}% </div>"}%

%IF{"'%WEB%.%TOPIC%'/info.date < '%WEB%.%TOPIC%Log'/info.date" then="$percntINCLUDE{\"%TOPIC%Log\" warn=\"off\"}$percnt"}%

*Back to:* [[%SYSTEMWEB%.BulkRegistration][Bulk Registration]]
*%MAKETEXT{"Back to:"}%* [[%SYSTEMWEB%.BulkRegistration][Bulk Registration]]
----
*Related Topics:* %FORMFIELD{"RelatedTopics"}%%TMPL:END%%{
*%MAKETEXT{"Related Topics:"}%* [[System.BulkResetPassword]], [[System.ManagingUsers]]%TMPL:END%%{
===================================================
</verbatim>}%
4 changes: 2 additions & 2 deletions TopicUserMappingContrib/data/System/BulkResetPassword.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1434484983" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1487907314" format="1.1" version="1"}%
%META:TOPICPARENT{name="AdminToolsCategory"}%
---+ Bulk Reset Passwords

Expand Down Expand Up @@ -41,7 +41,7 @@ load the page for all users [[BulkResetPassword?pagesize=;pager=off][click here]
<div class='foswikiFormStep'>
---+++ Write message

*This text will be sent to users in their "reset" e-mail.* The login name and password will be filled in automatically.
%MAKETEXT{"*This text will be sent to users in their "reset" e-mail.* The login name and password will be filled in automatically."}%
<textarea class="foswikiInputField" name="Introduction" rows="4" cols="70" style="width:99%;">
Welcome! The site is ready for your use. Please use the login name and password listed below and contact me if you have any questions.
</textarea>
Expand Down
37 changes: 19 additions & 18 deletions TopicUserMappingContrib/data/System/NewUserTemplate.txt
@@ -1,6 +1,6 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1487815547" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1418937051" format="1.1" version="1"}%
%META:TOPICPARENT{name="WikiUsers"}%
---+ %TOPIC%
---+ <nop>%TOPIC%

%SPLIT%
* %KEY%: %VALUE%%SPLIT%
Expand All @@ -9,19 +9,20 @@
* Set ALLOWTOPICCHANGE = %WIKIUSERNAME%
-->

%META:FORM{name="UserForm"}%
%META:FIELD{name="FirstName" title="<nop>FirstName" value=""}%
%META:FIELD{name="LastName" title="<nop>LastName" value=""}%
%META:FIELD{name="OrganisationName" title="<nop>OrganisationName" value=""}%
%META:FIELD{name="OrganisationURL" title="<nop>OrganisationURL" value=""}%
%META:FIELD{name="Profession" title="Profession" value=""}%
%META:FIELD{name="Country" title="[[System.CountryList][Country]]" value=""}%
%META:FIELD{name="State" title="State" value=""}%
%META:FIELD{name="Address" title="Address" value=""}%
%META:FIELD{name="Location" title="Location" value=""}%
%META:FIELD{name="Telephone" title="Telephone" value=""}%
%META:FIELD{name="VoIP" title="<nop>VoIP" value=""}%
%META:FIELD{name="InstantMessagingIM" title="<nop>InstantMessaging (IM)" value=""}%
%META:FIELD{name="Email" title="Email" value=""}%
%META:FIELD{name="HomePage" title="<nop>HomePage" value=""}%
%META:FIELD{name="Comment" title="Comment" value=""}%

%META:FORM{name="%25SYSTEMWEB%25.UserForm"}%
%META:FIELD{name="FirstName" attributes="" title="<nop>FirstName" value=""}%
%META:FIELD{name="LastName" attributes="" title="<nop>LastName" value=""}%
%META:FIELD{name="OrganisationName" attributes="" title="<nop>OrganisationName" value=""}%
%META:FIELD{name="OrganisationURL" attributes="" title="<nop>OrganisationURL" value=""}%
%META:FIELD{name="Profession" attributes="" title="Profession" value=""}%
%META:FIELD{name="Country" attributes="" title="Country" value=""}%
%META:FIELD{name="State" attributes="" title="State" value=""}%
%META:FIELD{name="Address" attributes="" title="Address" value=""}%
%META:FIELD{name="Location" attributes="" title="Location" value=""}%
%META:FIELD{name="Telephone" attributes="" title="Telephone" value=""}%
%META:FIELD{name="VoIP" attributes="" title="<nop>VoIP" value=""}%
%META:FIELD{name="InstantMessagingIM" attributes="" title="<nop>InstantMessaging (IM)" value=""}%
%META:FIELD{name="Email" attributes="" title="Email" value=""}%
%META:FIELD{name="HomePage" attributes="" title="<nop>HomePage" value=""}%
%META:FIELD{name="Comment" attributes="" title="Comment" value=""}%
8 changes: 1 addition & 7 deletions core/lib/Foswiki/UI/Register.pm
Expand Up @@ -478,13 +478,7 @@ sub bulkRegister {
}

my $tmpl = $session->templates->readTemplate('registermessages');
$log .= $session->templates->expandTemplate('bulkreg_summary');

# If no passwords require reset, then don't generate the reset form.
if ($genReset) {
$log .= $session->templates->expandTemplate('bulkreg_pwreset_form');
}

$log .= $session->templates->expandTemplate('bulkreg_report');
$log .= $session->templates->expandTemplate('bulkreg_summary_head');

my $rowtmpl = $session->templates->expandTemplate('bulkreg_summary_row');
Expand Down
47 changes: 32 additions & 15 deletions core/templates/registermessages.tmpl
Expand Up @@ -459,31 +459,48 @@
%MAKETEXT{"[_1] topic not found. No users registered." args="%PARAM1%"}%

%MAKETEXT{"Please go back in your browser and try again."}%
%TMPL:END%
%{==============================================================================}%
%TMPL:DEF{"bulkreg_pwreset_form"}%
<form action='%SCRIPTURLPATH{"manage"}%/%BASEWEB%/%BASETOPIC%' method='post' />
<input type="hidden" name="action" value="resetPassword" />
<input type="submit" class="foswikiSubmit" value="Reset selected user passwords and send message" />
%TMPL:DEF{"bulkreg_report"}%
%STARTSECTION{type="include"}%
#RegResults
---+ %MAKETEXT{"Registration Results Summary"}%
%MAKETEXT{"Bulk Registration run by [_1] at [_2]. See [[[_3]]] for more detailed information." args="%REVINFO{format="$wikiusername"}%, %REVINFO{format="$date-$time"}%, %TOPIC%"}%

*This text will be sent to users in their "reset" e-mail.* The login name and password will be filled in automatically.
<textarea class="foswikiInputField" name="Introduction" rows="4" cols="70" style="width:99%;">
Welcome! The site is ready for your use. Please use the login name and password listed below and contact me if you have any questions.
</textarea>
%TMPL:P{"bulkreg_reset_formtop"}%
---++ %MAKETEXT{"Results"}%
%TMPL:END%
%{==============================================================================}%
%TMPL:DEF{"bulkreg_summary_head"}%
| *ok* | *WikiName* | *Reset Password* | *Results* |%TMPL:END%
%{==============================================================================}%
%TMPL:DEF{"bulkreg_summary"}%
%STARTSECTION{type="include"}%
---++ Summary of Registrations
Registration run by %REVINFO{format="$wikiusername at =$date-$time="}%. See [[%TOPIC%]] for more detailed information.

%TMPL:END%
%{==============================================================================}%
%TMPL:DEF{"bulkreg_summary_row"}%
| $flag | $wikiname | <input type='checkbox' name='LoginName' $state value='$wikiname' /> | $errors |%TMPL:END%
%{==============================================================================}%
%TMPL:DEF{"bulkreg_summary_foot"}%

%MAKETEXT{"*This text will be sent to users in their "reset" e-mail.* The login name and password will be filled in automatically."}%
%TMPL:P{"bulkreg_reset_formbot"}%
%ENDSECTION{type="include"}%
%TMPL:END%
%{==============================================================================}%
%TMPL:DEF{"bulkreg_reset_formtop"}%
<div id="bulkreset" class="foswikiFormSteps">
<form action='%SCRIPTURLPATH{"manage"}%/%BASEWEB%/%BASETOPIC%' method='post' />
%TMPL:END%
%{==============================================================================}%
%TMPL:DEF{"bulkreg_reset_formbot"}%
<input type="hidden" name="action" value="resetPassword" />
<div class="foswikiFormStep">
<textarea class="foswikiInputField" name="Introduction" rows="4" cols="70" style="width:99%;">
Welcome! The site is ready for your use. Please use the login name and password listed below and contact %WIKIWEBMASTER% if you have any questions.
</textarea>
</div> <!-- Formstep -->
<div class="foswikiClear"></div>
<div class="foswikiFormStep">
<input type="submit" class="foswikiSubmit" value="Reset selected user passwords and send message" />
</div> <!-- Formstep -->
<div class="foswikiClear"></div>
</div> <!-- formsteps -->
</form>
%TMPL:END%

0 comments on commit 0410a3b

Please sign in to comment.