From: Andrew Kim Date: Wed, 8 May 2013 22:57:51 +0000 (-0700) Subject: Fix user changing their password X-Git-Tag: releasepom-0.1.0~470 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=60ba2f16a5cfa1bc7bcfa0089df544225c70a4cd Fix user changing their password Wrong user was being sent to change the password (it was the session user). Signed-off-by: Andrew Kim --- diff --git a/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java b/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java index 7c45bb8cee..46b8d4e0fe 100644 --- a/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java +++ b/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java @@ -100,8 +100,6 @@ public class DaylightWebAdmin { @ResponseBody public Status changePassword(@PathVariable("username") String username, HttpServletRequest request, @RequestParam("currentPassword") String currentPassword, @RequestParam("newPassword") String newPassword) { - String user = request.getUserPrincipal().getName(); - IUserManager userManager = (IUserManager) ServiceHelper .getGlobalInstance(IUserManager.class, this); if (userManager == null) { @@ -116,7 +114,7 @@ public class DaylightWebAdmin { return new Status(StatusCode.BADREQUEST, "Empty passwords not allowed"); } - Status status = userManager.changeLocalUserPassword(user, currentPassword, newPassword); + Status status = userManager.changeLocalUserPassword(username, currentPassword, newPassword); return status; }