From 12fe30b517025c1f88de53137fd09d10a8cbecbe Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 6 Dec 2007 06:39:29 +0000 Subject: [PATCH] bug fix in the UI&code coordination. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6229 71c3de6d-444a-0410-be80-ed276b4c234a Originally-Committed-As: e1f0531714cc8ff58f108895e2509e3a1f15504b --- .../hudson/security/LDAPSecurityRealm.java | 18 +++++++++++++++++- .../security/LDAPSecurityRealm/config.jelly | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/security/LDAPSecurityRealm.java b/core/src/main/java/hudson/security/LDAPSecurityRealm.java index 1d154fc..ebb6448 100644 --- a/core/src/main/java/hudson/security/LDAPSecurityRealm.java +++ b/core/src/main/java/hudson/security/LDAPSecurityRealm.java @@ -1,7 +1,11 @@ package hudson.security; import org.acegisecurity.AuthenticationManager; +import org.acegisecurity.MockAuthenticationManager; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.DataBoundConstructor; import hudson.model.Descriptor; +import net.sf.json.JSONObject; /** * {@link SecurityRealm} implementation that uses LDAP for authentication. @@ -9,8 +13,16 @@ import hudson.model.Descriptor; * @author Kohsuke Kawaguchi */ public class LDAPSecurityRealm extends SecurityRealm { + public final String providerUrl; + + @DataBoundConstructor + public LDAPSecurityRealm(String providerUrl) { + this.providerUrl = providerUrl; + } + public AuthenticationManager createAuthenticationManager() { - throw new UnsupportedOperationException(); + // TODO + return new MockAuthenticationManager(true); } public DescriptorImpl getDescriptor() { @@ -24,6 +36,10 @@ public class LDAPSecurityRealm extends SecurityRealm { super(LDAPSecurityRealm.class); } + public LDAPSecurityRealm newInstance(StaplerRequest req, JSONObject formData) throws FormException { + return req.bindJSON(LDAPSecurityRealm.class,formData); + } + public String getDisplayName() { return "LDAP"; } diff --git a/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly b/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly index 2255b50..0741e26 100644 --- a/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly +++ b/core/src/main/resources/hudson/security/LDAPSecurityRealm/config.jelly @@ -1,5 +1,5 @@ - - + + \ No newline at end of file