summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorequinox <equinox@diac24.net>2011-04-01 06:39:29 +0200
committerequinox <equinox@diac24.net>2011-04-01 06:39:51 +0200
commit5a8eaedec7b4354d82f00a9b8e8215828bdac611 (patch)
tree67382ce558be8e809903a5fafcf319b45d57b885
parent18f1e7de1820a63d5f8f49b52205b70a2107c2ea (diff)
add tickets to successful login site
-rwxr-xr-xindex.py12
-rw-r--r--templates/select.html2
2 files changed, 11 insertions, 3 deletions
diff --git a/index.py b/index.py
index 0fd89af..debb815 100755
--- a/index.py
+++ b/index.py
@@ -12,8 +12,11 @@ from lxml import etree
from lxml.html import formfill
from StringIO import StringIO
import ldap
-import mx.DateTime
+import mx.DateTime, urllib
from accountservice import accountservice
+import ticket
+
+tgt_sites = ['wiki']
class ldapobj(object):
def __init__(s, data):
@@ -61,7 +64,12 @@ class SubdapSite(object):
# e.message['info']
user = ldapobj(l.search_s(dn, ldap.SCOPE_BASE, '(objectclass=*)', []))
- return render('select.html', user = user)
+
+ tgts = {}
+ for site in tgt_sites:
+ tgts[site] = urllib.urlencode(ticket.tgt_create(site, user['cn']))
+
+ return render('select.html', user = user, tgts = tgts)
## x = ''
# for r in data:
diff --git a/templates/select.html b/templates/select.html
index e7dc1f2..4f54d02 100644
--- a/templates/select.html
+++ b/templates/select.html
@@ -10,7 +10,7 @@
<sub:bodyform>
<div class="cont">
Hallo ${user['cn']}!
- <p class="app"><a href="http://sublab.org"><img src="${url('static/app_wiki.png')}" alt="wiki"/> sublab.org wiki</a></p>
+ <p class="app"><a href="https://wiki.sublab.org/auth_subdap.php?${tgts['wiki']}"><img src="${url('static/app_wiki.png')}" alt="wiki"/> sublab.org wiki</a></p>
<p class="app"><a href=""><img src="${url('static/app_subdap.png')}" alt="wiki"/> Benutzerdaten</a></p>
</div>
</sub:bodyform>