|
|
@ -4,7 +4,6 @@ from ldap3 import Server, Connection, ALL, MODIFY_REPLACE |
|
|
|
from flask import Flask, g, request, session, redirect, url_for, render_template |
|
|
|
from flask_simpleldap import LDAP |
|
|
|
from flask_bootstrap import Bootstrap |
|
|
|
from readability import Document |
|
|
|
from readabilipy import simple_json_from_html_string |
|
|
|
import os |
|
|
|
import sqlite3 |
|
|
@ -105,9 +104,9 @@ def login(): |
|
|
|
session['user_id'] = request.form['user'] |
|
|
|
session['passwd'] = request.form['passwd'] |
|
|
|
|
|
|
|
if session['next']: |
|
|
|
next = session['next'] |
|
|
|
session['next'] = '' |
|
|
|
if 'next_redirect' in session: |
|
|
|
next = session['next_redirect'] |
|
|
|
session['next_redirect'] = '' |
|
|
|
return redirect(next) |
|
|
|
return redirect('/') |
|
|
|
return render_template('login.j2') |
|
|
@ -134,7 +133,7 @@ def read_article(article_id): |
|
|
|
@app.route('/add', methods=['GET', 'POST']) |
|
|
|
def add_url(): |
|
|
|
if not 'user_id' in session: |
|
|
|
session['next'] = request.url |
|
|
|
session['next_redirect'] = request.url |
|
|
|
return redirect(url_for('login')) |
|
|
|
if request.method == 'POST': |
|
|
|
url = request.form['url'] |
|
|
|