From a0c8d819cd002f15c8a4ccc3f7262736c7a3bfdd Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 16 Feb 2015 18:24:08 +0000 Subject: Add page for logging in --- run.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 2608212..6de0c08 100755 --- a/run.py +++ b/run.py @@ -1,6 +1,6 @@ #!/usr/bin/env python from flask import Flask, send_from_directory, render_template, url_for -from flask_kerberos import init_kerberos +from flask_kerberos import init_kerberos, requires_authentication from classes import Network, Channel, Log from urllib.parse import quote_plus import sys, os @@ -83,5 +83,20 @@ def get_log(network_name, channel_name, log_file): def send_static(filename): return send_from_directory('static', filename) +@app.route('/login') +@requires_authentication +def login(principal): + if principal == 'kyrias@KYRIASIS.COM': + session['logged_in'] = True + + else: + session.pop('logged_in', None) + return abort(401) + + if session['logged_in']: + return ''' + Logged in! index + ''' + if __name__ == '__main__': app.run(port=app.config['PORT']) -- cgit v1.2.3-70-g09d2