mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 18:30:53 +00:00
Using ccnet EmailUser table instead of seahub auth_user table.
* Rewrite auth module, change user to emailuser. * Remove site app, and remove EmailOrUsernameModelBackend.
This commit is contained in:
@@ -51,9 +51,12 @@ class PasswordResetTokenGenerator(object):
|
||||
# invalid as soon as it is used.
|
||||
# We limit the hash to 20 chars to keep URL short
|
||||
from django.utils.hashcompat import sha_constructor
|
||||
import datetime
|
||||
ctime = datetime.datetime.fromtimestamp(user.ctime/1000000)
|
||||
hash = sha_constructor(settings.SECRET_KEY + unicode(user.id) +
|
||||
user.password + user.last_login.strftime('%Y-%m-%d %H:%M:%S') +
|
||||
user.password + ctime.strftime('%Y-%m-%d %H:%M:%S') +
|
||||
unicode(timestamp)).hexdigest()[::2]
|
||||
|
||||
return "%s-%s" % (ts_b36, hash)
|
||||
|
||||
def _num_days(self, dt):
|
||||
|
Reference in New Issue
Block a user