git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1445346 13f79535-47bb-0310-9956-ffa450edef68tags/archiva-1.4-M4
@@ -1616,6 +1616,13 @@ | |||
<type>boolean</type> | |||
<defaultValue>false</defaultValue> | |||
</field> | |||
<field> | |||
<name>useRoleNameAsGroup</name> | |||
<description>Will use role name as LDAP group.</description> | |||
<version>1.4.0+</version> | |||
<type>boolean</type> | |||
<defaultValue>false</defaultValue> | |||
</field> | |||
<field> | |||
<name>extraProperties</name> | |||
<version>1.4.0+</version> |
@@ -85,6 +85,11 @@ public class LdapConfiguration | |||
*/ | |||
private boolean bindAuthenticatorEnabled; | |||
/** | |||
* Will use role name as LDAP group. | |||
*/ | |||
private boolean useRoleNameAsGroup = false; | |||
/** | |||
* Field extraProperties. | |||
*/ | |||
@@ -246,4 +251,14 @@ public class LdapConfiguration | |||
{ | |||
this.writable = writable; | |||
} | |||
public boolean isUseRoleNameAsGroup() | |||
{ | |||
return useRoleNameAsGroup; | |||
} | |||
public void setUseRoleNameAsGroup( boolean useRoleNameAsGroup ) | |||
{ | |||
this.useRoleNameAsGroup = useRoleNameAsGroup; | |||
} | |||
} |
@@ -135,6 +135,9 @@ public class DefaultRedbackRuntimeConfigurationAdmin | |||
ldapConfiguration.setWritable( | |||
userConfiguration.getBoolean( UserConfigurationKeys.LDAP_WRITABLE, false ) ); | |||
ldapConfiguration.setUseRoleNameAsGroup( | |||
userConfiguration.getBoolean( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME, false ) ); | |||
redbackRuntimeConfiguration.setMigratedFromRedbackConfiguration( true ); | |||
updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration ); | |||
@@ -452,6 +455,11 @@ public class DefaultRedbackRuntimeConfigurationAdmin | |||
return conf.getLdapConfiguration().isWritable(); | |||
} | |||
if ( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME.equals( key ) ) | |||
{ | |||
return conf.getLdapConfiguration().isUseRoleNameAsGroup(); | |||
} | |||
if ( conf.getConfigurationProperties().containsKey( key ) ) | |||
{ | |||
return Boolean.valueOf( conf.getConfigurationProperties().get( key ) ); | |||
@@ -485,6 +493,11 @@ public class DefaultRedbackRuntimeConfigurationAdmin | |||
return getRedbackRuntimeConfiguration().getLdapConfiguration().isWritable(); | |||
} | |||
if ( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME.equals( key ) ) | |||
{ | |||
return getRedbackRuntimeConfiguration().getLdapConfiguration().isUseRoleNameAsGroup(); | |||
} | |||
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration(); | |||
if ( conf.getConfigurationProperties().containsKey( key ) ) |
@@ -1290,7 +1290,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" | |||
} | |||
LdapConfiguration=function(hostName,port,ssl,baseDn,baseGroupsDn,contextFactory,bindDn,password,authenticationMethod, | |||
extraPropertiesEntries,writable){ | |||
extraPropertiesEntries,writable,useRoleNameAsGroup){ | |||
var self=this; | |||
this.modified=ko.observable(false); | |||
@@ -1338,6 +1338,10 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" | |||
this.writable=ko.observable(writable); | |||
this.writable.subscribe(function(newValue){self.modified(true)}); | |||
// useRoleNameAsGroup | |||
this.useRoleNameAsGroup=ko.observable(useRoleNameAsGroup); | |||
this.useRoleNameAsGroup.subscribe(function(newValue){self.modified(true)}); | |||
} | |||
mapLdapConfiguration=function(data){ | |||
@@ -1351,7 +1355,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" | |||
} | |||
$.log("mapLdapConfiguration done"); | |||
return new LdapConfiguration(data.hostName,data.port,data.ssl,data.baseDn,data.baseGroupsDn,data.contextFactory,data.bindDn,data.password, | |||
data.authenticationMethod,extraPropertiesEntries,data.writable); | |||
data.authenticationMethod,extraPropertiesEntries,data.writable,data.useRoleNameAsGroup); | |||
} | |||
return null; | |||
} |
@@ -1070,6 +1070,16 @@ | |||
data-bind="checked: redbackRuntimeConfiguration().ldapConfiguration().ssl"/> | |||
</div> | |||
</div> | |||
<div class="control-group"> | |||
<label for="ldap-useRoleNameAsGroup" class="control-label"> | |||
${$.i18n.prop('redback.runtime.ldap.useRoleNameAsGroup.label')} | |||
</label> | |||
<div class="controls"> | |||
<input type="checkbox" id="ldap-useRoleNameAsGroup" name="ldap-useRoleNameAsGroup" | |||
data-bind="checked: redbackRuntimeConfiguration().ldapConfiguration().useRoleNameAsGroup"/> | |||
</div> | |||
</div> | |||
<div class="control-group"> | |||
<label for="ldapPassword" class="control-label"> | |||
${$.i18n.prop('redback.runtime.ldap.password.label')} |