Merge from HEAD into WCM-DEV2. Also fixes build breakage in

jndi-client and catalina-virtual that I introduced earlier. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3393 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-24 18:27:41 +00:00
parent ca9496d090
commit f6355ea108
171 changed files with 11880 additions and 3450 deletions

View File

@@ -59,6 +59,7 @@ public class UsersBean implements IContextListener
private static final String ERROR_USER_DELETE = "error_delete_user_object";
private static final String DEFAULT_OUTCOME = "manageUsers";
private static final String DIALOG_CLOSE = "dialog:close";
/** NodeService bean reference */
protected NodeService nodeService;
@@ -81,6 +82,7 @@ public class UsersBean implements IContextListener
private List<Node> users = Collections.<Node>emptyList();
private String password = null;
private String oldPassword = null;
private String confirm = null;
private String searchCriteria = null;
@@ -208,6 +210,22 @@ public class UsersBean implements IContextListener
{
this.password = password;
}
/**
* @return Returns the old password.
*/
public String getOldPassword()
{
return this.oldPassword;
}
/**
* @param oldPassword The old password to set.
*/
public void setOldPassword(String oldPassword)
{
this.oldPassword = oldPassword;
}
/**
* @return Returns the person context.
@@ -271,14 +289,9 @@ public class UsersBean implements IContextListener
*/
public String deleteOK()
{
UserTransaction tx = null;
FacesContext context = FacesContext.getCurrentInstance();
try
{
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context);
tx.begin();
String userName = (String)getPerson().getProperties().get("userName");
// we only delete the user auth if Alfresco is managing the authentication
@@ -292,28 +305,24 @@ public class UsersBean implements IContextListener
}
catch (AuthenticationException authErr)
{
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(), ERROR_USER_DELETE));
Utils.addErrorMessage(Application.getMessage(context, ERROR_USER_DELETE));
}
}
// delete the associated Person
this.personService.deletePerson(userName);
// commit the transaction
tx.commit();
// re-do the search to refresh the list
search();
}
catch (Throwable e)
{
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext
.getCurrentInstance(), ERROR_DELETE), e.getMessage()), e);
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context,
ERROR_DELETE), e.getMessage()), e);
}
return DEFAULT_OUTCOME;
return DIALOG_CLOSE;
}
/**
@@ -321,7 +330,7 @@ public class UsersBean implements IContextListener
*/
public String changePasswordOK()
{
String outcome = DEFAULT_OUTCOME;
String outcome = DIALOG_CLOSE;
if (this.password != null && this.confirm != null && this.password.equals(this.confirm))
{
@@ -346,6 +355,39 @@ public class UsersBean implements IContextListener
return outcome;
}
/**
* Action handler called for OK button press on Change My Password screen
* For this screen the user is required to enter their old password - effectively login.
*/
public String changeMyPasswordOK()
{
String outcome = DIALOG_CLOSE;
if (this.password != null && this.confirm != null && this.password.equals(this.confirm))
{
try
{
String userName = (String)this.person.getProperties().get(ContentModel.PROP_USERNAME);
this.authenticationService.updateAuthentication(userName, this.oldPassword.toCharArray(), this.password.toCharArray());
}
catch (Exception e)
{
outcome = null;
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext
.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
else
{
outcome = null;
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(),
ERROR_PASSWORD_MATCH));
}
return outcome;
}
/**
* Event handler called when the user wishes to search for a user