Merged V2.0 to HEAD

5910: Web Services getUsers
   5913: Web Services admin user password change
   5956: LDAP anon simple bind test
   6133: WCM-486
   6158: Merged V1.4 to V2.0
      5600: Split person bootstrap
      5642: AR-439 NetBIOS adaptor status request
   6160: VersionHistoryPerformance patch with no versionedNodeId


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6166 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-07-04 16:03:31 +00:00
parent ca4a711c69
commit 2c4637723f
4 changed files with 83 additions and 25 deletions

View File

@@ -481,7 +481,14 @@ public class AdministrationWebService extends AbstractWebService implements
private void changePasswordImpl(String userName, String oldPassword, String newPassword)
{
// Update the authentication details
this.authenticationService.updateAuthentication(userName, oldPassword.toCharArray(), newPassword.toCharArray());
if (this.authenticationService.getCurrentUserName().equals("admin") == true)
{
this.authenticationService.setAuthentication(userName, newPassword.toCharArray());
}
else
{
this.authenticationService.updateAuthentication(userName, oldPassword.toCharArray(), newPassword.toCharArray());
}
}
/**
@@ -624,8 +631,36 @@ public class AdministrationWebService extends AbstractWebService implements
Set<NodeRef> nodeRefs = AdministrationWebService.this.personService.getAllPeople();
// TODO do the filter of the resulting list here ....
List<NodeRef> filteredNodeRefs = new ArrayList<NodeRef>(nodeRefs);
// Filter the results
List<NodeRef> filteredNodeRefs = null;
if (filter != null && filter.getUserName() != null && filter.getUserName().length() != 0)
{
String userNameFilter = filter.getUserName();
if (logger.isDebugEnabled() == true)
{
logger.debug("Applying user query filter (" + userNameFilter + ")");
}
filteredNodeRefs = new ArrayList<NodeRef>(nodeRefs.size());
for (NodeRef nodeRef : nodeRefs)
{
String userName = (String)AdministrationWebService.this.nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
if (userName.matches(userNameFilter) == true)
{
filteredNodeRefs.add(nodeRef);
}
}
}
else
{
if (logger.isDebugEnabled() == true)
{
logger.debug("No user filter specified");
}
filteredNodeRefs = new ArrayList<NodeRef>(nodeRefs);
}
int totalRows = filteredNodeRefs.size();
int lastRow = calculateLastRowIndex(totalRows);