# HG changeset patch # User Daniele Nicolodi # Date 1320761433 -3600 # Node ID e06b0e1627577f559ed779d7c787d1089feefe22 # Parent 8da56d2a70d6797ddf7183dced827326b869fe49 Remove unused source file. diff -r 8da56d2a70d6 -r e06b0e162757 src/ltpdarepo/views/base.py --- a/src/ltpdarepo/views/base.py Tue Nov 08 12:46:54 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -from flask import Blueprint, request, session, redirect, flash, render_template, g - -from ltpdarepo.security import require, authenticate - -app = Blueprint('base', __name__) - - -@app.route('/login', methods=('GET', 'POST')) -def login(): - if request.method == 'POST': - if authenticate(request.form['username'], request.form['password']): - session['username'] = request.form['username'] - url = request.args.get('next', '/') - return redirect(url) - flash('Login failed.', category='error') - - return render_template('login.html') - - -@app.route('/logout') -def logout(): - session.pop('username', None) - return redirect('/') - - -@app.route('/') -@require('user') -def index(): - curs = g.db.cursor() - curs.execute("""SELECT DISTINCT Db FROM mysql.db, available_dbs - WHERE Select_priv='Y' AND User=%s AND Db=db_name - ORDER BY Db""", session['username']) - dbs = [row[0] for row in curs.fetchall()] - return render_template('index.html', databases=dbs) - -module = app