automatic passwordgeneration
ispman-gX/[email protected]
| Newsgroups | gmane.comp.isp.ispman.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
a little patch für users/add.tmpl to generate a sample password if you
add a user.
##########################
*** add.tmpl Sun Mar 27 22:29:35 2005
--- add.tmpl.orig Sun Mar 27 22:32:28 2005
***************
*** 40,64 ****
<tr>
<td>Password </td>
<td>
! <input size=35 type=text name=userPassword
! <perl>
! my $crypted;
! my $crypted1="value='";
! for ($x=0;$x<8;$x++) {
! $crypted = rand(90);
! $crypted = sprintf("\%d", $crypted);
! if ($crypted < 65) {
! $crypted = rand(9)+1;
! $crypted = sprintf("\%d", $crypted);
! $crypted1 .= $crypted;
! } else {
! $crypted = sprintf("\%c", $crypted);
! $crypted1 .= $crypted;
! }
! }
! # $crypted1 =~ tr/A-Z/a-z/;
! $crypted1.="'>";
! </perl> </td>
</tr>
<tr>
--- 40,47 ----
<tr>
<td>Password </td>
<td>
! <input size=35 type=text name=userPassword value="">
! </td>
</tr>
<tr>
###################
--
Regards,
michael
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click