diff --git a/src/Umbraco.Web.UI.Client/src/less/panel.less b/src/Umbraco.Web.UI.Client/src/less/panel.less index 062954f9c2..dd3f74d9d7 100644 --- a/src/Umbraco.Web.UI.Client/src/less/panel.less +++ b/src/Umbraco.Web.UI.Client/src/less/panel.less @@ -269,7 +269,36 @@ display: none; } +//Change password form in user flyout +//Styling overrides to avoid duplicating property editor code +.umb-panel-body .change-password{ + .umb-pane{ + margin:0; + + } + + .control-label{ + display: inline-block; + width: 46%; + vertical-align: top; + } + + .controls-row{ + margin-left:0 !important; + display: inline-block; + width: 47%; + + input[type=text], + input[type=password]{ + width: 100%; + } + } + + .umb-control-group{ + padding-bottom: 0; + } +} // Utility classes diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js index 68579bb442..50fe203f2b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js @@ -1,5 +1,5 @@ -angular.module("umbraco") - .controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService, externalLoginInfo, authResource) { +angular.module("umbraco") + .controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, currentUserResource, historyService, eventsService, externalLoginInfo, authResource) { $scope.history = historyService.getCurrent(); $scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion; @@ -102,4 +102,44 @@ angular.module("umbraco") }); + //create the initial model for change password property editor + $scope.changePasswordModel = { + alias: "_umb_password", + view: "changepassword", + config: {}, + value: {} + }; + + //go get the config for the membership provider and add it to the model + currentUserResource.getMembershipProviderConfig().then(function (data) { + $scope.changePasswordModel.config = data; + //ensure the hasPassword config option is set to true (the user of course has a password already assigned) + //this will ensure the oldPassword is shown so they can change it + $scope.changePasswordModel.config.hasPassword = true; + $scope.changePasswordModel.config.disableToggle = true; + }); + + ////this is the model we will pass to the service + //$scope.profile = {}; + + $scope.changePassword = function () { + + if (formHelper.submitForm({ scope: $scope })) { + currentUserResource.changePassword($scope.changePasswordModel.value).then(function (data) { + + //if the password has been reset, then update our model + if (data.value) { + $scope.changePasswordModel.value.generatedPassword = data.value; + } + + formHelper.resetForm({ scope: $scope, notifications: data.notifications }); + + }, function (err) { + + formHelper.handleError(err); + + }); + } + }; + }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html index 8346acfabb..94e94c0839 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html @@ -29,8 +29,8 @@

- -
+ +
External login providers
@@ -73,9 +73,31 @@
- + +
+
Change password
+ +

Enter your current password, then repeat your new password to change it

+
+ + + + + + + + + + + +
+
+
Umbraco version {{version}} - + \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 7913965a61..336d1303bb 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -2410,9 +2410,9 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\" - True - True - 7300 + True + True + 7300 / http://localhost:7400 False diff --git a/src/Umbraco.Web.UI/config/Dashboard.Release.config b/src/Umbraco.Web.UI/config/Dashboard.Release.config index b933000d0e..a1607fc88f 100644 --- a/src/Umbraco.Web.UI/config/Dashboard.Release.config +++ b/src/Umbraco.Web.UI/config/Dashboard.Release.config @@ -73,11 +73,6 @@ - - - views/dashboard/ChangePassword.html - -