DM User Usages/Quotas - fixes to prevent negative quota and to allow editing to be finished after an error

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8020 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-01-18 15:05:16 +00:00
parent e08a3d8502
commit 5e933c75b9
4 changed files with 45 additions and 13 deletions

View File

@@ -205,14 +205,26 @@ public class EditUserWizard extends CreateUserWizard
// TODO: RESET HomeSpace Ref found in top-level navigation bar!
// NOTE: not need cos only admin can do this?
putSizeQuotaProperty(this.userName, this.sizeQuota, this.sizeQuotaUnits);
if ((this.sizeQuota != null) && (this.sizeQuota < 0L))
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, UsersDialog.ERROR_NEGATIVE_QUOTA), this.sizeQuota));
outcome = null;
}
else
{
putSizeQuotaProperty(this.userName, this.sizeQuota, this.sizeQuotaUnits);
}
}
catch (Throwable e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), ERROR), e.getMessage()), e);
outcome = null;
}
if (outcome == null) {
this.isFinished = false;
}
return outcome;
}
}