Post by Moose on Feb 2, 2006 14:46:37 GMT -8
Cross Browser
This will add a link in your profile to an area where you can generate 12 character long passwords. If that amount is too long for you just copy and paste the amount of characters you want. Enjoy.
Main Footer:
This will add a link in your profile to an area where you can generate 12 character long passwords. If that amount is too long for you just copy and paste the amount of characters you want. Enjoy.
Main Footer:
<script type="text/javascript">
<!--
/*
Random Password Generator In Profile
Coded By Moose
Don't repost or edit without permission
Main Footer
*/
var regletts = new Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
if(location.href.match(/action=viewprofile$/) || location.href.match(new RegExp('action=viewprofile&user='+pb_username+'$'))){
var link = document.getElementsByTagName('a');
for(l=0;l<link.length;l++){
if(link[l].href.match(/modifyprofile/)){
link[l].parentNode.innerHTML += ' - <a href="/index.cgi?action=generatepassword">Generate Random Password</a>';
}}}
if(location.href.match(/action=generatepassword/)){
var ititlesplit = document.title.split("-")[0];
document.title = document.title.split("-")[0] + '- Generate Random Password';
var table = document.getElementsByTagName('table');
var navtree = '<center><table width="92%" cellspacing="0" cellpadding="0" align="center"><tr><td valign="top" width="100%"><a href="/index.cgi" class="nav">'+ititlesplit+'</a> :: Generate Random Password<br />';
for(i=4;i<table.length;i++){
table[i].style.display="none";
}
document.write(navtree+'<table border="0" width="75%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td width="100%" class="titlebg"><font size="2"><b>Generate Random Password</b></font></td></tr><tr><td width="100%" class="windowbg"><font size="2">Here you can generate a random password. Simply click the generate password button and you will recieve a random 12 character password in the input box next to the generate password button.<br /><br /><input type="text" size="30" id="passarea" /> <input type="submit" value="Generate Password" onClick="genpass()" /></font></td></tr></table></td></tr></table></center><br /><br />');
var mempass = '';
function genpass(){
mempass = '';
for(p=0;p<12;p++){
var lettype = Math.floor(Math.random()*3);
if(lettype == 0){
var lowlet = Math.floor(Math.random()*25);
lowlet = regletts[lowlet];
mempass += lowlet;
} else if(lettype == 1){
var highlet = Math.floor(Math.random()*25);
highlet = regletts[highlet];
highlet = highlet.toUpperCase();
mempass += highlet;
} else if(lettype == 2){
var numo = Math.floor(Math.random()*10);
mempass += numo;
}}
var passarea = document.getElementById('passarea');
passarea.value = mempass;
}}
//-->
</script>