Advanced

Advanced topics

Servlet: ResetPassword

com.pageseeder.ResetPassword

Description

This item is obsolete!

This servlet is no longer available since version 5.9.

The same functionality can be achieved with any of the following:

Resets a member's password and emails it to them.

HTTP Method: GET

Returns a blank XTemplate that can be used to produce the reset password form.

No parameters required.

HTTP Method: POST

Actually resets the password for the user if all parameters are correct.

In order to identify the user, either the username or email address is required. The date of birth is only required if the user has entered a date of birth in its user details.

Normal response

When the password was successfully reset, returns the following XTemplate and sets the HTTP status code to 200 :

<root>
  <!-- wo-constant, wo-jsessionid, wo-request -->
  <title>Password Reset Successful</title>
  <status>success</status>
  <message>Your new password has been emailed to you.
         | The new password has been emailed to the member.</message>
</root>

Error situations

If either the email or username is missing, this servlet will send a Bad request error (handled by the error handler).

If the member match the specified username and/or email, sets the HTTP status code to 400 and returns the following XTemplate:

<root>
  <!-- wo-constant, wo-jsessionid, wo-request -->
  <title>Member not found</title>
  <status>invalid-parameter</status>
  <message>No match for specified email and username</message>
</root> 

If multiple members share the same email address, sets the HTTP status code to 300 and returns the following XTemplate:

<root>
  <!-- wo-constant, wo-jsessionid, wo-request -->
  <dob>[date-of-birth]</dob>
  <email>[email]</email>
  <askforusername>true</askforusername>
</root>

If the date of birth is required, sets the HTTP status code to 400 and returns the following XTemplate:

<root>
  <!-- wo-constant, wo-jsessionid, wo-request -->
  <username>[username]</username>
  <email>[email]</email>
  <askfordob>true</askfordob>
</root> 

If the specified date of birth is invalid, sets the HTTP status code to 400 and returns the following XTemplate:

<root>
  <!-- wo-constant, wo-jsessionid, wo-request -->
  <title>Date of birth incorrect</title>
  <status>invalid-parameter</status>
  <message>The specified date of birth is invalid</message>
</root>

If the user currently logged in is an admin, sets the HTTP status code to 400 and returns the following XTemplate:

<root>
   <!-- wo-constant, wo-jsessionid, wo-request -->
   <title>Administrator password</title>
   <status>error</status>
   <message>Administrator passwords cannot be reset in this way.</message>
 </root>

HTTP Parameters

emailMember emailnoemail
usernameMember usernamenostring
dobMember Date of Birthnostring
groupThe group (used to display custom notification emails)nostring

PageSeeder Return Status

invalid-parameterEmail or username not found or the Date of birth incorrect
errorAdministrator password
successPassword Reset Successful

Created on , last edited on