remove lastLogin attribute to improve svn and bzr performance

This commit is contained in:
Sebastian Sdorra
2011-01-13 20:19:06 +01:00
parent deae748e72
commit f9dcf08f31
5 changed files with 114 additions and 44 deletions

View File

@@ -273,6 +273,7 @@ public class XmlUserManager extends AbstractUserManager
if (userDB.contains(name))
{
AssertUtil.assertIsValid(user);
user.setLastModified(System.currentTimeMillis());
synchronized (XmlUserManager.class)
{

View File

@@ -124,21 +124,13 @@ public class BasicSecurityContext implements WebSecurityContext
try
{
user.setLastLogin(System.currentTimeMillis());
User dbUser = userManager.get(username);
if (dbUser != null)
if ((dbUser != null) && dbUser.copyProperties(user, false))
{
// update properties
dbUser.setDisplayName(user.getDisplayName());
dbUser.setLastLogin(user.getLastLogin());
dbUser.setMail(user.getMail());
dbUser.setType(user.getType());
userManager.modify(dbUser);
}
else
else if (dbUser == null)
{
userManager.create(user);
}

View File

@@ -59,7 +59,7 @@ Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
var userStore = new Sonia.rest.JsonStore({
url: restUrl + 'users.json',
fields: [ 'name', 'displayName', 'mail', 'admin', 'creationDate', 'lastLogin', 'type'],
fields: [ 'name', 'displayName', 'mail', 'admin', 'creationDate', 'lastModified', 'type'],
sortInfo: {
field: 'name'
}
@@ -77,7 +77,7 @@ Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
{id: 'mail', header: 'Mail', dataIndex: 'mail', renderer: this.renderMailto, width: 200},
{id: 'admin', header: 'Admin', dataIndex: 'admin', renderer: this.renderCheckbox, width: 50},
{id: 'creationDate', header: 'Creation date', dataIndex: 'creationDate'},
{id: 'lastLogin', header: 'Last login', dataIndex: 'lastLogin'},
{id: 'lastLogin', header: 'Last modified', dataIndex: 'lastModified'},
{id: 'type', header: 'Type', dataIndex: 'type', width: 80}
]
});