feat: Flag shared are considered valid
This commit is contained in:
17
flags.py
17
flags.py
@@ -1,8 +1,8 @@
|
|||||||
|
from CTFd.models import db
|
||||||
from CTFd.plugins.flags import BaseFlag
|
from CTFd.plugins.flags import BaseFlag
|
||||||
from CTFd.utils.user import get_current_user
|
from CTFd.utils.user import get_current_user
|
||||||
from CTFd.models import db
|
|
||||||
from .models import CheaterTeams
|
|
||||||
|
|
||||||
|
from .models import CheaterTeams
|
||||||
|
|
||||||
|
|
||||||
def report_cheater(challenge_id: int, cheater_id: int, helper_id: int, flag_id: int):
|
def report_cheater(challenge_id: int, cheater_id: int, helper_id: int, flag_id: int):
|
||||||
@@ -34,13 +34,12 @@ class PersonalFlag(BaseFlag):
|
|||||||
# If the flag is correct, we need to check if the team is the one associated with the flag
|
# If the flag is correct, we need to check if the team is the one associated with the flag
|
||||||
curr_user_id = get_current_user().id
|
curr_user_id = get_current_user().id
|
||||||
|
|
||||||
if int(user_id) == int(curr_user_id):
|
if int(user_id) != int(curr_user_id):
|
||||||
# User is correct
|
# Caught a cheater!
|
||||||
return True
|
report_cheater(
|
||||||
|
chal_key_obj.challenge_id, curr_user_id, user_id, chal_key_obj.id
|
||||||
|
)
|
||||||
|
|
||||||
# Caught a cheater!
|
return True
|
||||||
report_cheater(
|
|
||||||
chal_key_obj.challenge_id, curr_user_id, user_id, chal_key_obj.id
|
|
||||||
)
|
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user