syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matte...@apache.org
Subject syncope git commit: [SYNCOPE-942] fixes bug in changing security answer in enduser
Date Mon, 03 Oct 2016 07:27:09 GMT
Repository: syncope
Updated Branches:
  refs/heads/master b85e14b85 -> 8d55cbe43


[SYNCOPE-942] fixes bug in changing security answer in enduser


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/8d55cbe4
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/8d55cbe4
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/8d55cbe4

Branch: refs/heads/master
Commit: 8d55cbe430f2a272f6838bd1a1a7edfad87e3ab2
Parents: b85e14b
Author: Matteo Di Carlo <matteo.dicarlo@tirasa.net>
Authored: Mon Oct 3 09:16:33 2016 +0200
Committer: Matteo Di Carlo <matteo.dicarlo@tirasa.net>
Committed: Mon Oct 3 09:26:42 2016 +0200

----------------------------------------------------------------------
 .../resources/app/js/controllers/UserController.js  | 16 +++++++++-------
 .../resources/app/js/services/groupService.js       |  2 --
 .../resources/app/js/services/schemaService.js      |  4 ++--
 .../resources/app/views/dynamicPlainAttributes.html |  3 ++-
 .../resources/app/views/user-credentials.html       |  2 +-
 5 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/8d55cbe4/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
index c6b0b4e..5e38b82 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
@@ -37,7 +37,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope',
'$l
     $scope.availableRealms = [];
     $scope.availableSecurityQuestions = [];
 
-    $scope.initialSecurityQuestion = undefined;
+    $scope.initialSecurityQuestion = '';
     $scope.captchaInput = {
       value: ""
     };
@@ -198,7 +198,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope',
'$l
             return x < y ? -1 : x > y ? 1 : 0;
           });
         }, function (e) {
-          $scope.showError("An error occur during retrieving groups " + e, $scope.notification)
+          $scope.showError("An error occur during retrieving groups " + e, $scope.notification);
         });
       };
 
@@ -243,9 +243,11 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope',
'$l
         UserSelfService.read().then(function (response) {
           $scope.user = UserUtil.getUnwrappedUser(response);
           $scope.user.password = undefined;
+          
           $scope.initialSecurityQuestion = $scope.user.securityQuestion;
           // initialize already assigned resources
           $scope.dynamicForm.selectedResources = $scope.user.resources;
+ 
           // initialize already assigned groups -- keeping the same structure of groups 
     
           for (var index in $scope.user.memberships) {
             $scope.dynamicForm.selectedGroups.push(
@@ -296,9 +298,8 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope',
'$l
 
         //removing derived schemas
         for (var i = 0; i < $scope.dynamicForm.derSchemas.length; i++) {
-          if ((anyTypeClass && $scope.dynamicForm.derSchemas[i].anyTypeClass == anyTypeClass)
+          if ((anyTypeClass && $scope.dynamicForm.derSchemas[i].anyTypeClass ===
anyTypeClass)
                   || (group && $scope.dynamicForm.derSchemas[i].key.includes(group
+ '#'))) {
-
             //cleaning both form and user model
             delete $scope.user.derAttrs[$scope.dynamicForm.derSchemas[i].key];
             $scope.dynamicForm.derSchemas.splice(i, 1);
@@ -307,9 +308,8 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope',
'$l
         }
         //removing virtual schemas
         for (var i = 0; i < $scope.dynamicForm.virSchemas.length; i++) {
-          if ((anyTypeClass && $scope.dynamicForm.virSchemas[i].anyTypeClass == anyTypeClass)
+          if ((anyTypeClass && $scope.dynamicForm.virSchemas[i].anyTypeClass ===
anyTypeClass)
                   || (group && $scope.dynamicForm.virSchemas[i].key.includes(group
+ '#'))) {
-
             //cleaning both form and user model
             delete $scope.user.virAttrs[$scope.dynamicForm.virSchemas[i].key];
             $scope.dynamicForm.virSchemas.splice(i, 1);
@@ -344,7 +344,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope',
'$l
           username: '',
           password: '',
           realm: '/',
-          securityQuestion: undefined,
+          securityQuestion: '',
           securityAnswer: '',
           plainAttrs: {},
           derAttrs: {},
@@ -410,6 +410,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope',
'$l
         });
       }
     };
+    
     $scope.retrieveSecurityQuestion = function (user) {
       if ($rootScope.pwdResetRequiringSecurityQuestions) {
         if (user && user.username && user.username.length) {
@@ -431,6 +432,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope',
'$l
         }
       }
     };
+    
     $scope.resetPassword = function (user) {
       if (user && user.username) {
         $scope.retrieveSecurityQuestion(user);

http://git-wip-us.apache.org/repos/asf/syncope/blob/8d55cbe4/client/enduser/src/main/resources/META-INF/resources/app/js/services/groupService.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/services/groupService.js
b/client/enduser/src/main/resources/META-INF/resources/app/js/services/groupService.js
index 1de1ef1..59d0e7f 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/services/groupService.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/services/groupService.js
@@ -22,9 +22,7 @@
 angular.module('self')
         .factory('GroupService', ['$resource', '$q', '$http',
           function ($group, $q, $http) {
-
             var groupService = {};
-
             groupService.getGroups = function (realm) {
               return  $http.get("/syncope-enduser/api/groups?realm=" + encodeURI(realm))
                       .then(function (response) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/8d55cbe4/client/enduser/src/main/resources/META-INF/resources/app/js/services/schemaService.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/services/schemaService.js
b/client/enduser/src/main/resources/META-INF/resources/app/js/services/schemaService.js
index 2d86dac..dd5ff3a 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/services/schemaService.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/services/schemaService.js
@@ -26,9 +26,9 @@ angular.module('self')
             var schemaService = {};
 
             schemaService.getUserSchemas = function (anyTypeClass) {
-              var param = anyTypeClass ? "?anyTypeClass=" + encodeURI(anyTypeClass) : "";
+              var classParam = anyTypeClass ? "?anyTypeClass=" + encodeURI(anyTypeClass)
: "";
 
-              return  $http.get("/syncope-enduser/api/schemas" + param)
+              return  $http.get("/syncope-enduser/api/schemas" + classParam)
                       .then(function (response) {
                         return response.data;
                       }, function (response) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/8d55cbe4/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttributes.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttributes.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttributes.html
index 8a21985..9932f8b 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttributes.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttributes.html
@@ -16,18 +16,19 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
-
 <div ng-repeat="groupSchema in dynamicForm.groupSchemas">
   <uib-accordion ng-if="getByGroup(groupSchema).length > 0">
     <div uib-accordion-group heading="{{groupSchema| translate}}"
          ng-init="status = {isOpen: (groupSchema == 'own')}" is-open="status.isOpen"
          class="breadcrumb-header">
+
       <div id="attribute" class="form-group" ng-repeat="plainSchema in getByGroup(groupSchema)
track by $index">
         <label for="plainSchema.key">{{plainSchema.simpleKey| translate}} <span
ng-if="plainSchema.mandatoryCondition === 'true'">*</span></label>
         <div ng-if="!plainSchema.multivalue">
           <dynamic-plain-attribute schema="plainSchema" user="user" index="0"></dynamic-plain-attribute>
           <validation-message name="{{plainSchema.key| translate}}"/>
         </div>
+        
         <div ng-if="plainSchema.multivalue">
           <div ng-repeat="field in dynamicForm.attributeTable[plainSchema.key].fields
track by $index" 
                ng-model='dynamicForm.attributeTable[plainSchema.key].fields[$index]'>

http://git-wip-us.apache.org/repos/asf/syncope/blob/8d55cbe4/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
index f993d4d..06cfe39 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
@@ -56,7 +56,7 @@ under the License.
 
 <div id="attribute" class="form-group">
   <label for="securityAnswer">{{'SECURITYANSWER' | translate}}</label>
-  <input ng-disabled="user.securityQuestion === initialSecurityQuestion" name="securityAnswer"
type="text" class="form-control" 
+  <input ng-disabled="user.securityQuestion === null || user.securityQuestion === ''"
name="securityAnswer" type="text" class="form-control" 
          ng-model="user.securityAnswer"
          placeholder="security answer">
 </div>


Mime
View raw message