Salve a tutti, mi rivolgo a questa sezione poiche' ho urgente bisogno di modificare uno scritto in CGI-Perl e non essendo propio qualificato per farlo ho gia' fatto un miracolo nel seguente:

Avrei bisogno di aggiungere il Numero di IP dal quale l'utente esegue la registrazione almeno sulla email di avviso di avvenuta registrazione. tale e' stata da me creata studiando passo passo l'iter dello scritto e con mia Enorme soddisfazione il tutto e' andato a buon fine, purtroppo la societa' che mi ha venduto lo script ha cambiato ragione sociale e mi hanno gia' dato buca su mia richiesta di aggiornamento dello stesso, lo script e' molto povero in sicurezza ed io mi ritrovo ad avere un SOB (son of a bitch) che mi sta' rompendo i zebedei con iscrizioni fasulle e' la cosa comincia ad innervosirmi, tramite il pannello di controllo Cpanel posso identificare chi esegue lo script ed il suo IP ma non riesco propio a fermarlo, se solo potessi averlo scritto su registrazione potrei deferirlo al provider x abuso..insomma perdonatemi la lungaggine ed ecco lo script al quale sto facendo riferimento:

#!/usr/bin/perl
use strict;
use warnings;
use lib 'modules';
use conf;
################################################## ###########################

################################################## ###########################

require "lib/passwordsystem.cgi";

use CGI qw(param);
my $user = param("user");
my $add1 = param("add1");
my $add2 = param("add2");
my $homephone = param("homephone");
my $bizphone = param("bizphone");
my $email = param("email");
my $name = param("name");
my $country = param("country");
my $zip = param("zip");
my $state = param("state");
my $city = param("city");
my $goto = param("goto");
my $palemail = param("palemail");
my $bizname = param("bizname");
my $bizdesc = param("bizdesc");


my $complete = param("complete");
my $theme = param("theme");
if ($theme eq "") { $theme = "$Conf{'theme'}"; }

my @bannerfile = ();
my @bannerfilebot = ();
my $signuptemplate = "";
my $encryptkey = "keyencrypt";
print "Content-type:text/html\n\n";

&globalh;

if ($user eq "") {

$signuptemplate .= <<EOL;
<form name="formcheck" onsubmit="return formCheck(this);">
<input type=hidden name=complete value=1>
<div align='center'><center><table border='0' width='100%'>
<tr>
<td width='40%' align='right'>Username<font color="#FF0000">*</font>: </td><td width='60%'><input type='text' name='user' size='20' maxlength="200"></td></tr>
<tr>
<td width='40%' align='right'>Full Name<font color="#FF0000">*</font>: </td><td width='60%'><input type='text' name='name' size='50' maxlength="200"></td></tr>
<tr>
<td align='right'>Business Name<font color="#FF0000">*</font></td>
<td width='60%'><input type='text' name='bizname' size='50' maxlength="100"></td>
</tr>
<tr><td width='40%' align='right'>Street Address: </td><td width='60%'><input type='text' name='add1' size='32' maxlength="60"></td></tr>
<tr><td width='40%' align='right'> </td><td width='60%'><input type='text' name='add2' size='32' maxlength="60"></td></tr>
<tr><td width='40%' align='right'>City: </td><td width='60%'><input type='text' name='city' size='16' maxlength="18"></td></tr>
<tr><td width='40%' align='right'>State/Province: </td><td width='60%'><input type='text' name='state' size='16' maxlength="60"></td></tr>
<tr>
<td width='40%' align='right'>Zip / Postcode: </td><td width='60%'><input type='text' name='zip' size='6' maxlength="10"></td></tr>
<tr><td width='40%' align='right'>Country: </td><td width='60%'><input type='text' name='country' size='16' maxlength="200"></td></tr>
<tr><td width='40%' align='right'>Home Phone: </td><td width='60%'><input type='text' name='homephone' size='16' maxlength="20"></td></tr>
<tr>
<td width='40%' align='right'>Email Address<font color="#FF0000">*</font>: </td><td width='60%'><input type='text' name='email' size='20' maxlength="200"></td></tr>
<tr>
<td width='40%' align='right'>Alternative Email Address: </td>
<td width='60%'><input type='text' name='palemail' size='20' maxlength="200"></td></tr>
<tr>
<td width='40%' align='right'>Short Business Description: </td><td width='60%'><input type='text' name='bizdesc' size='60' maxlength="200"></td></tr>
<tr>
<td width='40%' align='right'>Business Phone N.: </td><td width='60%'><input type='text' name='bizphone' size='16' maxlength="15"></td></tr>
<tr><td width='40%' align='right'> </td><td width='60%'><input type='submit' onClick="return checkmail(this.form.email)" value='Submit'></td></tr>
</table>
</form>
EOL

my @ADVANCED = template::load("$Conf{'templatepath'}/$theme/signup_form");
my $STEMPLATE = join ('', @ADVANCED);
$STEMPLATE =~ s/<module:cgiurl>/$Conf{'cgiurl'}/g;
$STEMPLATE =~ s/<module:searchurl>/$Conf{'searchurl'}/g;
$STEMPLATE =~ s/<module:form>/$signuptemplate/g;
$STEMPLATE =~ s/<module:imageurl>/$Conf{'imgdir'}\/$theme/g;
$STEMPLATE =~ s/<module:maintitle>/$Conf{'title'}/g;
$STEMPLATE =~ s/<module:topbar>/$Conf{'topbar'}/g;
$STEMPLATE =~ s/<module:bgbox>/$Conf{'bgbox'}/g;
print "$STEMPLATE";

&globalf;

exit;
}

if ($complete eq "1") {
my $STEMPLATE ="";
$user =~ tr/A-Z/a-z/;

if ($user =~ / /i) {
print
"<CENTER><font size=3>Your username cannot contain any spaces.</font></CENTER>";
print "$STEMPLATE";
exit;
}
if (advertisers::username_exists($db, $user)) {
print
"<CENTER><font size=3>The username you chose is already taken, please choose a different one.</font></CENTER>";
print "$STEMPLATE";
exit;
}
if (advertisers::email_exists($db, $email)) {
print
"<CENTER><font size=3>The e-mail address: $email is already being used by a current member.</font></CENTER>";
exit;
}

my ($second, $minute, $hour, $dm, $month, $year, $weekday, $dayofyear, $isdst) = localtime(time);
my $rmonth = $month + 1;
$year = reverse $year;
chop($year);
$year = reverse $year;
$year = "20$year";
my $rmonth2 = $rmonth;
chop($rmonth2);
if ($rmonth2 eq "") { $rmonth = "0$rmonth"; }
my $dm2 = $dm;
chop($dm2);
if ($dm2 eq "") { $dm = "0$dm"; }

my $thepassnumber = "$dm$minute$second$year";
$thepassnumber = &Encrypt($thepassnumber, $encryptkey, 'asdfhzxcvnmpoiyk');
my $mypass = "$thepassnumber";


advertisers::create($db, {
'username' => $user,
'passwd' => $mypass,
'balance' => $Conf{'sbalance'},
'fullName' => $name,
'streetAddress1' => $add1,
'streetAddress2' => $add2,
'city' => $city,
'region' => $state,
'zip' => $zip,
'country' => $country,
'homePhone' => $homephone,
'workPhone' => $bizphone,
'email' => $email,
'palemail' => $palemail,
'bizname' => $bizname,
'bizdesc' => $bizdesc,
});

my $subject = "Account Creation";
###questa e' la parte da me creata x ottenere una email di notifica##
my $subject2="Signup Submitted";
###############################################
my @emailmessage = template::load("$Conf{'templatepath'}/$theme/email_signup_complete");
mailprog::sending3($Conf{'mailprog'}, $email, $Conf{'youremail'}, $Conf{'title'}, $thepassnumber, $subject, $user, @emailmessage );

##variabili spedite nella notifica##
mailprog::sending4($Conf{'mailprog'}, $email, $Conf{'youremail'}, $Conf{'title'}, $subject2);
################################################## ###########

if ($Conf{'collectemail'} eq "1") {
emails::add($db, $email);
}


my @COMPLETE = template::load("$Conf{'templatepath'}/$theme/signup_complete");
my $STEMPLATE = join ('', @COMPLETE);
$STEMPLATE =~ s/<module:cgiurl>/$Conf{'cgiurl'}/g;
$STEMPLATE =~ s/<module:searchurl>/$Conf{'searchurl'}/g;
$STEMPLATE =~ s/<module:form>/$signuptemplate/g;
$STEMPLATE =~ s/<module:imageurl>/$Conf{'imgdir'}\/$theme/g;
$STEMPLATE =~ s/<module:topbanner>/@bannerfile/g;
$STEMPLATE =~ s/<module:bottombanner>/@bannerfilebot/g;
$STEMPLATE =~ s/<module:maintitle>/$Conf{'title'}/g;
$STEMPLATE =~ s/<module:topbar>/$Conf{'topbar'}/g;
$STEMPLATE =~ s/<module:bgbox>/$Conf{'bgbox'}/g;
print "$STEMPLATE";

&globalf;

}

sub globalh {

my @globalh = template::load("$Conf{'templatepath'}/$theme/global_header_signup");
my $SITETEMPLATEgh = join ('', @globalh);
$SITETEMPLATEgh =~ s/<module:cgiurl>/$Conf{'cgiurl'}/g;
$SITETEMPLATEgh =~ s/<module:searchurl>/$Conf{'searchurl'}/g;
$SITETEMPLATEgh =~ s/<module:imageurl>/$Conf{'imgdir'}\/$theme/g;
$SITETEMPLATEgh =~ s/<module:maintitle>/$Conf{'title'}/g;
$SITETEMPLATEgh =~ s/<module:topbar>/$Conf{'topbar'}/g;
$SITETEMPLATEgh =~ s/<module:bgbox>/$Conf{'bgbox'}/g;
print "$SITETEMPLATEgh";

}

sub globalf {

my @globalf = template::load("$Conf{'templatepath'}/$theme/global_footer_signup");
my $SITETEMPLATEgf = join ('', @globalf);
$SITETEMPLATEgf =~ s/<module:cgiurl>/$Conf{'cgiurl'}/g;
$SITETEMPLATEgf =~ s/<module:searchurl>/$Conf{'searchurl'}/g;
$SITETEMPLATEgf =~ s/<module:imageurl>/$Conf{'imgdir'}\/$theme/g;
$SITETEMPLATEgf =~ s/<module:maintitle>/$Conf{'title'}/g;
$SITETEMPLATEgf =~ s/<module:topbar>/$Conf{'topbar'}/g;
$SITETEMPLATEgf =~ s/<module:bgbox>/$Conf{'bgbox'}/g;
print "$SITETEMPLATEgf";

}

spero sia sufficente x una modifica almeno che' non stia omettendo una parte della routine considerato che il tutto e' diviso a moduli come ben potete immaginare.

Confido nella vostra professionalita'

Grazie