diff --git a/CTFd/admin.py b/CTFd/admin.py index ff5eb538..7887c250 100644 --- a/CTFd/admin.py +++ b/CTFd/admin.py @@ -463,6 +463,14 @@ def admin_team(teamid): db.session.close() return jsonify({'data': ['success']}) + verified = request.form.get('verified', None) + if verified: + verified = True if verified == 'true' else False + user.verified = verified + db.session.commit() + db.session.close() + return jsonify({'data': ['success']}) + name = request.form.get('name', None) password = request.form.get('password', None) email = request.form.get('email', None) diff --git a/CTFd/templates/original/admin/teams.html b/CTFd/templates/original/admin/teams.html index 871a5129..6603aeff 100644 --- a/CTFd/templates/original/admin/teams.html +++ b/CTFd/templates/original/admin/teams.html @@ -115,6 +115,8 @@ input[type="checkbox"] { margin: 0px !important; position: relative; top: 5px; } Admin + Verified + Settings @@ -137,6 +139,11 @@ input[type="checkbox"] { margin: 0px !important; position: relative; top: 5px; } + +
+ +
+ {% if can_send_mail() %}{% endif %} @@ -211,11 +218,21 @@ $('#update-user').click(function(e){ $('.team-admin input').on('change', function(){ var elem = $(this).parent().parent().parent(); var id = elem.find('.team-id').text().trim(); - var admin = $(this).prop('checked') - var nonce = $('#nonce').val() - console.log(admin) + var admin = $(this).prop('checked'); + var nonce = $('#nonce').val(); + console.log(admin); $.post('{{ request.script_root }}/admin/team/'+id, {'admin':admin, 'nonce':nonce}); +}); + +$('.team-verified input').on('change', function () { + var elem = $(this).parent().parent().parent(); + var id = elem.find('.team-id').text().trim(); + var verified = $(this).prop('checked'); + var nonce = $('#nonce').val(); + console.log(verified); + + $.post('{{ request.script_root }}/admin/team/' + id, {'verified': verified, 'nonce': nonce}); }) $('#send-user-email').click(function(e){