I didn't really know what else to title this post... BUT....
Have you ever wanted to provide your users with a random default password? Or how about giving them the option of resetting their password instead of giving it back to them or letting them log in? Or have it possible for them to create a random password until they can think of one for themselves? Well... Here is ZEDPASS! It will generate any password of any lengths(of at least 7 characters and no more than 75 characters). I think that if it were to be included in the core, then it could be left up to modders to come up with their own ways to use it.
Well, here's the code:
<?php
// Code by KaosKaizer, aka Douglas, of Kaizer iTek
function zedpass($strlen=7,$nums=false,$caps=true){
if ($strlen < 7) $strlen = 7; // set the default as the lowest accepted length
if ($strlen > 75) $strlen = 75; // do not allow the length to exceed 75
$low = "abcdefghijklmnopqrstuvwxyz";
$cap = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$num = "0123456789";
$fin = $low;
if ($caps === true) $fin .= $cap;
if ($nums === true) $fin .= $num;
$password = "";
for ($i=0; $i < $strlen; $i++){
$password .= $fin[rand(0,strlen($fin))];
}
return $password;
}
?>