diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2013-02-27 15:44:02 -0800 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2013-02-27 15:44:02 -0800 |
| commit | 942431fdcb3803b7ef98b1be8c4dc188e1a4b5aa (patch) | |
| tree | b345a97d01160f70234002ac3d88dae02da51e37 /httemplate/elements/random_pass.html | |
| parent | 52e23dfa86b11c17903952a99f87893ef09db743 (diff) | |
| parent | 2920cfc494c2811ca7879d6ecaa353d216c9f69d (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements/random_pass.html')
| -rw-r--r-- | httemplate/elements/random_pass.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/httemplate/elements/random_pass.html b/httemplate/elements/random_pass.html new file mode 100644 index 000000000..b215b77d9 --- /dev/null +++ b/httemplate/elements/random_pass.html @@ -0,0 +1,17 @@ +<INPUT TYPE="button" VALUE="<% emt($label) %>" onclick="randomPass()"> +<SCRIPT TYPE="text/javascript"> +function randomPass() { + var i=0; + var pw_set='<% join('', 'a'..'z', 'A'..'Z', '0'..'9' ) %>'; + var pass=''; + while(i < 8) { + i++; + pass += pw_set.charAt(Math.floor(Math.random() * pw_set.length)); + } + document.getElementById('<% $id %>').value = pass; +} +</SCRIPT> +<%init> +my $id = shift; +my $label = shift || 'Generate'; +</%init> |
