mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +00:00
Remove force server crypto
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from seahub.base.fields import LowerCaseCharField
|
from seahub.base.fields import LowerCaseCharField
|
||||||
from seahub.settings import FORCE_SERVER_CRYPTO
|
|
||||||
from seahub.utils import is_pro_version
|
from seahub.utils import is_pro_version
|
||||||
|
|
||||||
KEY_SERVER_CRYPTO = "server_crypto"
|
KEY_SERVER_CRYPTO = "server_crypto"
|
||||||
@@ -71,27 +70,10 @@ class UserOptionsManager(models.Manager):
|
|||||||
VAL_SERVER_CRYPTO_DISABLED)
|
VAL_SERVER_CRYPTO_DISABLED)
|
||||||
|
|
||||||
def is_server_crypto(self, username):
|
def is_server_crypto(self, username):
|
||||||
"""Check whether user is set server crypto. Returns ``True`` if
|
"""Client crypto is deprecated, always return ``True``.
|
||||||
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`:
|
|
||||||
"""
|
"""
|
||||||
if FORCE_SERVER_CRYPTO is True:
|
|
||||||
return 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
|
|
||||||
|
|
||||||
def enable_user_guide(self, username):
|
def enable_user_guide(self, username):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@@ -80,7 +80,6 @@ def edit_profile(request):
|
|||||||
'form': form,
|
'form': form,
|
||||||
'server_crypto': server_crypto,
|
'server_crypto': server_crypto,
|
||||||
"sub_lib_enabled": sub_lib_enabled,
|
"sub_lib_enabled": sub_lib_enabled,
|
||||||
'force_server_crypto': settings.FORCE_SERVER_CRYPTO,
|
|
||||||
'default_repo': default_repo,
|
'default_repo': default_repo,
|
||||||
'owned_repos': owned_repos,
|
'owned_repos': owned_repos,
|
||||||
'is_pro': is_pro_version(),
|
'is_pro': is_pro_version(),
|
||||||
|
@@ -300,9 +300,6 @@ USER_STRONG_PASSWORD_REQUIRED = False
|
|||||||
# Force user to change password when admin add/reset a user.
|
# Force user to change password when admin add/reset a user.
|
||||||
FORCE_PASSWORD_CHANGE = True
|
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 or disable repo history setting
|
||||||
ENABLE_REPO_HISTORY_SETTING = True
|
ENABLE_REPO_HISTORY_SETTING = True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user