mirror of https://github.com/CIRCL/lookyloo
new: Fake field to avoid dumb bots
parent
240edc97dc
commit
8a5b1f263e
|
@ -475,6 +475,10 @@ def cache_tree(tree_uuid: str):
|
|||
def send_mail(tree_uuid: str):
|
||||
if not enable_mail_notification:
|
||||
return redirect(url_for('tree', tree_uuid=tree_uuid))
|
||||
if request.form.get('name'):
|
||||
# got a bot.
|
||||
logging.info(f'{src_request_ip(request)} is a bot - {request.headers.get("User-Agent")}.')
|
||||
return redirect('https://www.youtube.com/watch?v=iwGFalTRHDA')
|
||||
email: str = request.form['email'] if request.form.get('email') else ''
|
||||
if '@' not in email:
|
||||
# skip clearly incorrect emails
|
||||
|
|
|
@ -85,3 +85,14 @@ table td p {
|
|||
padding: 5px;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
/* boaty */
|
||||
.boatymcboat {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 0;
|
||||
width: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
|
|
@ -488,6 +488,11 @@
|
|||
<div class="form-group">
|
||||
<label for="email">Email address - used to get back in touch with you if needed (optional)</label>
|
||||
<input type="email" class="form-control" name="email" id="email" placeholder="Enter email">
|
||||
|
||||
<!-- boat fields -->
|
||||
<label class="boatymcboat" for="name">Your Name</label>
|
||||
<input class="boatymcboat" autocomplete="off" type="text" id="name" name="name"
|
||||
placeholder="Your fav boat name here">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="comment">Please write a comment (optional)</label>
|
||||
|
|
Loading…
Reference in New Issue