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__)
+
[email protected]('/')
+def hello_world():
+ return render_template('index.html')
+
[email protected]('/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: [email protected]
For additional commands, e-mail: [email protected]