remove circular dependencies on SetFELog
This commit is contained in:
2
main.py
2
main.py
@@ -64,7 +64,6 @@ from files import Entry
|
||||
from person import Person
|
||||
from settings import Settings
|
||||
from user import PAUser
|
||||
from job import SetFELog
|
||||
|
||||
####################################### GLOBALS #######################################
|
||||
# allow jinja2 to call these python functions directly
|
||||
@@ -120,6 +119,7 @@ def login():
|
||||
# the re matches on any special LDAP chars, we dont want someone
|
||||
# ldap-injecting our username, so send them back to the login page instead
|
||||
if request.method == 'POST' and re.search( r'[()\\*&!]', request.form['username']):
|
||||
from job import SetFELog
|
||||
SetFELog( message=f"ERROR: Detected special LDAP chars in username: {request.form['username']}", log_level="error", persistent=True, cant_close=True )
|
||||
return redirect(url_for('login'))
|
||||
if form.validate_on_submit():
|
||||
|
||||
Reference in New Issue
Block a user