def enrollment_remove(self, _):
rpc = self.application.rpc
this_user = rpc.remote_table_row('users', rpc.username)
if this_user.otp_secret is None:
gui_utilities.show_dialog_info(
'Not Enrolled',
self.application.get_active_window(),
'This account is not currently enrolled in two factor\n'\
+ 'authentication. There are no changes to make.'
)
return
remove = gui_utilities.show_dialog_yes_no(
'Already Enrolled',
self.application.get_active_window(),
'Are you sure you want to unenroll in TOTP? This will remove\n'\
+ 'two factor authentication on your account.'
)
if not remove:
return
this_user.otp_secret = None
this_user.commit()
gui_utilities.show_dialog_info(
'TOTP Unenrollment',
self.application.get_active_window(),
'Successfully removed the TOTP secret. Your account is now unenrolled\n'\
+ 'in two factor authentication. You will no longer be prompted to enter\n'\
+ 'the value when you login.'
)
评论列表
文章目录