Commit 40ce9fa1 authored by okhin's avatar okhin
Browse files

Creating a db initialisation for admin pages

parent 007c5453
......@@ -481,14 +481,16 @@ def login_admin(user, password):
def little_admin(db):
def little_admin():
db = sqlite3.connect(config['piphone']['db'])
# We need to check if we're admin
users = db.execute('SELECT api, token, admin FROM users').fetchall()
return template('index', users=users, token=request.params['token'])'/admin')
def medium_admin(db):
def medium_admin():
db = sqlite3.connect(config['piphone']['db'])
api = request.forms.get('api')
token = request.forms.get('api_token')
admin = request.forms.get('admin')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment