Repository: incubator-ignite Updated Branches: refs/heads/ignite-843 68fc3dd7e -> a90e37d21
# ignite-843 Minor fix. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a90e37d2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a90e37d2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a90e37d2 Branch: refs/heads/ignite-843 Commit: a90e37d21fe0fa6dcde9e760717f2b1ac254861d Parents: 68fc3dd Author: Andrey <anovi...@gridgain.com> Authored: Fri Jul 10 13:21:41 2015 +0700 Committer: Andrey <anovi...@gridgain.com> Committed: Fri Jul 10 13:21:41 2015 +0700 ---------------------------------------------------------------------- .../nodejs/controllers/caches-controller.js | 4 +++- .../nodejs/controllers/clusters-controller.js | 4 +++- .../nodejs/controllers/persistences-controller.js | 4 +++- .../nodejs/controllers/profile-controller.js | 6 ++---- modules/web-control-center/nodejs/routes/profile.js | 8 +------- 5 files changed, 12 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a90e37d2/modules/web-control-center/nodejs/controllers/caches-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/controllers/caches-controller.js b/modules/web-control-center/nodejs/controllers/caches-controller.js index 9d572ba..1853866 100644 --- a/modules/web-control-center/nodejs/controllers/caches-controller.js +++ b/modules/web-control-center/nodejs/controllers/caches-controller.js @@ -113,7 +113,7 @@ controlCenterModule.controller('cachesController', ['$scope', '$alert', '$http', var restoredItem = angular.fromJson(sessionStorage.cacheBackupItem); - if (restoredItem) { + if (restoredItem && restoredItem._id) { var idx = _.findIndex($scope.caches, function (cache) { return cache._id == restoredItem._id; }); @@ -126,6 +126,8 @@ controlCenterModule.controller('cachesController', ['$scope', '$alert', '$http', else sessionStorage.removeItem('cacheBackupItem'); } + else + $scope.backupItem = restoredItem; $scope.$watch('backupItem', function (val) { if (val) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a90e37d2/modules/web-control-center/nodejs/controllers/clusters-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/controllers/clusters-controller.js b/modules/web-control-center/nodejs/controllers/clusters-controller.js index 8f26341..cc1369b 100644 --- a/modules/web-control-center/nodejs/controllers/clusters-controller.js +++ b/modules/web-control-center/nodejs/controllers/clusters-controller.js @@ -108,7 +108,7 @@ controlCenterModule.controller('clustersController', ['$scope', '$alert', '$http var restoredItem = angular.fromJson(sessionStorage.clusterBackupItem); - if (restoredItem) { + if (restoredItem && restoredItem._id) { var idx = _.findIndex($scope.clusters, function (cluster) { return cluster._id == restoredItem._id; }); @@ -121,6 +121,8 @@ controlCenterModule.controller('clustersController', ['$scope', '$alert', '$http else sessionStorage.removeItem('clusterBackupItem'); } + else + $scope.backupItem = restoredItem; $scope.$watch('backupItem', function (val) { if (val) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a90e37d2/modules/web-control-center/nodejs/controllers/persistences-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/controllers/persistences-controller.js b/modules/web-control-center/nodejs/controllers/persistences-controller.js index 566c857..3d3f8cc 100644 --- a/modules/web-control-center/nodejs/controllers/persistences-controller.js +++ b/modules/web-control-center/nodejs/controllers/persistences-controller.js @@ -49,7 +49,7 @@ controlCenterModule.controller('persistenceController', ['$scope', '$alert', '$h var restoredItem = angular.fromJson(sessionStorage.persistenceBackupItem); - if (restoredItem) { + if (restoredItem && restoredItem._id) { var idx = _.findIndex($scope.persistences, function (persistence) { return persistence._id == restoredItem._id; }); @@ -62,6 +62,8 @@ controlCenterModule.controller('persistenceController', ['$scope', '$alert', '$h else sessionStorage.removeItem('persistenceBackupItem'); } + else + $scope.backupItem = restoredItem; $scope.$watch('backupItem', function (val) { if (val) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a90e37d2/modules/web-control-center/nodejs/controllers/profile-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/controllers/profile-controller.js b/modules/web-control-center/nodejs/controllers/profile-controller.js index f6330a7..39b3b6e 100644 --- a/modules/web-control-center/nodejs/controllers/profile-controller.js +++ b/modules/web-control-center/nodejs/controllers/profile-controller.js @@ -45,15 +45,14 @@ controlCenterModule.controller('profileController', ['$scope', '$alert', '$http' if ($scope.profileUser) { var userName = profile.username; var email = profile.email; - var oldPassword = profile.oldPassword; var newPassword = profile.newPassword; var confirmPassword = profile.confirmPassword; var changeUsername = userName && userName.length > 0 && userName != $scope.loggedInUser.username; var changeEmail = email && email.length > 0 && email != $scope.loggedInUser.email; - var changePassword = profile.changePassword && oldPassword && newPassword && confirmPassword && - oldPassword.length > 0 && newPassword.length > 0 && confirmPassword.length > 0 && newPassword == confirmPassword; + var changePassword = profile.changePassword && newPassword && confirmPassword && + newPassword.length > 0 && confirmPassword.length > 0 && newPassword == confirmPassword; if (changeUsername || changeEmail || changePassword) { $http.post('/profile/saveUser', { @@ -63,7 +62,6 @@ controlCenterModule.controller('profileController', ['$scope', '$alert', '$http' changeEmail: changeEmail, email: email, changePassword: changePassword, - oldPassword: oldPassword, newPassword: newPassword, confirmPassword: confirmPassword }).success(function () { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a90e37d2/modules/web-control-center/nodejs/routes/profile.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/routes/profile.js b/modules/web-control-center/nodejs/routes/profile.js index 79c70c5..586df3d 100644 --- a/modules/web-control-center/nodejs/routes/profile.js +++ b/modules/web-control-center/nodejs/routes/profile.js @@ -67,19 +67,13 @@ router.post('/saveUser', function (req, res) { } if (params.changePassword) { - var oldPassword = params.oldPassword; var newPassword = params.newPassword; var confirmPassword = params.confirmPassword; - var zz = user.verifyPassword(oldPassword); - - if (!oldPassword || oldPassword.length == 0 || !zz) - return res.status(500).send('Wrong value for old password'); - if (!newPassword || newPassword.length == 0) return res.status(500).send('Wrong value for new password'); - if (!confirmPassword || confirmPassword.length == 0 || newPassword != oldPassword) + if (!confirmPassword || confirmPassword.length == 0 || newPassword != confirmPassword) return res.status(500).send('New password does not match confirmation'); db.Account.findById(params._id, function (err, user) {