I am using Clearspacex 2.0.1, and the user that get created have a default creation date as Dec 31, 1969. Which is 0 in the database. I was told that this was fixed in 2.0.4, however I would like to patch the current installation to display the correct date of registration.
thanks,
amit
I believe this is resolved in v2.0.2. These were the changes if you would like to patch your instance:
In com/jivesoftware/base/UserTemplate.java, change lines 156 and 157 from this:
this.creationDate = (user.getCreationDate() != null) ? user.getCreationDate().getTime() : 0;
this.modificationDate = (user.getModificationDate() != null) ? user.getModificationDate().getTime() : 0;
To this:
this.creationDate = (user.getCreationDate() != null) ? user.getCreationDate().getTime() : -1;
this.modificationDate = (user.getModificationDate() != null) ? user.getModificationDate().getTime() : -1;
There is also a new test to add to line 90 of /com/jivesoftware/community/UserManagerTest.java:
@Test
public void testCreateUserCreationDate() throws UserAlreadyExistsException {
User userD = null;
long before = System.currentTimeMillis();
userD = manager.createUser(new UserTemplate("testCreateD", "createDPass", "testCreateD@localhost"));
long after = System.currentTimeMillis();
assert(before <= userD.getCreationDate().getTime() && after >= userD.getCreationDate().getTime());
}
Again, we recommend that you upgrade to 2.0.2 or higher in order to take advantage of the fix, but the changes to UserTemplate.java should also achieve what you're looking for.
Thanks,
Vinh
Hi Vinh,
Thanks, that helped resolve the issue. It was looking really ugly to see the column "Registered" date as Dec 31, 1969 for all users. However there is no reference to /com/jivesoftware/community/UserManagerTest.java file on the 2.0.1 version. I am assuming this is a test function used internally on Jive Software.
thanks again,
amitabh
You're right
Sorry about the confusion.