SHOW:
|
|
- or go back to the newest paste.
| 1 | - | diff --git a/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java b/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apac |
| 1 | + | Index: src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java |
| 2 | - | index 638bcbd..ad6a69c 100644 |
| 2 | + | =================================================================== |
| 3 | - | --- a/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java |
| 3 | + | --- src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java (revision 1340341) |
| 4 | - | +++ b/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java |
| 4 | + | +++ src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java (working copy) |
| 5 | - | @@ -22,6 +22,7 @@ import java.util.Map; |
| 5 | + | @@ -41,6 +41,7 @@ |
| 6 | - | |
| 6 | + | import org.apache.sling.jcr.api.SlingRepository; |
| 7 | - | import javax.jcr.RepositoryException; |
| 7 | + | import org.apache.sling.jcr.base.util.AccessControlUtil; |
| 8 | - | import javax.jcr.Session; |
| 8 | + | import org.apache.sling.servlets.post.Modification; |
| 9 | - | +import javax.jcr.SimpleCredentials; |
| 9 | + | +import org.apache.sling.servlets.post.ModificationType; |
| 10 | - | import javax.servlet.Servlet; |
| 10 | + | import org.apache.sling.servlets.post.SlingPostConstants; |
| 11 | - | |
| 11 | + | import org.apache.sling.servlets.post.impl.helper.RequestProperty; |
| 12 | - | import org.apache.felix.scr.annotations.Component; |
| 12 | + | import org.osgi.service.component.ComponentContext; |
| 13 | - | @@ -207,8 +208,12 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create |
| 13 | + | @@ -207,10 +208,23 @@ |
| 14 | request.getRequestParameterMap(), | |
| 15 | changes); | |
| 16 | ||
| 17 | - String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX | |
| 18 | - + user.getID(); | |
| 19 | - | + String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX; |
| 19 | + | - response.setPath(userPath); |
| 20 | - | + if (user != null) {
|
| 20 | + | - response.setLocation(externalizePath(request, userPath)); |
| 21 | - | + userPath += user.getID(); |
| 21 | + | + String userPath = null; |
| 22 | + if (user == null) {
| |
| 23 | - | + userPath += "<null user>"; |
| 23 | + | + if (changes.size() > 0) {
|
| 24 | + Modification modification = changes.get(0); | |
| 25 | - | response.setPath(userPath); |
| 25 | + | + if (modification.getType() == ModificationType.CREATE) {
|
| 26 | - | response.setLocation(externalizePath(request, userPath)); |
| 26 | + | + userPath = modification.getSource(); |
| 27 | + } | |
| 28 | - | @@ -310,13 +315,22 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create |
| 28 | + | + } |
| 29 | - | } |
| 29 | + | |
| 30 | - | |
| 30 | + | + userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX |
| 31 | - | if (useAdminSession) {
|
| 31 | + | + + user.getID(); |
| 32 | - | - //lookup the user from the user session so we can return a live object |
| 32 | + | |
| 33 | - | - UserManager userManager2 = AccessControlUtil.getUserManager(jcrSession); |
| 33 | + | + |
| 34 | - | - Authorizable authorizable2 = userManager2.getAuthorizable(user.getID()); |
| 34 | + | + if (userPath != null) {
|
| 35 | - | - if (authorizable2 instanceof User) {
|
| 35 | + | + response.setPath(userPath); |
| 36 | - | - user = (User)authorizable2; |
| 36 | + | + response.setLocation(externalizePath(request, userPath)); |
| 37 | - | - } else {
|
| 37 | + | |
| 38 | - | - user = null; |
| 38 | + | |
| 39 | - | + Session userSession = null; |
| 39 | + | AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PATH)); |
| 40 | - | + try {
|
| 40 | + | } |