瀏覽代碼

[add] disable 2fa

version-14
Rushabh Mehta 8 年之前
父節點
當前提交
e5138af195
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      frappe/twofactor.py

+ 3
- 1
frappe/twofactor.py 查看文件

@@ -17,7 +17,6 @@ class ExpiredLoginException(Exception): pass

def toggle_two_factor_auth(state, roles=[]):
'''Enable or disable 2FA in site_config and roles'''
frappe.db.set_value('System Settings', None, 'enable_two_factor_auth', 1)
for role in roles:
role = frappe.get_doc('Role', {'role_name': role})
role.two_factor_auth = state
@@ -365,3 +364,6 @@ def should_remove_barcode_image(barcode):
return True
return False

def disable():
frappe.db.set_value('System Settings', None, 'enable_two_factor_auth', 0)


Loading…
取消
儲存