diff --git a/.gitignore b/.gitignore index c61fb3e..9f349ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.sublime-project *.sublime-workspace -sftp-config.json \ No newline at end of file +sftp-config.json +admin.json \ No newline at end of file diff --git a/cards/0861643457.json b/cards/0861643457.json new file mode 100644 index 0000000..b03ae2f --- /dev/null +++ b/cards/0861643457.json @@ -0,0 +1 @@ +{"name": "Willeh", "secretTools": false, "fridge": false} \ No newline at end of file diff --git a/server.py b/server.py index 31661a6..4072c33 100644 --- a/server.py +++ b/server.py @@ -5,7 +5,12 @@ import json, time app = Flask(__name__) def check_auth(username, password): - return username == 'davide' and password == 'pwd' + admin_list = [] + with open('admin.json', 'r') as admin: + admin_list = json.load(admin) + for user in admin_list: + if username == user['username']: + return password == user['password'] def authenticate(): return Response('Could not verify access level. Please retry', 401, {'WWW-Authenticate' : 'Basic realm="Login Required"'}) diff --git a/server.pyc b/server.pyc index 7752a69..d7af6a0 100644 Binary files a/server.pyc and b/server.pyc differ