1
0
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:
xiez
2012-04-11 19:48:20 +08:00
parent 0ccd1ea981
commit 8c9a5084e6
19 changed files with 296 additions and 189 deletions

View File

@@ -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):