mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 02:48:51 +00:00
two-factor-auth
This commit is contained in:
@@ -76,7 +76,7 @@ try:
|
||||
from seahub.settings import MULTI_TENANCY
|
||||
except ImportError:
|
||||
MULTI_TENANCY = False
|
||||
from seahub.utils.two_factor_auth import HAS_TWO_FACTOR_AUTH
|
||||
from seahub.utils.two_factor_auth import has_two_factor_auth, HAS_TWO_FACTOR_AUTH
|
||||
from termsandconditions.models import TermsAndConditions
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -618,6 +618,13 @@ def user_info(request, email):
|
||||
else:
|
||||
g.role = _('Member')
|
||||
|
||||
_default_device = False
|
||||
_has_two_factor_auth = has_two_factor_auth()
|
||||
if _has_two_factor_auth:
|
||||
from seahub_extra.two_factor.utils import default_device
|
||||
_user = User.objects.get(email=email)
|
||||
_default_device = default_device(_user)
|
||||
|
||||
return render_to_response(
|
||||
'sysadmin/userinfo.html', {
|
||||
'owned_repos': owned_repos,
|
||||
@@ -631,6 +638,8 @@ def user_info(request, email):
|
||||
'user_shared_links': user_shared_links,
|
||||
'enable_sys_admin_view_repo': ENABLE_SYS_ADMIN_VIEW_REPO,
|
||||
'personal_groups': personal_groups,
|
||||
'two_factor_auth_enabled': _has_two_factor_auth,
|
||||
'default_device': _default_device,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@login_required_ajax
|
||||
|
Reference in New Issue
Block a user