diff --git a/scm-core/src/main/java/sonia/scm/Manager.java b/scm-core/src/main/java/sonia/scm/Manager.java index 4862236fa2..45673122eb 100644 --- a/scm-core/src/main/java/sonia/scm/Manager.java +++ b/scm-core/src/main/java/sonia/scm/Manager.java @@ -81,23 +81,4 @@ public interface Manager * @return */ public Collection getAll(); - - /** - * Method description - * - * - * @param type - * @param - * - * @return - */ - public > H getHandler(String type); - - /** - * Method description - * - * - * @return - */ - public Collection getTypes(); } diff --git a/scm-core/src/main/java/sonia/scm/user/UserHandlerNotFoundException.java b/scm-core/src/main/java/sonia/scm/TypeManager.java similarity index 77% rename from scm-core/src/main/java/sonia/scm/user/UserHandlerNotFoundException.java rename to scm-core/src/main/java/sonia/scm/TypeManager.java index f4348a9444..3763909c67 100644 --- a/scm-core/src/main/java/sonia/scm/user/UserHandlerNotFoundException.java +++ b/scm-core/src/main/java/sonia/scm/TypeManager.java @@ -31,28 +31,39 @@ -package sonia.scm.user; +package sonia.scm; + +//~--- JDK imports ------------------------------------------------------------ + +import java.util.Collection; /** * * @author Sebastian Sdorra + * + * @param + * @param */ -public class UserHandlerNotFoundException extends UserException +public interface TypeManager + extends Manager { - /** Field description */ - private static final long serialVersionUID = -4704703054646330523L; - - //~--- constructors --------------------------------------------------------- + /** + * Method description + * + * + * @param type + * @param + * + * @return + */ + public > H getHandler(String type); /** - * Constructs ... + * Method description * * - * @param message + * @return */ - public UserHandlerNotFoundException(String message) - { - super(message); - } + public Collection getTypes(); } diff --git a/scm-core/src/main/java/sonia/scm/repository/RepositoryManager.java b/scm-core/src/main/java/sonia/scm/repository/RepositoryManager.java index f0e0cf3808..bac36a824e 100644 --- a/scm-core/src/main/java/sonia/scm/repository/RepositoryManager.java +++ b/scm-core/src/main/java/sonia/scm/repository/RepositoryManager.java @@ -36,14 +36,14 @@ package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- import sonia.scm.ListenerSupport; -import sonia.scm.Manager; +import sonia.scm.TypeManager; /** * * @author Sebastian Sdorra */ public interface RepositoryManager - extends Manager, + extends TypeManager, ListenerSupport { diff --git a/scm-core/src/main/java/sonia/scm/user/UserHandler.java b/scm-core/src/main/java/sonia/scm/user/AbstractUserManager.java similarity index 60% rename from scm-core/src/main/java/sonia/scm/user/UserHandler.java rename to scm-core/src/main/java/sonia/scm/user/AbstractUserManager.java index 01f93f8446..d3ca9163fd 100644 --- a/scm-core/src/main/java/sonia/scm/user/UserHandler.java +++ b/scm-core/src/main/java/sonia/scm/user/AbstractUserManager.java @@ -1,10 +1,10 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, @@ -13,7 +13,7 @@ * 3. Neither the name of SCM-Manager; nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,22 +24,72 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * http://bitbucket.org/sdorra/scm-manager - * + * */ + + package sonia.scm.user; -import sonia.scm.Handler; +//~--- non-JDK imports -------------------------------------------------------- + +import sonia.scm.HandlerEvent; + +//~--- JDK imports ------------------------------------------------------------ + +import java.util.HashSet; +import java.util.Set; /** * * @author Sebastian Sdorra */ -public interface UserHandler extends Handler +public abstract class AbstractUserManager implements UserManager { - + /** + * Method description + * + * + * @param listener + */ + @Override + public void addListener(UserListener listener) + { + listenerSet.add(listener); + } + /** + * Method description + * + * + * @param listener + */ + @Override + public void removeListener(UserListener listener) + { + listenerSet.remove(listener); + } + + /** + * Method description + * + * + * @param user + * @param event + */ + protected void fireEvent(User user, HandlerEvent event) + { + for (UserListener listener : listenerSet) + { + listener.onEvent(user, event); + } + } + + //~--- fields --------------------------------------------------------------- + + /** Field description */ + private Set listenerSet = new HashSet(); } diff --git a/scm-core/src/main/java/sonia/scm/user/BasicUserManager.java b/scm-core/src/main/java/sonia/scm/user/BasicUserManager.java deleted file mode 100644 index d8f34ec36e..0000000000 --- a/scm-core/src/main/java/sonia/scm/user/BasicUserManager.java +++ /dev/null @@ -1,422 +0,0 @@ -/** - * Copyright (c) 2010, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * http://bitbucket.org/sdorra/scm-manager - * - */ - - - -package sonia.scm.user; - -//~--- non-JDK imports -------------------------------------------------------- - -import com.google.inject.Inject; -import com.google.inject.Singleton; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import sonia.scm.ConfigurationException; -import sonia.scm.HandlerEvent; -import sonia.scm.SCMContextProvider; -import sonia.scm.Type; -import sonia.scm.util.AssertUtil; -import sonia.scm.util.IOUtil; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Sebastian Sdorra - */ -@Singleton -public class BasicUserManager implements UserManager -{ - - /** the logger for BasicUserManager */ - private static final Logger logger = - LoggerFactory.getLogger(BasicUserManager.class); - - //~--- constructors --------------------------------------------------------- - - /** - * Constructs ... - * - * - * @param handlerSet - */ - @Inject - public BasicUserManager(Set handlerSet) - { - AssertUtil.assertIsNotEmpty(handlerSet); - - for (UserHandler handler : handlerSet) - { - addHandler(handler); - } - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param listener - */ - @Override - public void addListener(UserListener listener) - { - listenerSet.add(listener); - } - - /** - * Method description - * - * - * @throws IOException - */ - @Override - public void close() throws IOException - { - for (UserHandler handler : handlerMap.values()) - { - IOUtil.close(handler); - } - } - - /** - * Method description - * - * - * @param user - * - * @throws Exception - * @throws IOException - */ - @Override - public void create(User user) throws Exception, IOException - { - if (logger.isInfoEnabled()) - { - logger.info("create user {} of type {}", user.getName(), user.getType()); - } - - AssertUtil.assertIsValid(user); - getHandler(user).create(user); - fireEvent(user, HandlerEvent.CREATE); - } - - /** - * Method description - * - * - * @param user - * - * @throws Exception - * @throws IOException - */ - @Override - public void delete(User user) throws Exception, IOException - { - if (logger.isInfoEnabled()) - { - logger.info("delete user {} of type {}", user.getName(), user.getType()); - } - - getHandler(user).delete(user); - fireEvent(user, HandlerEvent.DELETE); - } - - /** - * Method description - * - * - * @param context - */ - @Override - public void init(SCMContextProvider context) - { - for (UserHandler handler : handlerMap.values()) - { - handler.init(context); - } - } - - /** - * Method description - * - * - * @param user - * - * @throws Exception - * @throws IOException - */ - @Override - public void modify(User user) throws Exception, IOException - { - if (logger.isInfoEnabled()) - { - logger.info("modify user {} of type {}", user.getName(), user.getType()); - } - - AssertUtil.assertIsValid(user); - getHandler(user).modify(user); - fireEvent(user, HandlerEvent.MODIFY); - } - - /** - * Method description - * - * - * @param user - * - * @throws Exception - * @throws IOException - */ - @Override - public void refresh(User user) throws Exception, IOException - { - if (logger.isInfoEnabled()) - { - logger.info("refresh user {} of type {}", user.getName(), user.getType()); - } - - // getHandler(user).refresh(user); - } - - /** - * Method description - * - * - * @param listener - */ - @Override - public void removeListener(UserListener listener) - { - listenerSet.remove(listener); - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param id - * - * @return - */ - @Override - public User get(String id) - { - User user = null; - - for (UserHandler handler : handlerMap.values()) - { - if (handler.isConfigured()) - { - - // user = handler.get(id); - if (user != null) - { - break; - } - } - } - - return user; - } - - /** - * Method description - * - * - * @return - */ - @Override - public Collection getAll() - { - if (logger.isDebugEnabled()) - { - logger.debug("fetch all users"); - } - - Set repositories = new HashSet(); - - /* - * for (UserHandler handler : handlerMap.values()) - * { - * if (handler.isConfigured()) - * { - * Collection handlerRepositories = handler.getAll(); - * - * if (handlerRepositories != null) - * { - * repositories.addAll(handlerRepositories); - * } - * } - * } - */ - if (logger.isDebugEnabled()) - { - logger.debug("fetched {} users", repositories.size()); - } - - return repositories; - } - - /** - * Method description - * - * - * @param type - * - * @return - */ - @Override - public UserHandler getHandler(String type) - { - return handlerMap.get(type); - } - - /** - * Method description - * - * - * @return - */ - @Override - public Collection getTypes() - { - return typeSet; - } - - //~--- methods -------------------------------------------------------------- - - /** - * Method description - * - * - * @param handler - */ - private void addHandler(UserHandler handler) - { - AssertUtil.assertIsNotNull(handler); - - Type type = handler.getType(); - - AssertUtil.assertIsNotNull(type); - - if (handlerMap.containsKey(type.getName())) - { - throw new ConfigurationException( - type.getName().concat("allready registered")); - } - - if (logger.isInfoEnabled()) - { - logger.info("added UserHandler {} for type {}", handler.getClass(), type); - } - - handlerMap.put(type.getName(), handler); - typeSet.add(type); - } - - /** - * Method description - * - * - * @param user - * @param event - */ - private void fireEvent(User user, HandlerEvent event) - { - for (UserListener listener : listenerSet) - { - listener.onEvent(user, event); - } - } - - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @param user - * - * @return - * - * @throws UserException - */ - private UserHandler getHandler(User user) throws UserException - { - AssertUtil.assertIsNotNull(user); - - String type = user.getType(); - - AssertUtil.assertIsNotEmpty(type); - - UserHandler handler = handlerMap.get(type); - - if (handler == null) - { - throw new UserHandlerNotFoundException( - "could not find UserHandler for ".concat(type)); - } - else if (!handler.isConfigured()) - { - throw new UserException( - "UserHandler for type ".concat(type).concat(" is not configured")); - } - - return handler; - } - - //~--- fields --------------------------------------------------------------- - - /** Field description */ - private Set listenerSet = new HashSet(); - - /** Field description */ - private Map handlerMap = new HashMap(); - - /** Field description */ - private Set typeSet = new LinkedHashSet(); -} diff --git a/scm-core/src/main/java/sonia/scm/user/UserManager.java b/scm-core/src/main/java/sonia/scm/user/UserManager.java index 959d2272f4..421e97a355 100644 --- a/scm-core/src/main/java/sonia/scm/user/UserManager.java +++ b/scm-core/src/main/java/sonia/scm/user/UserManager.java @@ -43,17 +43,4 @@ import sonia.scm.Manager; * @author Sebastian Sdorra */ public interface UserManager - extends Manager, ListenerSupport -{ - - /** - * Method description - * - * - * @param type - * - * @return - */ - @Override - public UserHandler getHandler(String type); -} + extends Manager, ListenerSupport {} diff --git a/scm-core/src/main/java/sonia/scm/user/xml/XmlUserHandler.java b/scm-core/src/main/java/sonia/scm/user/xml/XmlUserManager.java similarity index 86% rename from scm-core/src/main/java/sonia/scm/user/xml/XmlUserHandler.java rename to scm-core/src/main/java/sonia/scm/user/xml/XmlUserManager.java index 4891fd2bd5..0791d69f58 100644 --- a/scm-core/src/main/java/sonia/scm/user/xml/XmlUserHandler.java +++ b/scm-core/src/main/java/sonia/scm/user/xml/XmlUserManager.java @@ -41,12 +41,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sonia.scm.SCMContextProvider; -import sonia.scm.Type; +import sonia.scm.user.AbstractUserManager; import sonia.scm.user.User; import sonia.scm.user.UserAllreadyExistException; import sonia.scm.user.UserException; -import sonia.scm.user.UserHandler; import sonia.scm.util.IOUtil; +import sonia.scm.util.Util; //~--- JDK imports ------------------------------------------------------------ @@ -64,31 +64,22 @@ import javax.xml.bind.JAXB; * @author Sebastian Sdorra */ @Singleton -public class XmlUserHandler implements UserHandler +public class XmlUserManager extends AbstractUserManager { /** Field description */ public static final String ADMIN_PATH = "/sonia/scm/config/admin-account.xml"; - /** Field description */ - public static final String FILE_EXTENSION = ".xml"; - - /** Field description */ - public static final String TYPE_DISPLAYNAME = "XML"; - - /** Field description */ - public static final String TYPE_NAME = "xml"; - - /** Field description */ - public static final Type type = new Type(TYPE_NAME, TYPE_DISPLAYNAME); - /** Field description */ public static final String DATABASEFILE = "config".concat(File.separator).concat("users.xml"); - /** the logger for XmlUserHandler */ + /** Field description */ + public static final String TYPE = "xml"; + + /** the logger for XmlUserManager */ private static final Logger logger = - LoggerFactory.getLogger(XmlUserHandler.class); + LoggerFactory.getLogger(XmlUserManager.class); //~--- methods -------------------------------------------------------------- @@ -122,9 +113,14 @@ public class XmlUserHandler implements UserHandler throw new UserAllreadyExistException(); } - user.setType(TYPE_NAME); + String type = user.getType(); - synchronized (XmlUserHandler.class) + if (Util.isEmpty(type)) + { + user.setType(TYPE); + } + + synchronized (XmlUserManager.class) { userDB.add(user.clone()); storeDB(); @@ -147,7 +143,7 @@ public class XmlUserHandler implements UserHandler if (userDB.contains(name)) { - synchronized (XmlUserHandler.class) + synchronized (XmlUserManager.class) { userDB.remove(name); storeDB(); @@ -201,9 +197,7 @@ public class XmlUserHandler implements UserHandler if (userDB.contains(name)) { - user.setType(TYPE_NAME); - - synchronized (XmlUserHandler.class) + synchronized (XmlUserManager.class) { userDB.remove(name); userDB.add(user.clone()); @@ -225,6 +219,7 @@ public class XmlUserHandler implements UserHandler * @throws IOException * @throws UserException */ + @Override public void refresh(User user) throws UserException, IOException { User fresh = userDB.get(user.getName()); @@ -247,6 +242,7 @@ public class XmlUserHandler implements UserHandler * * @return */ + @Override public User get(String id) { User user = userDB.get(id); @@ -265,6 +261,7 @@ public class XmlUserHandler implements UserHandler * * @return */ + @Override public Collection getAll() { LinkedList users = new LinkedList(); @@ -277,30 +274,6 @@ public class XmlUserHandler implements UserHandler return users; } - /** - * Method description - * - * - * @return - */ - @Override - public Type getType() - { - return type; - } - - /** - * Method description - * - * - * @return - */ - @Override - public boolean isConfigured() - { - return (userDBFile != null) && userDBFile.exists(); - } - //~--- methods -------------------------------------------------------------- /** @@ -309,7 +282,7 @@ public class XmlUserHandler implements UserHandler */ private void createAdminAccount() { - InputStream input = XmlUserHandler.class.getResourceAsStream(ADMIN_PATH); + InputStream input = XmlUserManager.class.getResourceAsStream(ADMIN_PATH); try { diff --git a/scm-web-api/src/main/java/sonia/scm/web/plugin/SCMPlugin.java b/scm-web-api/src/main/java/sonia/scm/web/plugin/SCMPlugin.java index 485c80d78f..44a27f8b04 100644 --- a/scm-web-api/src/main/java/sonia/scm/web/plugin/SCMPlugin.java +++ b/scm-web-api/src/main/java/sonia/scm/web/plugin/SCMPlugin.java @@ -36,7 +36,6 @@ package sonia.scm.web.plugin; //~--- non-JDK imports -------------------------------------------------------- import sonia.scm.repository.RepositoryHandler; -import sonia.scm.user.UserHandler; //~--- JDK imports ------------------------------------------------------------ @@ -65,7 +64,6 @@ public class SCMPlugin public SCMPlugin() { repositoryHandlers = new HashSet>(); - userHandlers = new HashSet>(); } //~--- get methods ---------------------------------------------------------- @@ -92,17 +90,6 @@ public class SCMPlugin return securityConfig; } - /** - * Method description - * - * - * @return - */ - public Set> getUserHandlers() - { - return userHandlers; - } - /** * Method description * @@ -139,17 +126,6 @@ public class SCMPlugin this.securityConfig = securityConfig; } - /** - * Method description - * - * - * @param userHandlers - */ - public void setUserHandlers(Set> userHandlers) - { - this.userHandlers = userHandlers; - } - /** * Method description * @@ -172,11 +148,6 @@ public class SCMPlugin @XmlElement(name = "security") private SecurityConfig securityConfig; - /** Field description */ - @XmlElementWrapper(name = "user-handlers") - @XmlElement(name = "user-handler") - private Set> userHandlers; - /** Field description */ @XmlElement(name = "web-plugin") private Class webPlugin; diff --git a/scm-webapp/src/main/java/sonia/scm/ScmServletModule.java b/scm-webapp/src/main/java/sonia/scm/ScmServletModule.java index dff09f8caf..141d69426d 100644 --- a/scm-webapp/src/main/java/sonia/scm/ScmServletModule.java +++ b/scm-webapp/src/main/java/sonia/scm/ScmServletModule.java @@ -51,10 +51,10 @@ import sonia.scm.repository.RepositoryHandler; import sonia.scm.repository.RepositoryManager; import sonia.scm.security.EncryptionHandler; import sonia.scm.security.MessageDigestEncryptionHandler; -import sonia.scm.user.BasicUserManager; + import sonia.scm.user.UserHandler; import sonia.scm.user.UserManager; -import sonia.scm.user.xml.XmlUserHandler; + import sonia.scm.util.DebugServlet; import sonia.scm.util.Util; import sonia.scm.web.plugin.SCMPlugin; @@ -83,6 +83,7 @@ import java.util.Set; import javax.xml.bind.JAXB; import sonia.scm.repository.xml.XmlRepositoryManager; +import sonia.scm.user.xml.XmlUserManager; /** * @@ -168,7 +169,7 @@ public class ScmServletModule extends ServletModule //bind(RepositoryManager.class).annotatedWith(Undecorated.class).to( // BasicRepositoryManager.class); bind(RepositoryManager.class).to(XmlRepositoryManager.class); - bind(UserManager.class).to(BasicUserManager.class); + bind(UserManager.class).to(XmlUserManager.class); bind(ScmWebPluginContext.class).toInstance(webPluginContext); // filter(PATTERN_RESTAPI).through(LoggingFilter.class); @@ -269,13 +270,6 @@ public class ScmServletModule extends ServletModule Set> repositoryHandlerSet = new LinkedHashSet>(); - // user handlers - Multibinder userHandlerBinder = - Multibinder.newSetBinder(binder(), UserHandler.class); - Set> userHandlerSet = - new LinkedHashSet>(); - - userHandlerSet.add(XmlUserHandler.class); // security stuff Class encryptionHandler = @@ -292,13 +286,6 @@ public class ScmServletModule extends ServletModule repositoryHandlerSet.addAll(pluginRepositoryHandlers); } - Collection> pluginUserHandlers = - plugin.getUserHandlers(); - - if (Util.isNotEmpty(pluginUserHandlers)) - { - userHandlerSet.addAll(pluginUserHandlers); - } SecurityConfig securityConfig = plugin.getSecurityConfig(); @@ -325,7 +312,6 @@ public class ScmServletModule extends ServletModule bind(EncryptionHandler.class).to(encryptionHandler); bind(Authenticator.class).to(authenticator); bindRepositoryHandlers(repositoryHandlerBinder, repositoryHandlerSet); - bindUserHandlers(userHandlerBinder, userHandlerSet); } } diff --git a/scm-webapp/src/main/java/sonia/scm/api/rest/JsonJaxbContextResolver.java b/scm-webapp/src/main/java/sonia/scm/api/rest/JsonJaxbContextResolver.java index 1c79ab4c2f..bf37e1c2f4 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/rest/JsonJaxbContextResolver.java +++ b/scm-webapp/src/main/java/sonia/scm/api/rest/JsonJaxbContextResolver.java @@ -72,7 +72,7 @@ public class JsonJaxbContextResolver implements ContextResolver this.context = new JSONJAXBContext( JSONConfiguration.mapped().rootUnwrapping(true).arrays( "member", "groups", "permissions", "repositories", - "repositoryTypes").nonStrings( + "repositoryTypes", "users").nonStrings( "readable", "writeable", "groupPermission", "admin").build(), types.toArray(new Class[0])); } diff --git a/scm-webapp/src/main/java/sonia/scm/web/security/XmlAuthenticator.java b/scm-webapp/src/main/java/sonia/scm/web/security/XmlAuthenticator.java index 5e3ad278d6..2b3b785fbc 100644 --- a/scm-webapp/src/main/java/sonia/scm/web/security/XmlAuthenticator.java +++ b/scm-webapp/src/main/java/sonia/scm/web/security/XmlAuthenticator.java @@ -44,7 +44,6 @@ import org.slf4j.LoggerFactory; import sonia.scm.SCMContextProvider; import sonia.scm.security.EncryptionHandler; import sonia.scm.user.User; -import sonia.scm.user.xml.XmlUserHandler; //~--- JDK imports ------------------------------------------------------------ @@ -52,6 +51,7 @@ import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import sonia.scm.user.UserManager; /** * @@ -86,7 +86,7 @@ public class XmlAuthenticator implements Authenticator HttpServletResponse response, String username, String password) { - User user = userHandler.get(username); + User user = userManager.get(username); if (user != null) { @@ -153,5 +153,5 @@ public class XmlAuthenticator implements Authenticator /** Field description */ @Inject - private XmlUserHandler userHandler; + private UserManager userManager; }