Merging with upstream

4.x.x
Ace 8 years ago
commit bd45b27cc9

@ -5,7 +5,7 @@
"httpsWebURL" : "%https.ip%", "httpsWebURL" : "%https.ip%",
"wssURL" : "https://localhost:9445", "wssURL" : "https://localhost:9445",
"wsURL" : "%http.ip%", "wsURL" : "%http.ip%",
"portalURL": "https://${server.ip}:9445", "portalURL": "https://%server.ip%:9445",
"dashboardServerURL" : "%https.ip%", "dashboardServerURL" : "%https.ip%",
"androidEnrollmentDir": "/android-web-agent/enrollment", "androidEnrollmentDir": "/android-web-agent/enrollment",
"windowsEnrollmentDir": "/windows-web-agent/enrollment", "windowsEnrollmentDir": "/windows-web-agent/enrollment",

@ -33,6 +33,9 @@ var conf = function () {
} else if ((typeof value === "string") && value.indexOf("%date-year%") > -1) { } else if ((typeof value === "string") && value.indexOf("%date-year%") > -1) {
var year = new Date().getFullYear(); var year = new Date().getFullYear();
return value.replace("%date-year%", year); return value.replace("%date-year%", year);
} else if ((typeof value === "string") && value.indexOf("%server.ip%") > -1) {
var getProperty = require("process").getProperty;
return value.replace("%server.ip%", getProperty("carbon.local.ip"));
} }
return value; return value;
} }

@ -90,9 +90,15 @@ var handlers = function () {
"missing - setupTokenPairByPasswordGrantType(x, y)"); "missing - setupTokenPairByPasswordGrantType(x, y)");
} else { } else {
var tokenData; var tokenData;
var arrayOfScopes = devicemgtProps["scopes"];
var stringOfScopes = "";
arrayOfScopes.forEach(function (entry) {
stringOfScopes += entry + " ";
});
// accessTokenPair will include current access token as well as current refresh token // accessTokenPair will include current access token as well as current refresh token
tokenData = tokenUtil. tokenData = tokenUtil.
getTokenPairAndScopesBySAMLGrantType(samlToken, encodedClientAppCredentials, "PRODUCTION"); getTokenPairAndScopesBySAMLGrantType(samlToken, encodedClientAppCredentials, stringOfScopes);
if (!tokenData) { if (!tokenData) {
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up token " + throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up token " +
"pair by password grant type. Error in token " + "pair by password grant type. Error in token " +

@ -119,10 +119,9 @@
<div id="user-names"> <div id="user-names">
<h4> <h4>
Select user role(s) Select user role(s)
<br><br>
<div style="max-height: 200px; overflow: auto" id="rolesListing">
</div>
</h4> </h4>
<div class="wr-input-control" id="rolesListing">
</div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -402,3 +401,19 @@
{{js "js/listing.js"}} {{js "js/listing.js"}}
{{/if}} {{/if}}
{{/zone}} {{/zone}}
{{#zone "topCss"}}
<style>
.select2-dropdown {
z-index: 999999999;
}
.wr-input-control {
color: black;
}
.select2-selection__choice {
font-size: medium;
}
</style>
{{/zone}}

@ -391,14 +391,7 @@ function attachEvents() {
listAllRoles(groupId); listAllRoles(groupId);
var shareGroupNextLink = $("a#share-group-next-link"); var shareGroupNextLink = $("a#share-group-next-link");
shareGroupNextLink.click(function () { shareGroupNextLink.click(function () {
var roles = []; var roles = $("#roles").val();
$('.modal .roleCheckBoxes').each(
function () {
if ($(this).is(':checked')) {
roles.push($(this).data('role-name'));
}
}
);
updateGroupShare(groupId, roles); updateGroupShare(groupId, roles);
}); });
@ -505,15 +498,11 @@ function markAlreadySavedUsersRoles(groupId) {
data = JSON.parse(data); data = JSON.parse(data);
if (xhr.status == 200) { if (xhr.status == 200) {
if (data.roles.length > 0) { if (data.roles.length > 0) {
var selectedValues = [];
for (var i = 0; i < data.roles.length; i++) { for (var i = 0; i < data.roles.length; i++) {
$('.roleCheckBoxes').each( selectedValues.push(data.roles[i]);
function () {
if (data.roles[i] == $(this).data('role-name')) {
$(this).attr('checked', true);
}
}
);
} }
$("#roles").val(selectedValues).trigger("change");
} else { } else {
return; return;
} }
@ -533,22 +522,16 @@ function listAllRoles(groupId) {
data = JSON.parse(data); data = JSON.parse(data);
if (xhr.status == 200) { if (xhr.status == 200) {
if (data.roles.length > 0) { if (data.roles.length > 0) {
var html = "<br/>"; var html = '<select id="roles" class="form-control select2" multiple="multiple">';
for (var i = 0; i < data.roles.length; i++) { for (var i = 0; i < data.roles.length; i++) {
html += '<div class="wr-input-control"><label class="wr-input-control checkbox">' + html += '<option value="' + data.roles[i] + '">' + data.roles[i] + '</option>';
'<input class="roleCheckBoxes" type="checkbox" data-role-name="' + data.roles[i] + '" />' +
'<span class="helper" title="' + data.roles[i] + '">' + data.roles[i] +
'</span></label></div>';
$('.roleCheckBoxes').each(
function () {
if (data.roles[i] == $(this).data('role-name')) {
$(this).attr('checked', true);
}
}
);
} }
html += '</select>';
$("#rolesListing").html(html); $("#rolesListing").html(html);
markAlreadySavedUsersRoles(groupId); markAlreadySavedUsersRoles(groupId);
$("select.select2[multiple=multiple]").select2({
tags: false
});
} else { } else {
$("#rolesListing").html("No roles available"); $("#rolesListing").html("No roles available");
} }

@ -48,6 +48,10 @@
<groupId>org.wso2.orbit.org.scannotation</groupId> <groupId>org.wso2.orbit.org.scannotation</groupId>
<artifactId>scannotation</artifactId> <artifactId>scannotation</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -137,6 +141,9 @@
<bundleDef> <bundleDef>
org.wso2.orbit.org.scannotation:scannotation:${scannotation.version} org.wso2.orbit.org.scannotation:scannotation:${scannotation.version}
</bundleDef> </bundleDef>
<bundleDef>
io.swagger:swagger-annotations:${swagger.version}
</bundleDef>
</bundles> </bundles>
<importFeatures> <importFeatures>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef> <importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>

@ -48,6 +48,10 @@
<groupId>javax.servlet.jsp</groupId> <groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId> <artifactId>javax.servlet.jsp-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.wso2.carbon.store</groupId>
<artifactId>org.wso2.store.sso.common</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -76,6 +80,7 @@
</includedFeatures> </includedFeatures>
<bundles> <bundles>
<bundleDef>javax.servlet.jsp:javax.servlet.jsp-api</bundleDef> <bundleDef>javax.servlet.jsp:javax.servlet.jsp-api</bundleDef>
<bundleDef>org.wso2.carbon.store:org.wso2.store.sso.common:${carbon.store.sso.common.version}</bundleDef>
</bundles> </bundles>
</configuration> </configuration>
</execution> </execution>

@ -1664,6 +1664,11 @@
<artifactId>wss4j</artifactId> <artifactId>wss4j</artifactId>
<version>${org.apache.ws.security.wso2.version}</version> <version>${org.apache.ws.security.wso2.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.wso2.carbon.store</groupId>
<artifactId>org.wso2.store.sso.common</artifactId>
<version>${carbon.store.sso.common.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
@ -2059,6 +2064,9 @@
<!-- api-mgt handler version properties --> <!-- api-mgt handler version properties -->
<org.apache.synapse.version>2.1.7-wso2v7</org.apache.synapse.version> <org.apache.synapse.version>2.1.7-wso2v7</org.apache.synapse.version>
<org.apache.ws.security.wso2.version>1.5.11.wso2v15</org.apache.ws.security.wso2.version> <org.apache.ws.security.wso2.version>1.5.11.wso2v15</org.apache.ws.security.wso2.version>
<!--carbon store version-->
<carbon.store.sso.common.version>1.4.4</carbon.store.sso.common.version>
</properties> </properties>
</project> </project>

Loading…
Cancel
Save