提交 5bb867d1 编写于 作者: baltery's avatar baltery

[Update] 添加禁用用户mfa脚本

上级 0eda8865
#!/bin/bash
#
username=$1
if [ -z "${username}" ];then
echo "No username specify, exit"
exit 1
fi
function disable_user_mfa() {
python ../apps/manage.py shell << EOF
import sys
from users.models import User
user = User.objects.filter(username="${username}")
if not user:
print("No user found")
sys.exit(1)
user.update(otp_level=0)
print("Disable user ${username} success")
EOF
}
disable_user_mfa
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册