summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-02-16 18:27:06 +0000
committerJohannes Löthberg <johannes@kyriasis.com>2015-02-16 18:27:06 +0000
commiteb60561041d37f09226a55fae3bc30048750abd9 (patch)
tree203fe8b88fa716bde7d0aaadf2bb0125711d42e1
parent4f44f76ec5a3649dbfec097560b40107da3ecaad (diff)
downloadznc-log-viewer-eb60561041d37f09226a55fae3bc30048750abd9.tar.xz
Check authentication status in all views
-rwxr-xr-xrun.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/run.py b/run.py
index 926b555..4e44325 100755
--- a/run.py
+++ b/run.py
@@ -30,6 +30,7 @@ def get_files(directory):
@app.route('/')
def index():
+ authenticated()
networks = []
for network_name in get_files(app.config['ZNC_LOG_DIR']):
network_url = '{}/{}'.format(app.config['URL'], network_name)
@@ -45,6 +46,7 @@ def index():
@app.route('/<network_name>')
def get_network(network_name):
+ authenticated()
network_url = '{}/{}'.format(app.config['URL'], network_name)
channels = []
@@ -59,6 +61,7 @@ def get_network(network_name):
@app.route('/<network_name>/<channel_name>')
def channel_logs(network_name, channel_name):
+ authenticated()
network_url = '{}/{}'.format(app.config['URL'], network_name)
channel_url = '{}/{}'.format(network_url, quote_plus(channel_name))
@@ -75,6 +78,7 @@ def channel_logs(network_name, channel_name):
@app.route('/<network_name>/<channel_name>/<log_file>')
def get_log(network_name, channel_name, log_file):
+ authenticated()
with open(os.path.join(app.config['ZNC_LOG_DIR'], network_name, channel_name, log_file), 'rb') as file:
log = file.read().decode('utf-8', 'ignore')
return(render_template('log.html', log=log))