summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2013-02-12 17:11:15 +0000
committerOlivier Lamy <olamy@apache.org>2013-02-12 17:11:15 +0000
commit46900eea43b08e488f71acc1bfbd9451cdda8d79 (patch)
tree232ad11ab834ca12a9f179aac4e70a77462dfb77
parent317934b70945bf77e8bc50deb93dbdda6e554be8 (diff)
downloadarchiva-46900eea43b08e488f71acc1bfbd9451cdda8d79.tar.gz
archiva-46900eea43b08e488f71acc1bfbd9451cdda8d79.zip
ldap writable save in archiva configuration
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1445271 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo6
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java15
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java13
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js9
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html9
5 files changed, 50 insertions, 2 deletions
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
index 49a858bc2..b1257abb1 100644
--- a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
+++ b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
@@ -1608,6 +1608,12 @@
<type>boolean</type>
</field>
<field>
+ <name>writable</name>
+ <description>LDAP writable.</description>
+ <version>1.4.0+</version>
+ <type>boolean</type>
+ </field>
+ <field>
<name>extraProperties</name>
<version>1.4.0+</version>
<type>Map</type>
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java
index eba93395d..25d391554 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java
@@ -95,6 +95,11 @@ public class LdapConfiguration
*/
private List<PropertyEntry> extraPropertiesEntries;
+ /**
+ * LDAP writable.
+ */
+ private boolean writable = false;
+
public LdapConfiguration()
{
// no op
@@ -231,4 +236,14 @@ public class LdapConfiguration
{
this.baseGroupsDn = baseGroupsDn;
}
+
+ public boolean isWritable()
+ {
+ return writable;
+ }
+
+ public void setWritable( boolean writable )
+ {
+ this.writable = writable;
+ }
}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
index ebb117e06..1ffc45ee7 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
@@ -132,6 +132,9 @@ public class DefaultRedbackRuntimeConfigurationAdmin
ldapConfiguration.setAuthenticationMethod(
userConfiguration.getString( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD, null ) );
+ ldapConfiguration.setWritable(
+ userConfiguration.getBoolean( UserConfigurationKeys.LDAP_WRITABLE, false ) );
+
redbackRuntimeConfiguration.setMigratedFromRedbackConfiguration( true );
updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
@@ -444,6 +447,11 @@ public class DefaultRedbackRuntimeConfigurationAdmin
{
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
+ if ( UserConfigurationKeys.LDAP_WRITABLE.equals( key ) )
+ {
+ return conf.getLdapConfiguration().isWritable();
+ }
+
if ( conf.getConfigurationProperties().containsKey( key ) )
{
return Boolean.valueOf( conf.getConfigurationProperties().get( key ) );
@@ -472,6 +480,11 @@ public class DefaultRedbackRuntimeConfigurationAdmin
return getRedbackRuntimeConfiguration().getLdapConfiguration().isSsl();
}
+ if ( UserConfigurationKeys.LDAP_WRITABLE.equals( key ) )
+ {
+ return getRedbackRuntimeConfiguration().getLdapConfiguration().isWritable();
+ }
+
RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
if ( conf.getConfigurationProperties().containsKey( key ) )
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js
index b327ce22d..b2e59166e 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js
@@ -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){
+ extraPropertiesEntries,writable){
var self=this;
this.modified=ko.observable(false);
@@ -1333,6 +1333,11 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
this.extraPropertiesEntries=ko.observableArray(extraPropertiesEntries);
this.extraPropertiesEntries.subscribe(function(newValue){self.modified(true)});
+
+ //private boolean writable = false;
+ this.writable=ko.observable(writable);
+ this.writable.subscribe(function(newValue){self.modified(true)});
+
}
mapLdapConfiguration=function(data){
@@ -1346,7 +1351,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.authenticationMethod,extraPropertiesEntries,data.writable);
}
return null;
}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html
index ade1b20d9..af6d25d88 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html
@@ -1025,6 +1025,15 @@
</div>
</div>
<div class="control-group">
+ <label for="ldap-writable" class="control-label">
+ ${$.i18n.prop('redback.runtime.ldap.writable.label')}
+ </label>
+ <div class="controls">
+ <input type="checkbox" id="ldap-writable" name="ldap-ssl"
+ data-bind="checked: redbackRuntimeConfiguration().ldapConfiguration().writable"/>
+ </div>
+ </div>
+ <div class="control-group">
<label for="ldapBaseDn" class="control-label">
${$.i18n.prop('redback.runtime.ldap.baseDn.label')}
</label>