1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

Add file shared link, and modify url viewing file

This commit is contained in:
xiez
2012-07-11 22:39:36 +08:00
parent c3296df1c1
commit d66938cce0
10 changed files with 547 additions and 85 deletions

View File

@@ -68,13 +68,13 @@ def get_ccnetapplet_root():
ccnet_applet_root = settings.CCNET_APPLET_ROOT
return ccnet_applet_root
def gen_token():
def gen_token(max_length=5):
"""
Generate short token used for owner to access repo file.
Generate a random token.
"""
token = sha_constructor(settings.SECRET_KEY + unicode(time.time())).hexdigest()[:5]
token = sha_constructor(settings.SECRET_KEY + unicode(time.time())).hexdigest()[:max_length]
return token
def validate_group_name(group_name):