public class ChangeUserPasswordServlet extends AbstractAuthorizablePostServlet implements ChangeUserPassword
Changes the password associated with a user. Maps on to nodes of resourceType sling/user
like
/rep:system/rep:userManager/rep:users/ae/fd/3e/ieb
mapped to a resource url
/system/userManager/user/ieb
. This servlet responds at
/system/userManager/user/ieb.changePassword.html
curl -FoldPwd=oldpassword -FnewPwd=newpassword -FnewPwdConfirm=newpassword http://localhost:8080/system/userManager/user/ieb.changePassword.html
PROP_DATE_FORMAT
Constructor and Description |
---|
ChangeUserPasswordServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(Map<String,Object> props)
Activates this component.
|
protected void |
bindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator,
Map<String,Object> properties)
Overridden since the @Reference annotation is not inherited from the super method
|
org.apache.jackrabbit.api.security.user.User |
changePassword(javax.jcr.Session jcrSession,
String name,
String oldPassword,
String newPassword,
String newPasswordConfirm,
List<org.apache.sling.servlets.post.Modification> changes)
Update the password of a user in the repository
|
protected void |
deactivate() |
protected void |
handleOperation(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.servlets.post.PostResponse response,
List<org.apache.sling.servlets.post.Modification> changes)
Extending Servlet should implement this operation to do the work
|
protected void |
unbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator,
Map<String,Object> properties)
Unbind a post response creator
|
collectContent, convertToRequestParameterArray, convertToString, convertToStringArray, hasItemPathPrefix, processDeletes, requireItemPathPrefix, writeContent
createHtmlResponse, doPost, externalizePath, getItemPath, getRedirectUrl, getRedirectUrl, handleOperation, isSetStatus
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService
doGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
protected void activate(Map<String,Object> props)
activate
in class AbstractAuthorizablePostServlet
props
- The component propertiesprotected void deactivate()
deactivate
in class AbstractAuthorizablePostServlet
protected void bindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)
protected void unbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)
AbstractPostServlet
unbindPostResponseCreator
in class AbstractPostServlet
protected void handleOperation(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.servlets.post.PostResponse response, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException
AbstractPostServlet
handleOperation
in class AbstractPostServlet
request
- the sling http request to processresponse
- the responsechanges
- the changes to reportjavax.jcr.RepositoryException
- in case of exceptions during the operationpublic org.apache.jackrabbit.api.security.user.User changePassword(javax.jcr.Session jcrSession, String name, String oldPassword, String newPassword, String newPasswordConfirm, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException
ChangeUserPassword
changePassword
in interface ChangeUserPassword
jcrSession
- the JCR session of the user updating the username
- The name of the user to update (required)oldPassword
- The current password of the user (required for non-admin users)newPassword
- The password value to apply (required)newPasswordConfirm
- The password value to apply again (required)changes
- The list of changes for this operation (optional)javax.jcr.RepositoryException
- if password can't be changed for some reasonCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.