The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need a small modification in this code
The below code sends email to admin when failed login attempt but i am using cloudfare so ia m always getting cloudfare ip . can some one please change the code to get the real ip address of the hacker who tried to login into my account thanku.I am already did these changes
https://support.cloudflare.com/hc/en...ith-vBulletin- But its not working of the plugins i think we need a permanent solution. Code:
/* By : Ali Madkour WebSite : http://www.masrawycafe.com/vb/ Contact me @ : http://www.masrawycafe.com/vb/sendmessage.php?langid=1 */ if($vbulletin->options['madkour_admin_login_fail_onoff']) { $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $user_ip = $_SERVER['REMOTE_ADDR']; $madkour_admins = split(',', $vbulletin->options['madkour_admins']); if (in_array($_POST["vb_login_username"], $madkour_admins)) { $Madkour_TO = $vbulletin->options['madkour_admin_login_fail_adminmail']; $message = " Hello <br> Someone try to login at " . $vbulletin->options['bbtitle'] ."<br> username : " . $_POST["vb_login_username"] . " <br> from IP : " . $user_ip . "<br> Referer : " . $referer ."<br>". $_SERVER['HTTP_USER_AGENT']; $subject = "Login failure at - " . $vbulletin->options['bbtitle']; $from_mail = $vbulletin->options['webmasteremail']; $name = "Login failure Notification"; $mail_headers .= "Content-Type: text/html; charset=\"" . $vbulletin->options['madkour_admin_login_fail_encode'] . "\"\r\n"; $mail_headers .= "From: ". $name ."<" . $from_mail . ">" . "\r\n"; mail($Madkour_TO, $subject, $message, $mail_headers); if($vbulletin->options['madkour_admin_login_fail_errormsg'] != '') { standard_error($vbulletin->options['madkour_admin_login_fail_errormsg']); } } } |
#2
|
||||
|
||||
You can't change the code to accomplish what you want, you need to change your cloudfare setting to pass through the originating IP instead of cloudfare's IPs.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|