%{
}%
%TMPL:INCLUDE{"view"}%
%{
}%

%{
}%
%TMPL:DEF{"title"}%%HTMLTITLE{"%MAKETEXT{"Change password"}%" separator=" %IF{"defined 'HTMLTITLESEP'" then="%HTMLTITLESEP%" else="-"}% "}%%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"DIScontentheader"}%%TMPL:END%
%TMPL:DEF{"topicactions"}%%TMPL:END%
%TMPL:DEF{"revinfo"}%%TMPL:END%
%TMPL:DEF{"newtopictitle"}%%URLPARAM{"newtopictitle"}%%TMPL:END%
%TMPL:DEF{"newtopic"}%%URLPARAM{"newtopic"}%%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"content"}%%TMPL:P{context="passwords_modifyable" then="changepasswordform" else="nochangepassword"}%%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"sidebar"}%%TMPL:P{"sidebar::usertools"}%%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"nochangepassword"}%<div class="foswikiErrorMessage">
%MAKETEXT{"Sorry, passwords can't be changed."}%
</div>%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"changepasswordform"}%<!-- -->
<noautolink>
%TMPL:P{"formtitle"}%<!-- -->
%TMPL:P{"formstartstep"}%<!-- -->
%TMPL:P{"loginstep"}%<!-- -->
%TMPL:P{"oldpasswordstep"}%<!-- -->
%TMPL:P{"newpasswordstep"}%<!-- -->
%TMPL:P{"formbuttons"}%<!-- -->
%TMPL:P{"formendstep"}%<!-- -->
%TMPL:P{"formvalidation"}%<!-- -->
</noautolink>
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"formtitle"}%<!-- -->
<h1 >%MAKETEXT{"Change password"}%</h1>
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"formbuttons"}%<!-- -->
<div class="foswikiFormDescription">
  %MAKETEXT{"After submitting this form your password will be changed. If you've forgotten use [_1] to create a new one." args="[[%SYSTEMWEB%.ResetPassword]]"}%
</div>
<div class='foswikiFormStep foswikiFormButtons'>
%TMPL:P{"submit"}%%CLEAR%
</div>
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"formstartstep"}%<!-- -->
%TMPL:P{"formstart"}%
<div class="foswikiFormSteps">
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"formstart"}%<!-- -->
<form name="changePasswordForm" id="changePasswordForm" action="%SCRIPTURLPATH{"manage"}%/%SYSTEMWEB%/%HOMETOPIC%" method="post">
<input type="hidden" name="action" value="changePassword" />
<input type="hidden" name="t" value="%GMTIME{"$epoch"}%" />
<input type="hidden" name="TopicName" value="%TOPIC%" />
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"formendstep"}%</div>%TMPL:P{"formend"}%%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"formend"}%</form>

%MAKETEXT{"If you have any questions, please contact [_1]" args="%WIKIWEBMASTER%"}%
<div class="foswikiErrorMessage" id="summary" style="display:none"></div>
%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"submit"}%<!-- -->
%BUTTON{"%MAKETEXT{"Change password"}%" %IF{"not context passwords_modifyable" then="disabled=\"on\""}% type="submit" icon="key_go" class="jqSimpleModalOK"}%
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"loginstep"}%<!-- -->
<div class="foswikiFormStep">
  <h3 >%MAKETEXT{"Login"}%:</h3>
  <input type="text" name="username" id="username" value="%URLPARAM{"username" default="%USERNAME%"}%" size="40" class="foswikiInputField" />
  <div class="foswikiFormDescription">
    %MAKETEXT{"Your login name. Note, you can't change your login name. Contact the administrator to do this for you."}%
  </div>
</div>
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"oldpasswordstep"}%<!-- -->
<div class="foswikiFormStep">
  <h3 >%MAKETEXT{"Current password"}%:</h3>
  <input type="password" name="oldpassword" id="oldpassword" value="%URLPARAM{oldpassword}%" size="40" class="foswikiInputField" />
  <div class="foswikiFormDescription">
    %MAKETEXT{"Enter the current password for the given !LoginName."}%
  </div>
</div>
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"newpasswordstep"}%<!-- -->
<div class="foswikiFormStep">
  <h3 >%MAKETEXT{"New password"}%:</h3>
  <input type="password" name="password" id="password" size="40" class="foswikiInputField" /> 
  <a href="#" class="jqGeneratePassword" %TMPL:P{"password::params"}% data-target="#password">%JQICON{"key"}% %MAKETEXT{"Random password"}%</a>
  <div class="foswikiFormDescription">
    %MAKETEXT{"Enter a new password. Please don't use a trivial password that could easily be guessed."}%
  </div>
</div>
<div class="foswikiFormStep">
  <h3 >%MAKETEXT{"Retype new password"}%:</h3>
  <input type="password" name="passwordA" id="passwordA" size="40" class="foswikiInputField" /> 
</div>
<!-- -->%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"password::params"}%data-length="15" data-capitals="true" data-numbers="true" data-duplicates="true"%TMPL:END%
%{
}%

%{
}%
%TMPL:DEF{"formvalidation"}%<!-- -->
%JQREQUIRE{"validate"}%<!-- -->
%ADDTOZONE{"script"
  requires="JQUERYPLUGIN"
  id="NATSKIN:PASSWORD"
  text="<script type='text/javascript' src='%PUBURLPATH%/%SYSTEMWEB%/NatSkin/password.js'></script>"
}%<!-- -->
<style>.jqGeneratePassword { text-decoration:none; padding-left:1em; }</style>
%ADDTOZONE{"script" 
  requires="JQUERYPLUGIN::VALIDATE"
  id="NATSKIN::VALIDATE::CHANGEPASSWORD"
  text="<literal>
<script type='text/javascript'>
jQuery(function($) {
  var $form = $('#changePasswordForm')
    .bind('invalid-form.validate', function(e, validator) {
      var errors = validator.numberOfInvalids();
      if (errors) {
        $('#summary').html('%MAKETEXT{"There was an error. Please, see above."}%').show();
      } else {
        $('#summary').hide();
      }
    })
    .validate({
      rules: {
        username: {
          required: true
        },
        oldpassword: {
          required: true
        },
        password: {
          required: true,
          minlength: 3 /* on foswiki > 1.1 use '%QUERY{"{MinPasswordLength}"}% */
        },
        passwordA: {
          required: true,
          equalTo: '#password'
        }
      },
      messages: {
        username: {
          required: '%MAKETEXT{"Enter a login name"}%'
        },
        oldpassword: {
          required: '%MAKETEXT{"Provide a password"}%'
        },
        password: {
          required: '%MAKETEXT{"Provide a new password"}%'
        },
        passwordA: {
          required: '%MAKETEXT{"Repeat your new password"}%',
          equalTo: '%MAKETEXT{"Enter the same password as above"}%'
        }
      }
    });
});
</script></literal>"
}% 
<!-- -->%TMPL:END%
%{
}%

This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding AustLII Communities? Send feedback
This website is using cookies. More info. That's Fine