Move create new WebDAV password URL from /users to plain / for user.
authorDimitris Routsis <droutsis@ebs.gr>
Fri, 3 Jul 2009 12:54:27 +0000 (15:54 +0300)
committerDimitris Routsis <droutsis@ebs.gr>
Fri, 3 Jul 2009 12:54:27 +0000 (15:54 +0300)
src/gr/ebs/gss/client/CredentialsDialog.java
src/gr/ebs/gss/server/rest/RequestHandler.java

index 313a422..8989e5c 100644 (file)
@@ -299,7 +299,7 @@ public class CredentialsDialog extends DialogBox {
                        return;
                }
                GWT.log("resetPassword(" + userUri + ")", null);
-               PostCommand cg = new PostCommand(userUri + "users?resetWebDAV", "", 200) {
+               PostCommand cg = new PostCommand(userUri + "?resetWebDAV", "", 200) {
 
                        @Override
                        public void onComplete() {
index 1361210..5f21bf9 100644 (file)
@@ -184,7 +184,7 @@ public class RequestHandler extends Webdav {
                                        ", " + METHOD_DELETE);
                methodsAllowed.put(PATH_OTHERS, METHOD_GET);
                methodsAllowed.put(PATH_SEARCH, METHOD_GET);
-               methodsAllowed.put(PATH_USERS, METHOD_GET + ", " + METHOD_POST);
+               methodsAllowed.put(PATH_USERS, METHOD_GET);
                methodsAllowed.put(PATH_SHARED, METHOD_GET);
                methodsAllowed.put(PATH_TAGS, METHOD_GET);
                methodsAllowed.put(PATH_TRASH, METHOD_GET + ", " + METHOD_DELETE);
@@ -449,9 +449,10 @@ public class RequestHandler extends Webdav {
                } else if (path.startsWith(PATH_SEARCH)) {
             resp.addHeader("Allow", methodsAllowed.get(PATH_SEARCH));
                        resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
-               } else if (path.startsWith(PATH_USERS))
-                       new UserHandler().postUser(req, resp);
-               else if (path.startsWith(PATH_SHARED)) {
+               } else if (path.startsWith(PATH_USERS)) {
+                       resp.addHeader("Allow", methodsAllowed.get(PATH_USERS));
+                       resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+               } else if (path.startsWith(PATH_SHARED)) {
             resp.addHeader("Allow", methodsAllowed.get(PATH_SHARED));
                        resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
                } else if (path.startsWith(PATH_TAGS)) {
@@ -464,6 +465,8 @@ public class RequestHandler extends Webdav {
                        resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
                } else if (path.startsWith(PATH_FILES))
                        new FilesHandler(getServletContext()).postResource(req, resp);
+               else if (path.equals("/"))
+                       new UserHandler().postUser(req, resp);
                else
                resp.sendError(HttpServletResponse.SC_NOT_FOUND, req.getRequestURI());
        }