summaryrefslogtreecommitdiff
path: root/django/srpproject/templates/login.html
blob: 9de4268792a4fcd91829e6415d155d5dc43af53b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
 <head>

{% comment %}    <script src="{{ static_files }}/SHA256.js"></script>
    <script src="{{ static_files }}/prng4.js"></script>
    <script src="{{ static_files }}/rng.js"></script>
    <script src="{{ static_files }}/jsbn.js"></script>
    <script src="{{ static_files }}/jsbn2.js"></script>
    <script src="{{ static_files }}/srp.js"></script>
{% endcomment %}
    <script src="{{ static_files }}/jsPacker/srp.min.js"></script>

    <script type="text/javascript">
    function login()
    {
        var username = document.getElementById("srp_username").value;
        var password = document.getElementById("srp_password").value;
        var url = window.location.protocol+"//"+window.location.host+"/srp/";
        srp = new SRP(username, password, "django", url);
        srp.success = function()
        {
            alert("We win");
        };
        srp.identify();
        return false;
    }
    </script>
 </head>
 <body>
    <form action="." onsubmit="return login()">
    <table>
    <tr><td>Username:</td><td><input type="text" id="srp_username" /></td></tr>
    <tr><td>Password:</td><td><input type="password" id="srp_password" /></td></tr>
    </table>
    <input type="submit"/>
    </form>
 </body>
</html>