This Question is Answered

1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
3 Replies Last post: Jul 18, 2008 3:01 PM by Vinh  
amitabhc Novice 31 posts since
Apr 17, 2007
Currently Being Moderated

Jul 15, 2008 11:47 PM

Registered date is Dec 31, 1969

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

Vinh Expert 3,392 posts since
Apr 1, 2008
Currently Being Moderated
Jul 16, 2008 9:34 AM in response to: amitabhc
Re: Registered date is Dec 31, 1969

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

Vinh Expert 3,392 posts since
Apr 1, 2008
Currently Being Moderated
Jul 18, 2008 3:01 PM in response to: amitabhc
Re: Registered date is Dec 31, 1969

You're right 

 

Sorry about the confusion.

More Like This

  • Retrieving data ...