mirror of https://github.com/apache/archiva.git
do not ask ldap informations if ldap is not activated
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1447203 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f127c7f705
commit
fc19422920
|
@ -1714,6 +1714,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
var useLdap = $.inArray("ldap",redbackRuntimeConfiguration.usedUserManagerImpls)>0
|
var useLdap = $.inArray("ldap",redbackRuntimeConfiguration.usedUserManagerImpls)>0
|
||||||
||$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls)>0;
|
||$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls)>0;
|
||||||
$.log("useLdap:"+useLdap);
|
$.log("useLdap:"+useLdap);
|
||||||
|
if(useLdap){
|
||||||
// load ldap roles
|
// load ldap roles
|
||||||
$.ajax("restServices/redbackServices/ldapGroupMappingService/ldapGroups", {
|
$.ajax("restServices/redbackServices/ldapGroupMappingService/ldapGroups", {
|
||||||
type: "GET",
|
type: "GET",
|
||||||
|
@ -1739,13 +1740,31 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
type: "GET",
|
type: "GET",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
displayRuntimeConfigurationScreen(redbackRuntimeConfigurationViewModel,data,groupMappings,groups);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
displayRuntimeConfigurationScreen(redbackRuntimeConfigurationViewModel,null,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var allRoleNames = $.map(data, function(item) {
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
displayRuntimeConfigurationScreen=function(redbackRuntimeConfigurationViewModel,allRoles,groupMappings,groups){
|
||||||
|
var allRoleNames = $.map(allRoles?allRoles:[], function(item) {
|
||||||
return item.name;
|
return item.name;
|
||||||
});
|
});
|
||||||
|
|
||||||
redbackRuntimeConfigurationViewModel.allRoleNames=allRoleNames;
|
redbackRuntimeConfigurationViewModel.allRoleNames=allRoleNames;
|
||||||
if (redbackRuntimeConfiguration.ldapConfiguration().useRoleNameAsGroup()) {
|
if (redbackRuntimeConfigurationViewModel.redbackRuntimeConfiguration().ldapConfiguration().useRoleNameAsGroup()) {
|
||||||
// if using groups == roles add all as mapping except already mapped
|
// if using groups == roles add all as mapping except already mapped
|
||||||
$.each(groups,function(idx,item){
|
$.each(groups,function(idx,item){
|
||||||
var exists=false;
|
var exists=false;
|
||||||
|
@ -1761,28 +1780,14 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
redbackRuntimeConfiguration.ldapGroupMappings=ko.observableArray(groupMappings);
|
redbackRuntimeConfigurationViewModel.redbackRuntimeConfiguration().ldapGroupMappings=ko.observableArray(groupMappings?groupMappings:[]);
|
||||||
redbackRuntimeConfiguration.modified(false);
|
redbackRuntimeConfigurationViewModel.redbackRuntimeConfiguration().modified(false);
|
||||||
|
|
||||||
mainContent.html( $("#redback-runtime-configuration-main" ).tmpl() );
|
$("#main-content").html( $("#redback-runtime-configuration-main" ).tmpl() );
|
||||||
ko.applyBindings(redbackRuntimeConfigurationViewModel,$("#redback-runtime-configuration-content" ).get(0));
|
ko.applyBindings(redbackRuntimeConfigurationViewModel,$("#redback-runtime-configuration-content" ).get(0));
|
||||||
activateRedbackRuntimeGeneralFormValidation();
|
activateRedbackRuntimeGeneralFormValidation();
|
||||||
activateLdapConfigurationFormValidation();
|
activateLdapConfigurationFormValidation();
|
||||||
$("#ldap-group-mappings-div select" ).select2({width: "element"});
|
$("#ldap-group-mappings-div select" ).select2({width: "element"});
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LdapGroupMapping=function(group,roleNames,automatic,subscribeFn){
|
LdapGroupMapping=function(group,roleNames,automatic,subscribeFn){
|
||||||
|
|
Loading…
Reference in New Issue