From 67171f7b4407239d5a22f8a1b4697cce0123a57e Mon Sep 17 00:00:00 2001 From: David Caruana Date: Tue, 21 Feb 2006 19:42:39 +0000 Subject: [PATCH] Remove creation of admin person / user from Web Client context initialiser. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2461 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/web/app/ContextListener.java | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/source/java/org/alfresco/web/app/ContextListener.java b/source/java/org/alfresco/web/app/ContextListener.java index c3ca7b6ac..68d58f4f3 100644 --- a/source/java/org/alfresco/web/app/ContextListener.java +++ b/source/java/org/alfresco/web/app/ContextListener.java @@ -125,53 +125,6 @@ public class ContextListener implements ServletContextListener, HttpSessionListe // Extract company space id and store it in the Application object companySpaceNodeRef = nodes.get(0); Application.setCompanyRootId(companySpaceNodeRef.getId()); - - // check the admin user exists, create if it doesn't - MutableAuthenticationDao dao = (MutableAuthenticationDao) ctx.getBean("alfDaoImpl"); - - // this is required to setup the ACEGI context before we can check - // for the user - if (!dao.userExists(ADMIN)) - { - ConfigService configService = (ConfigService) ctx.getBean(Application.BEAN_CONFIG_SERVICE); - // default to password of "admin" if we don't find config for it - String password = ADMIN; - ConfigElement adminConfig = configService.getGlobalConfig().getConfigElement("admin"); - if (adminConfig != null) - { - List children = adminConfig.getChildren(); - if (children.size() != 0) - { - // try to find the config element for the initial - // password - ConfigElement passElement = children.get(0); - if (passElement.getName().equals("initial-password")) - { - password = passElement.getValue(); - } - } - } - - // create the Authentication instance for the "admin" user - AuthenticationService authService = (AuthenticationService) ctx.getBean("authenticationService"); - authService.createAuthentication(ADMIN, password.toCharArray()); - } - - PersonService personService = (PersonService) ctx.getBean("personService"); - if (!personService.personExists(ADMIN)) - { - // create the node to represent the Person instance for the - // admin user - Map props = new HashMap(7, 1.0f); - props.put(ContentModel.PROP_USERNAME, ADMIN); - props.put(ContentModel.PROP_FIRSTNAME, ADMIN_FIRSTNAME); - props.put(ContentModel.PROP_LASTNAME, ADMIN_LASTNAME); - props.put(ContentModel.PROP_HOMEFOLDER, companySpaceNodeRef); - props.put(ContentModel.PROP_EMAIL, ""); - props.put(ContentModel.PROP_ORGID, ""); - - personService.createPerson(props); - } // commit the transaction tx.commit();