labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1522629 [1/7] - in /labs/panopticon: ./ src/asf/panopticon/ src/asf/panopticon/static/ src/asf/panopticon/static/css/ src/asf/panopticon/static/fonts/ src/asf/panopticon/static/js/ src/asf/panopticon/templates/
Date Thu, 12 Sep 2013 15:38:26 GMT
Author: adc
Date: Thu Sep 12 15:38:25 2013
New Revision: 1522629

URL: http://svn.apache.org/r1522629
Log:
Flask framework

Added:
    labs/panopticon/src/asf/panopticon/
    labs/panopticon/src/asf/panopticon/__init__.py
    labs/panopticon/src/asf/panopticon/static/
    labs/panopticon/src/asf/panopticon/static/css/
    labs/panopticon/src/asf/panopticon/static/css/bootstrap.css   (with props)
    labs/panopticon/src/asf/panopticon/static/css/bootstrap.min.css   (with props)
    labs/panopticon/src/asf/panopticon/static/css/panopticon.css
    labs/panopticon/src/asf/panopticon/static/favicon.ico
    labs/panopticon/src/asf/panopticon/static/fonts/
    labs/panopticon/src/asf/panopticon/static/fonts/glyphicons-halflings-regular.eot   (with
props)
    labs/panopticon/src/asf/panopticon/static/fonts/glyphicons-halflings-regular.svg   (with
props)
    labs/panopticon/src/asf/panopticon/static/fonts/glyphicons-halflings-regular.ttf   (with
props)
    labs/panopticon/src/asf/panopticon/static/fonts/glyphicons-halflings-regular.woff   (with
props)
    labs/panopticon/src/asf/panopticon/static/js/
    labs/panopticon/src/asf/panopticon/static/js/bootstrap.js   (with props)
    labs/panopticon/src/asf/panopticon/static/js/bootstrap.min.js   (with props)
    labs/panopticon/src/asf/panopticon/templates/
    labs/panopticon/src/asf/panopticon/templates/index.html
    labs/panopticon/src/asf/panopticon/templates/layout.html
Modified:
    labs/panopticon/requirements.txt

Modified: labs/panopticon/requirements.txt
URL: http://svn.apache.org/viewvc/labs/panopticon/requirements.txt?rev=1522629&r1=1522628&r2=1522629&view=diff
==============================================================================
--- labs/panopticon/requirements.txt (original)
+++ labs/panopticon/requirements.txt Thu Sep 12 15:38:25 2013
@@ -1,5 +1,6 @@
 argparse
 brownie
+Flask
 keyring==1.6.1
 mock
 nose

Added: labs/panopticon/src/asf/panopticon/__init__.py
URL: http://svn.apache.org/viewvc/labs/panopticon/src/asf/panopticon/__init__.py?rev=1522629&view=auto
==============================================================================
--- labs/panopticon/src/asf/panopticon/__init__.py (added)
+++ labs/panopticon/src/asf/panopticon/__init__.py Thu Sep 12 15:38:25 2013
@@ -0,0 +1,43 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from flask import Flask, render_template, abort, request
+
+
+app = Flask(__name__)
+
+@app.route('/')
+def hello_world():
+    return render_template('index.html')
+
+@app.route('/login', methods=['POST'])
+def login():
+    if not g.login_allowed:
+        abort(403)
+    username = request.form.get('username')
+    password = request.form.get('password')
+    if ldap.check_user_password(username, password):
+        identity_changed.send(tools_base, identity=Identity(username))
+        flash(u'Signed in as ' + username, 'success')
+    else:
+        flash(u'Invalid username or password', 'error')
+    return redirect(request.referrer)
+
+if __name__ == '__main__':
+    app.run()



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message