-
+
- Settings +
- Credentials +
- Installation +
- Roles +
- Scope +
- Sessions +
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js index a1c967d121ee..ae18772105ab 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js @@ -306,6 +306,18 @@ module.config([ '$routeProvider', function($routeProvider) { }, controller : 'ApplicationInstallationCtrl' }) + .when('/realms/:realm/applications/:application/sessions', { + templateUrl : 'partials/application-sessions.html', + resolve : { + realm : function(RealmLoader) { + return RealmLoader(); + }, + application : function(ApplicationLoader) { + return ApplicationLoader(); + } + }, + controller : 'ApplicationSessionsCtrl' + }) .when('/create/application/:realm', { templateUrl : 'partials/application-detail.html', resolve : { diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/applications.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/applications.js index 30dde4d62993..90c51d425ab8 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/applications.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/applications.js @@ -94,9 +94,10 @@ module.controller('ApplicationCredentialsCtrl', function($scope, $location, real }); }); - - - +module.controller('ApplicationSessionsCtrl', function($scope, $location, realm, application) { + $scope.realm = realm; + $scope.application = application; +}); module.controller('ApplicationRoleDetailCtrl', function($scope, realm, application, role, ApplicationRole, $location, Dialog, Notifications) { $scope.realm = realm; diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/realm.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/realm.js index 134eae607304..999c6b4c924b 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/realm.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/realm.js @@ -843,9 +843,13 @@ module.controller('RoleDetailCtrl', function($scope, realm, role, Role, $locatio }); module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, realm, $http, $location, Dialog, Notifications) { + console.log('RealmSMTPSettingsCtrl'); + + var booleanSmtpAtts = ["auth","ssl","starttls"]; + $scope.realm = { id : realm.id, realm : realm.realm, social : realm.social, registrationAllowed : realm.registrationAllowed, - smtpServer: realm.smtpServer + smtpServer: typeObject(realm.smtpServer) }; var oldCopy = angular.copy($scope.realm); @@ -859,6 +863,7 @@ module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, real $scope.save = function() { var realmCopy = angular.copy($scope.realm); + realmCopy['smtpServer'] = detypeObject(realmCopy.smtpServer); $scope.changed = false; Realm.update(realmCopy, function () { $location.url("/realms/" + realm.id + "/smtp-settings"); @@ -870,4 +875,38 @@ module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, real $scope.realm = angular.copy(oldCopy); $scope.changed = false; }; + + /* Convert string attributes containing a boolean to actual boolean type + convert an integer string (port) to integer. */ + function typeObject(obj){ + for (var att in obj){ + if (booleanSmtpAtts.indexOf(att) < 0) + continue; + if (obj[att] === "true"){ + obj[att] = true; + } else if (obj[att] === "false"){ + obj[att] = false; + } + } + + obj['port'] = parseInt(obj['port']); + + return obj; + } + + /* Convert all non-string values to strings to invert changes caused by the typeObject function. */ + function detypeObject(obj){ + for (var att in obj){ + if (booleanSmtpAtts.indexOf(att) < 0) + continue; + if (obj[att] === true){ + obj[att] = "true"; + } else if (obj[att] === false){ + obj[att] = "false" + } + } + + obj['port'] = obj['port'].toString(); + + return obj; + } }); \ No newline at end of file diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-credentials.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-credentials.html index fd7bb6d1996f..b39ece6cae1e 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-credentials.html +++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-credentials.html @@ -9,7 +9,7 @@