Merge pull request #6425 from FreeCodeCamp/feature/cheaters

Block certs from cheaters
pull/6433/head
Quincy Larson 2016-01-25 12:03:44 +08:00
commit d3ed4f425c
2 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,11 @@
"default": false,
"description": "User is banned from posting to camper news"
},
"isCheater": {
"type": "boolean",
"default": false,
"description": "Users who are confirmed to break academic honesty policy are marked as cheaters"
},
"isGithubCool": {
"type": "boolean",
"default": false

View File

@ -315,6 +315,18 @@ module.exports = function(app) {
});
return res.redirect('back');
}
if (user.isCheater) {
req.flash('errors', {
msg: dedent`
Upon review, this account has been flagged for academic
dishonesty. If youre the owner of this account contact
team@freecodecamp.com for details.
`
});
return res.redirect(`/${user.username}`);
}
if (user.isLocked) {
req.flash('errors', {
msg: dedent`