1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 06:33:48 +00:00

Remove force server crypto

This commit is contained in:
zhengxie
2017-09-12 13:55:06 +08:00
parent 3968201731
commit ba714ea1f5
3 changed files with 2 additions and 24 deletions

View File

@@ -4,7 +4,6 @@
from django.db import models
from seahub.base.fields import LowerCaseCharField
from seahub.settings import FORCE_SERVER_CRYPTO
from seahub.utils import is_pro_version
KEY_SERVER_CRYPTO = "server_crypto"
@@ -71,26 +70,9 @@ class UserOptionsManager(models.Manager):
VAL_SERVER_CRYPTO_DISABLED)
def is_server_crypto(self, username):
"""Check whether user is set server crypto. Returns ``True`` if
server crypto is enabled, otherwise ``False``.
Raise ``CryptoOptionNotSetError`` if this option is not set.
NOTE: Always return ``True`` if ``FORCE_SERVER_CRYPTO`` is set to
``True``.
Arguments:
- `username`:
"""Client crypto is deprecated, always return ``True``.
"""
if FORCE_SERVER_CRYPTO is True:
return True
try:
user_option = super(UserOptionsManager, self).get(
email=username, option_key=KEY_SERVER_CRYPTO)
return bool(int(user_option.option_val))
except UserOptions.DoesNotExist:
raise CryptoOptionNotSetError
return True
def enable_user_guide(self, username):
"""

View File

@@ -80,7 +80,6 @@ def edit_profile(request):
'form': form,
'server_crypto': server_crypto,
"sub_lib_enabled": sub_lib_enabled,
'force_server_crypto': settings.FORCE_SERVER_CRYPTO,
'default_repo': default_repo,
'owned_repos': owned_repos,
'is_pro': is_pro_version(),

View File

@@ -300,9 +300,6 @@ USER_STRONG_PASSWORD_REQUIRED = False
# Force user to change password when admin add/reset a user.
FORCE_PASSWORD_CHANGE = True
# Using server side crypto by default, otherwise, let user choose crypto method.
FORCE_SERVER_CRYPTO = True
# Enable or disable repo history setting
ENABLE_REPO_HISTORY_SETTING = True