[HACK] - Notifica email se qualcuno cerca di entrare nell'AdminCP o ModCP
Ho modificato QUESTO hack...
Portato in italiano...modificato per inviare email in html...aggiunto link per whois ip...aggiunto link per profilo utente...
Nel file login.php, trova:
Codice:
$strikes = verify_strike_status($vbulletin->GPC['vb_login_username']);
SOTTO aggiungi:
Codice:
$username = $vbulletin->GPC['vb_login_username'];
$fdate = date('d-m-Y');
$ftime = date('H:i:s');
$fdatetime = "<b>Data&Ora</b>: $fdate alle $ftime <br>";
$fscriptpath = "<b>Script:</b> <a href=\"http://$_SERVER[HTTP_HOST]" . SCRIPTPATH . "\"><font color=#000000>http://$_SERVER[HTTP_HOST]" . SCRIPTPATH . "</font></a><br>";
$freferer = "<b>Pagina</b>: <a href=\"" . REFERRER . "\"><font color=#000000>" . REFERRER . "</font></a><br>";
$fusername = "<b>Username tentato</b>: $username <br>";
$fipaddress = "<b>Indirizzo IP</b>: <a href=\"http://www.ip-adress.com/whois/" . IPADDRESS . "\"><font color=#000000>" . IPADDRESS . "</font></a><br>";
$iphostname = "<b>Host</b>: " . @gethostbyaddr(IPADDRESS) . "<br>";
if ($vbulletin->userinfo['userid'] > 0)
{
$realname = "<br><b><font color=#ff0000>UTENTE IDENTIFICATO</font></b>: " . $vbulletin->options['bbtitle'] . " ha identificato che il soggetto è un utente registrato, username: <b><i><a href=" . $vbulletin->options['bburl'] . "/member.php?u=" . $vbulletin->userinfo['userid'] . "><font color=#000000>" . $vbulletin->userinfo['username'] . "</font></a></i></b>";
}
Sempre nel file login.php, trova:
Codice:
// log this error if attempting to access the control panel
require_once(DIR . '/includes/functions_log_error.php');
e SOTTO aggiungi:
Codice:
if ($GLOBALS[strikes]===1)
{
$fstrk = "<b>Tentativo</b>: $GLOBALS[strikes] fallito di 5<br>";
}
else
{
$fstrk = "<b>Tentativi</b>: $GLOBALS[strikes] falliti di 5<br>";
}
if ($vbulletin->GPC['logintype'] === 'cplogin')
{
$subject= 'ATTENZIONE: accesso fallito nel Admin Pannel - ' . $vbulletin->db->appname . ' ' . $vbulletin->options['templateversion'] . "\r\n\r\n";
$message="<i>Qualcuno ha provato ad accedere a " . $vbulletin->options['bbtitle'] . " - Admin CP!</i><br><br>$fusername$fipaddress$iphostname$fstrk$freferer$fscriptpath$fdatetime$realname";
}
else
{
$subject= 'ATTENZIONE: accesso fallito nel Mod Pannel - ' . $vbulletin->db->appname . ' ' . $vbulletin->options['templateversion'] . "\r\n\r\n";
$message="Qualcuno ha provato ad accedere alla community " . $vbulletin->options['bbtitle'] . " - Mod CP!<br><br>$fusername$fipaddress$iphostname$fstrk$freferer$fscriptpath$fdatetime$realname";
}
$intestazione = "From: " . $vbulletin->options['bbtitle'] . " <" . $vbulletin->options['webmasteremail'] . ">\n";
$intestazione .= "MIME-Version: 1.0\n";
$intestazione .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$intestazione .= "Content-Transfer-Encoding: 7bit\n\n";
$messaggio = "<html><body><FONT face=Arial size=2>" . $message . "</font></body></html>";
//invio email in html
mail($vbulletin->options['webmasteremail'],$subject,$messaggio,$intestazione);
Provato e funziona tutto...