Dennisra Posted January 10, 2006 Share Posted January 10, 2006 The following code is for the contact_us ip recorder contribution, Is there soneone who would be will to take a stab at modifing this code for create_account.php? That would be very useful if, for example, you have the "Log in for Prices" contribution. Surely if they knew their IP was being recorded there would be fewer fake accounts created. This is a quick way to mod the contact_us.php page to add the X-Originating-IP line to the email header so you can track back who sent the message. Edit catalog/contact_us.php find the line $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']); and add the line below just before it. $xipaddress = $HTTP_SERVER_VARS["REMOTE_ADDR"]; then find the line tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address); and change it to tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address, $xipaddress); now edit the file catalog/includes/functions/general.php find the line function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { and change it to function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $Xipaddress) { in the same file a few lines down change the line $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject); to $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject, 'X-Originating-IP: '.$Xipaddress); Quote Link to comment Share on other sites More sharing options...
Guest Posted February 8, 2006 Share Posted February 8, 2006 The following code is for the contact_us ip recorder contribution, Is there soneone who would be will to take a stab at modifing this code for create_account.php? That would be very useful if, for example, you have the "Log in for Prices" contribution. Surely if they knew their IP was being recorded there would be fewer fake accounts created. I believe your refering to this mod: http://www.oscommerce.com/community/contributions,3549 "Add X-Originating-IP to email headers" for the contact us page. However when I implemented it, there was errors being displayed from general.php when emails are sent after a customer makes a purchase, requests their password again amoungst other things. (It does what it's intented for the contact page, but broke others - emails are sent, they don't contain the users ip, and the return page shows the errors instead of the next page. BUT accounts are created, etc etc) ...... I hope that made sense ;) My general.php file is the same as that in the original for oscommerce-2.2ms2-051113 I've just directly PM'd cwispy regarding these as I have not seen any support forum for this contribution - until stumbling upon this request for modification. Getting back to your request, the start of the details are injected into the mail headers, however like my above seen issues, it does not actually populate the users ip into the field. X-Originating-IP: Example from the mail headers: Return-Path: <nobody@[your web server]> Received: from [your web server] ([your web server] [web server ip]) by [another mail server] with ESMTP id [mail server id] (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for <[customers email address]>; Wed, 8 Feb 2006 19:30:16 +1100 Received: from nobody by [your web server] with local (Exim 4.52) id [server id] for [customers email address]; Wed, 08 Feb 2006 19:30:11 +1100 To: [customers email address] Subject: Welcome to [store name] From: [store email address] MIME-Version: 1.0 X-Mailer: osCommerce Mailer Content-Type: multipart/alternative; boundary="=_ae63cf66ac1100c0d8f578064bec905c" X-Originating-IP: Message-Id: <[id]@[your web server]> Date: Wed, 08 Feb 2006 19:30:11 +1100 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - [your web server] X-AntiAbuse: Original Domain - [customers mail domain] X-AntiAbuse: Originator/Caller UID/GID - [99 503] / [47 12] X-AntiAbuse: Sender Address Domain - [your web server] X-Source: X-Source-Args: /usr/local/apache/bin/httpd -DSSL X-Source-Dir: [your domain name]:/public_html/store I've tried to add things here and there in the general file to get it working, however I'm a newbie when it comes to PHP. Anyone else seen similar issues with this mod, or able to offer assistance? Thanks. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 8, 2006 Share Posted February 8, 2006 Oh yeah - the above is the email headers the new customer would receive when registering. Here is what the store owner would receive: Return-path: <nobody@[your web server]> Envelope-to: [store email address] Delivery-date: Wed, 08 Feb 2006 19:30:11 +1100 Received: from nobody by [your web server] with local (Exim 4.52) id [server id] for [store email address]; Wed, 08 Feb 2006 19:30:11 +1100 To: [store email address] Subject: New User Registration: [store name] From: [customers email address] MIME-Version: 1.0 X-Mailer: osCommerce Mailer Content-Type: multipart/alternative; boundary="=_3e7bbe85c3f700701afc5e3079dc7e9b" X-Originating-IP: Message-Id: <[id]@[your web server]> Date: Wed, 08 Feb 2006 19:30:11 +1100 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 8, 2006 Share Posted February 8, 2006 The following code is for the contact_us ip recorder contribution, Is there soneone who would be will to take a stab at modifing this code for create_account.php? That would be very useful if, for example, you have the "Log in for Prices" contribution. Surely if they knew their IP was being recorded there would be fewer fake accounts created. I forgot about this other mod I installed until trying to work on your request and get the mod working properly... "Automatic Notify Owner Via E-mail Of New Accounts" - it includes sending the users IP when the account is created. http://www.oscommerce.com/community/contributions,3414 Regards Shane Quote Link to comment Share on other sites More sharing options...
Guest Posted February 8, 2006 Share Posted February 8, 2006 I forgot about this other mod I installed until trying to work on your request and get the mod working properly... "Automatic Notify Owner Via E-mail Of New Accounts" - it includes sending the users IP when the account is created. http://www.oscommerce.com/community/contributions,3414 Regards Shane grrr, Sorry. to much looking at code whilst doing other work.. I use html emails to be sent out, so I added this little bit also when modifying create_account: After you have updated create_account.php Look for: '<td width="20%"><b>' . EMAIL_NEW_CLIENT_COUNTRY . '</b></td><td width="80%">' . $country_name . "</td>" and add this below it: '<td width="20%"><b>' . IP_ADDRESS . '</b></td><td width="80%">' . $HTTP_SERVER_VARS["REMOTE_ADDR"] . "</td>" . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.