diff --git a/config/alfresco/script-services-context.xml b/config/alfresco/script-services-context.xml
index 876a767b68..ae30e953ee 100644
--- a/config/alfresco/script-services-context.xml
+++ b/config/alfresco/script-services-context.xml
@@ -132,8 +132,8 @@
-
-
+
+
@@ -144,9 +144,6 @@
-
-
-
diff --git a/config/alfresco/template-services-context.xml b/config/alfresco/template-services-context.xml
index 78262dae8a..f4f55df14a 100644
--- a/config/alfresco/template-services-context.xml
+++ b/config/alfresco/template-services-context.xml
@@ -97,8 +97,8 @@
-
-
+
+
diff --git a/source/java/org/alfresco/repo/jscript/People.java b/source/java/org/alfresco/repo/jscript/People.java
index 8f2efac685..0d2b37a138 100644
--- a/source/java/org/alfresco/repo/jscript/People.java
+++ b/source/java/org/alfresco/repo/jscript/People.java
@@ -31,8 +31,6 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
-import org.alfresco.repo.security.authentication.PasswordGenerator;
import org.alfresco.repo.security.authentication.UserNameGenerator;
import org.alfresco.repo.security.authority.AuthorityDAO;
import org.alfresco.repo.tenant.TenantService;
@@ -71,11 +69,10 @@ public final class People extends BaseScopableProcessorExtension
private AuthorityDAO authorityDAO;
private AuthorityService authorityService;
private PersonService personService;
- private MutableAuthenticationDao mutableAuthenticationDao;
+ private AuthenticationService authenticationService;
private ContentUsageService contentUsageService;
private TenantService tenantService;
private UserNameGenerator usernameGenerator;
- private PasswordGenerator passwordGenerator;
private StoreRef storeRef;
private int numRetries = 10;
@@ -93,16 +90,17 @@ public final class People extends BaseScopableProcessorExtension
throw new IllegalStateException("Default store URL can only be set once.");
}
this.storeRef = new StoreRef(storeRef);
- }
-
+ }
+
/**
- * Set the mutable authentication dao
+ * Sets the authentication service.
*
- * @param mutableAuthenticationDao Mutable Authentication DAO
+ * @param authenticationService
+ * the authentication service
*/
- public void setMutableAuthenticationDao(MutableAuthenticationDao mutableAuthenticationDao)
+ public void setAuthenticationService(AuthenticationService authenticationService)
{
- this.mutableAuthenticationDao = mutableAuthenticationDao;
+ this.authenticationService = authenticationService;
}
/**
@@ -170,17 +168,7 @@ public final class People extends BaseScopableProcessorExtension
{
this.usernameGenerator = userNameGenerator;
}
-
- /**
- * Set the password generator service
- *
- * @param passwordGenerator the password generator
- */
- public void setPasswordGenerator(PasswordGenerator passwordGenerator)
- {
- this.passwordGenerator = passwordGenerator;
- }
-
+
/**
* Delete a Person with the given username
*
@@ -189,14 +177,6 @@ public final class People extends BaseScopableProcessorExtension
public void deletePerson(String username)
{
personService.deletePerson(username);
- try
- {
- mutableAuthenticationDao.deleteUser(username);
- }
- catch (AuthenticationException e)
- {
- // Let's not worry if authentication details don't exist
- }
}
/**
@@ -268,8 +248,8 @@ public final class People extends BaseScopableProcessorExtension
if (person != null && password != null)
{
// create account for person with the userName and password
- mutableAuthenticationDao.createUser(userName, password.toCharArray());
- mutableAuthenticationDao.setEnabled(userName, setAccountEnabled);
+ authenticationService.createAuthentication(userName, password.toCharArray());
+ authenticationService.setAuthenticationEnabled(userName, setAccountEnabled);
person.save();
}
@@ -287,7 +267,7 @@ public final class People extends BaseScopableProcessorExtension
{
if (this.authorityService.isAdminAuthority(AuthenticationUtil.getFullyAuthenticatedUser()))
{
- this.mutableAuthenticationDao.setEnabled(userName, true);
+ this.authenticationService.setAuthenticationEnabled(userName, true);
}
}
@@ -300,7 +280,7 @@ public final class People extends BaseScopableProcessorExtension
{
if (this.authorityService.isAdminAuthority(AuthenticationUtil.getFullyAuthenticatedUser()))
{
- this.mutableAuthenticationDao.setEnabled(userName, false);
+ this.authenticationService.setAuthenticationEnabled(userName, false);
}
}
@@ -313,7 +293,7 @@ public final class People extends BaseScopableProcessorExtension
*/
public boolean isAccountEnabled(String userName)
{
- return this.mutableAuthenticationDao.getEnabled(userName);
+ return this.authenticationService.getAuthenticationEnabled(userName);
}
/**
diff --git a/source/java/org/alfresco/repo/template/People.java b/source/java/org/alfresco/repo/template/People.java
index fce635a494..1f1870dcdb 100644
--- a/source/java/org/alfresco/repo/template/People.java
+++ b/source/java/org/alfresco/repo/template/People.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
+ * Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -30,11 +30,11 @@ import java.util.List;
import java.util.Set;
import org.alfresco.model.ContentModel;
-import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
import org.alfresco.repo.security.authority.AuthorityDAO;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
+import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.AuthorityService;
import org.alfresco.service.cmr.security.AuthorityType;
import org.alfresco.service.cmr.security.PersonService;
@@ -51,7 +51,7 @@ public class People extends BaseTemplateProcessorExtension
private ServiceRegistry services;
private AuthorityDAO authorityDAO;
private AuthorityService authorityService;
- private MutableAuthenticationDao mutableAuthenticationDao;
+ private AuthenticationService authenticationService;
private PersonService personService;
private StoreRef storeRef;
@@ -112,15 +112,16 @@ public class People extends BaseTemplateProcessorExtension
}
/**
- * Set the mutable authentication dao
+ * Sets the authentication service.
*
- * @param mutableAuthenticationDao Mutable Authentication DAO
+ * @param authenticationService
+ * the new authentication service
*/
- public void setMutableAuthenticationDao(MutableAuthenticationDao mutableAuthenticationDao)
+ public void setAuthenticationService(AuthenticationService authenticationService)
{
- this.mutableAuthenticationDao = mutableAuthenticationDao;
+ this.authenticationService = authenticationService;
}
-
+
/**
* Gets the Person given the username
*
@@ -234,7 +235,7 @@ public class People extends BaseTemplateProcessorExtension
*/
public boolean isAccountEnabled(TemplateNode person)
{
- return this.mutableAuthenticationDao.getEnabled((String)person.getProperties().get(ContentModel.PROP_USERNAME));
+ return this.authenticationService.getAuthenticationEnabled((String)person.getProperties().get(ContentModel.PROP_USERNAME));
}
/**
@@ -255,7 +256,6 @@ public class People extends BaseTemplateProcessorExtension
String groupName = (String)container.getProperties().get(ContentModel.PROP_AUTHORITY_NAME);
Set authorities = authorityService.getContainedAuthorities(type, groupName, !recurse);
members = new ArrayList(authorities.size());
- int i = 0;
for (String authority : authorities)
{
AuthorityType authorityType = AuthorityType.getAuthorityType(authority);
@@ -278,6 +278,6 @@ public class People extends BaseTemplateProcessorExtension
}
}
- return members != null ? members : (List)Collections.emptyList();
+ return members != null ? members : Collections.emptyList();
}
}