Commit 8bc8b687 authored by Marcus's avatar Marcus
Browse files

Merge branch 'master' of git.scc.kit.edu:lo0018/pluto

parents 21836809 959eff58
...@@ -44,12 +44,16 @@ $.get( from, function( assertion, stat ) { ...@@ -44,12 +44,16 @@ $.get( from, function( assertion, stat ) {
$.post(to, out, function(data, stat){ $.post(to, out, function(data, stat){
console.log('sending'); console.log('sending');
console.log('buf: ' + buf);
// replace content in the template // replace content in the template
buf = data.split("url="); buf = data.split("&");
url = buf[1]; url = buf[1].split("=")[1];
shorturl = buf[2].split("=")[1];
console.log('url: ' + url);
console.log('shorturl ' + shorturl);
$("#url2").html('<a href="'+url+'">encrypted assertion</a>'); $("#url2").html('<a href="'+url+'">encrypted assertion</a>');
$("#url").text(url+"?k="+key); $("#url").text(url+"?k="+key);
$("#short_url").text(short_url+"?k="+key); $("#shorturl").text(shorturl+"?k="+key);
$("#stat_post").text(stat) $("#stat_post").text(stat)
}) })
......
...@@ -60,11 +60,14 @@ def handler(req): ...@@ -60,11 +60,14 @@ def handler(req):
<tr> <td> Upload encrypted assertion </td><td id="stat_post"> Wait </td> </tr> <tr> <td> Upload encrypted assertion </td><td id="stat_post"> Wait </td> </tr>
</table> </table>
<br/><p> You can now use this URL as a temporary password:<br/> <br/><p> You can now use this as a temporary password:<br/>
<b id="short_url"> Wait </b></p> <b id="shorturl"> Wait </b></p>
<font size="1" color="Gray">
<p> Developer Reference:
<b id="url"> Wait </b></p><br/>
</font>
<br/><p> You can now use this URL as a temporary password:<br/>
<b id="url"> Wait </b></p>
<p> You can also download the <a id="url2" href="" > Wait for link </a> and save it to /tmp/samlup_uXXXX.encr</p> <p> You can also download the <a id="url2" href="" > Wait for link </a> and save it to /tmp/samlup_uXXXX.encr</p>
<p> You can also download the <a href="/sd/assertion.py">unencrypted assertion</a> and save it to /tmp/samlup_uXXXX</p> <p> You can also download the <a href="/sd/assertion.py">unencrypted assertion</a> and save it to /tmp/samlup_uXXXX</p>
<p> Replace XXXX with the UID on your client system</p> <p> Replace XXXX with the UID on your client system</p>
...@@ -111,14 +114,15 @@ def handler(req): ...@@ -111,14 +114,15 @@ def handler(req):
# create hash # create hash
assertion_hash = str(hashlib.md5(encrypted_assertion).hexdigest())[0:8] assertion_hash = str(hashlib.md5(encrypted_assertion).hexdigest())[0:8]
assertion_short_url = 'https://'+assertion_hash
assertion_url ='https://' + req.hostname + '/assertions/' + assertion_hash assertion_url ='https://' + req.hostname + '/assertions/' + assertion_hash
# Publish encrypted assertion on the web # Publish encrypted assertion on the web
write_var (req, encrypted_assertion, assertion_hash) write_var (req, encrypted_assertion, assertion_hash)
# return the url as key=value FIXME # return the url as key=value FIXME
req.write("url=%s" % assertion_url) req.write("&url=%s" % assertion_url)
req.write("short_url=%s" % 'https://'+assertion_hash) req.write("&shorturl=%s" % assertion_short_url)
#req.write("%s" % assertion_url) #req.write("%s" % assertion_url)
######### #########
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment