diff options
Diffstat (limited to 'django/srpproject/templates/register.html')
-rw-r--r-- | django/srpproject/templates/register.html | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/django/srpproject/templates/register.html b/django/srpproject/templates/register.html new file mode 100644 index 0000000..82ce61e --- /dev/null +++ b/django/srpproject/templates/register.html @@ -0,0 +1,42 @@ +<html> + <head> + <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> + <script type="text/javascript"> + function register() + { + if(document.getElementById("confirm_password").value != document.getElementById("srp_password").value) + alert("Passwords do not match"); + else if(document.getElementById("srp_password").value == "") + alert("Password cannot be blank"); + else + { + 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.register(); + } + return false; + }; + </script> + </head> + <body> + <form action="." onsubmit="return register()"> + <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> + <tr><td>Confirm:</td><td><input type="password" id="confirm_password" /></td></tr> + </table> + <input type="submit"/> + </form> + </body> +</html> |