forked from rDrama/rDrama
parent
fa9290a794
commit
caf3a81748
|
@ -111,7 +111,7 @@ def log_failed_admin_login_attempt(account:User, type:str):
|
||||||
ip = get_CF()
|
ip = get_CF()
|
||||||
print(f"Admin user from {ip} failed to login to account @{account.user_name} (invalid {type})!")
|
print(f"Admin user from {ip} failed to login to account @{account.user_name} (invalid {type})!")
|
||||||
try:
|
try:
|
||||||
with open(f"/admin_failed_logins", "a+", encoding="utf-8") as f:
|
with open("/admin_failed_logins", "a+", encoding="utf-8") as f:
|
||||||
t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time())))
|
t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time())))
|
||||||
f.write(f"{t}, {ip}, {account.username}, {type}\n")
|
f.write(f"{t}, {ip}, {account.username}, {type}\n")
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -634,7 +634,7 @@ def submit_post(v, sub=None):
|
||||||
# we also allow 'code contributor' badgeholders to post to the changelog hole
|
# we also allow 'code contributor' badgeholders to post to the changelog hole
|
||||||
allowed = g.db.query(Badge.user_id).filter_by(badge_id=3).all()
|
allowed = g.db.query(Badge.user_id).filter_by(badge_id=3).all()
|
||||||
allowed = [x[0] for x in allowed]
|
allowed = [x[0] for x in allowed]
|
||||||
if v.id not in allowed: return error(f"You don't have sufficient permissions to post in /h/changelog")
|
if v.id not in allowed: return error("You don't have sufficient permissions to post in /h/changelog")
|
||||||
|
|
||||||
if sub in ('furry','vampire','racist','femboy') and not v.client and not v.house.lower().startswith(sub):
|
if sub in ('furry','vampire','racist','femboy') and not v.client and not v.house.lower().startswith(sub):
|
||||||
return error(f"You need to be a member of House {sub.capitalize()} to post in /h/{sub}")
|
return error(f"You need to be a member of House {sub.capitalize()} to post in /h/{sub}")
|
||||||
|
|
|
@ -217,7 +217,7 @@ def submit_contact(v):
|
||||||
if v.is_muted:
|
if v.is_muted:
|
||||||
abort(403)
|
abort(403)
|
||||||
|
|
||||||
body = f'This message has been sent automatically to all admins via [/contact](/contact)\n\nMessage:\n\n' + body
|
body = f'This message has been sent automatically to all admins via [/contact](/contact)\n\nMessage:\n\n{body}'
|
||||||
body += process_files(request.files, v)
|
body += process_files(request.files, v)
|
||||||
body = body.strip()
|
body = body.strip()
|
||||||
body_html = sanitize(body)
|
body_html = sanitize(body)
|
||||||
|
@ -406,7 +406,7 @@ def transfers(v):
|
||||||
|
|
||||||
|
|
||||||
if not os.path.exists(f'files/templates/donate_{SITE_NAME}.html'):
|
if not os.path.exists(f'files/templates/donate_{SITE_NAME}.html'):
|
||||||
copyfile(f'files/templates/donate_rDrama.html', f'files/templates/donate_{SITE_NAME}.html')
|
copyfile('files/templates/donate_rDrama.html', f'files/templates/donate_{SITE_NAME}.html')
|
||||||
|
|
||||||
@app.get('/donate')
|
@app.get('/donate')
|
||||||
@auth_desired_with_logingate
|
@auth_desired_with_logingate
|
||||||
|
|
|
@ -80,7 +80,7 @@ def get_logged_in_user():
|
||||||
|
|
||||||
if AEVANN_ID and request.headers.get("Cf-Ipcountry") == 'EG':
|
if AEVANN_ID and request.headers.get("Cf-Ipcountry") == 'EG':
|
||||||
if v and not v.username.startswith('Aev') and v.truescore > 0:
|
if v and not v.username.startswith('Aev') and v.truescore > 0:
|
||||||
with open(f"/eg", "r+", encoding="utf-8") as f:
|
with open("/eg", "r+", encoding="utf-8") as f:
|
||||||
ip = request.headers.get('CF-Connecting-IP')
|
ip = request.headers.get('CF-Connecting-IP')
|
||||||
if f'@{v.username}, ' not in f.read():
|
if f'@{v.username}, ' not in f.read():
|
||||||
t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time())))
|
t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time())))
|
||||||
|
|
Loading…
Reference in New Issue