diff options
-rwxr-xr-x | index.py | 7 | ||||
-rw-r--r-- | static/app_8021x.png | bin | 0 -> 1107 bytes | |||
-rw-r--r-- | static/layout.css | 24 | ||||
-rw-r--r-- | templates/8021x.html | 33 | ||||
-rw-r--r-- | templates/layout.xi | 9 | ||||
-rw-r--r-- | templates/select.html | 2 |
6 files changed, 75 insertions, 0 deletions
@@ -50,6 +50,10 @@ class SubdapSite(object): def index(s): return render(errors = {}) + @expose('8021x.html') + def cfg8021x(s, username = "username"): + return render(errors = {}, username = username) + def login_perform(s, username, password): dn = "cn=%s,ou=people,dc=sublab,dc=org" % (username) try: @@ -65,6 +69,9 @@ class SubdapSite(object): @expose('login.html') def login(s, username = None, password = None): + if cherrypy.request.method.upper() == 'GET': + return render(errors = {}) + if username == None or password == None: return render(errors = {'password': 'Login incorrect'}) if username == '' or password == '': diff --git a/static/app_8021x.png b/static/app_8021x.png Binary files differnew file mode 100644 index 0000000..ef3c6da --- /dev/null +++ b/static/app_8021x.png diff --git a/static/layout.css b/static/layout.css index 181d563..d54d79e 100644 --- a/static/layout.css +++ b/static/layout.css @@ -2,6 +2,7 @@ body, table { font-family:sans; font-size:11pt; } +body#large, body#formcont { margin:auto; text-align:center; @@ -9,6 +10,21 @@ body#formcont { body#formcont < div { display:inline-block; } +body#large < div { + display:inline-block; + text-align:left; +} +body#large div.cont { + display:inline-block; + vertical-align:top; + text-align:left; + border-left:1px solid #888; + margin:2em; + margin-left:0.5em; + padding:2em; + min-height:180px; +} + img#logo { display:inline-block; margin:3em; @@ -31,6 +47,14 @@ body#formcont form p { font-size:8pt; } +h1 { + font-size:14pt; + margin:6pt 0pt; +} +pre { + text-align:left; +} + p.app { border:1px solid #ccc; padding:2pt; diff --git a/templates/8021x.html b/templates/8021x.html new file mode 100644 index 0000000..3e3405a --- /dev/null +++ b/templates/8021x.html @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:py="http://genshi.edgewall.org/" + xmlns:sub="http://local.sublab.org/subdap/xmlns-templates" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="layout.xi"/> + <head> + <title>login</title> + </head> + <sub:bodylarge> + <div class="cont"> + <h1>wpa_supplicant WPA-EAP template</h1> + <pre>network={ + scan_ssid=1 + ssid="crew.sublab.org" + + key_mgmt=WPA-EAP + eap=TTLS + phase2="auth=PAP" + + identity="${username}" + password="<i style="color:red;background-color:white">passwort hier einsetzen</i>" + + anonymous_identity="bernd" + ca_cert="<a href="${url('static/cacert.org.pem')}">/etc/ssl/certs/cacert.org.pem</a>" + altsubject_match="DNS:taifun.local.sublab.org" + priority=500 +} + </pre> + </div> + </sub:bodylarge> +</html> diff --git a/templates/layout.xi b/templates/layout.xi index ed8dab8..b5dfd47 100644 --- a/templates/layout.xi +++ b/templates/layout.xi @@ -30,4 +30,13 @@ </div> </body> </py:match> + + <py:match path="sub:bodylarge" once="true"> + <body id="large" py:attrs="select('@*')"> + <div> + <a href="login"><img id="logo" src="static/ldap.png" alt="subdap" width="192" height="230"/></a> + ${select('*')} + </div> + </body> + </py:match> </html> diff --git a/templates/select.html b/templates/select.html index 5fd322f..b25cd1c 100644 --- a/templates/select.html +++ b/templates/select.html @@ -19,6 +19,8 @@ Hallo ${user['cn']}! <p class="app"><a href="https://wiki.sublab.org/auth_subdap.php?${tgts['wiki']}"> <img src="${url('static/app_wiki.png')}" alt="wiki" width="48" height="48"/> sublab.org wiki</a></p> + <p class="app"><a href="cfg8021x?username=${user['cn']}"> + <img src="${url('static/app_8021x.png')}" alt="wlan" width="24" height="24"/> 802.1X config</a></p> <p class="app"><a href="pwchange?username=${user['cn']}"> <img src="${url('static/app_password.png')}" alt="pwchange" width="24" height="24"/> Passwort ändern</a></p> </div> |