Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: msg_raw_ip & msg_hdr_ip  (Read 3473 times)

0 Members and 1 Guest are viewing this topic.

boii

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
msg_raw_ip & msg_hdr_ip
« on: October 16, 2003, 04:04:42 am »

are these two columns/variables supposed to both be the ip address of the user who posted the comment. during a comment addition, both get stored in the db as the ip address. (i was wodnering if one was supposed to be the hostname).

my table still has the fields for user_host (and user_agent) on comment postings, (and i've modified the code accordingly), and the getenv(USER_HOST) works. so i was just wondering if both fields were supposed to be the ip, and if so, why double it up? :)

(i'm only assuming one is supposed to be the hostname becasue when viewing a comment its form is (x.x.x.x[x.x.x.x]). (by the way, anyoen want the simple mod of also seeing the ip/host in the admin review comments section?

cheers.
ken
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
msg_raw_ip & msg_hdr_ip
« Reply #1 on: October 16, 2003, 04:07:21 am »

Yes both are IP addresses
Logged
SANIsoft PHP applications for E Biz

boii

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
msg_raw_ip & msg_hdr_ip
« Reply #2 on: October 16, 2003, 04:19:48 am »

okay in that case.
if anyone is interested in also having a hostname field, i liek to give a quick glance so i can see where the user posted from (ratehr then doing nslookups on each ip).. [i know hostanmes can be spoofed, but youd have to be a real _____ to spoof a hostname on a image gallery :P], then here's the mod to support it (i also threw user_agent in there, just becasue!).

in db_input.php, add:
Code: [Select]

        $user_host = getenv ("REMOTE_HOST");
        $user_agent = getenv ("HTTP_USER_AGENT");

under the     case 'comment': block with the other variables.

and then, in the same file, find the two lines:
Code: [Select]

if (!USER_ID) { // Anonymous users, we need to use META refresh to save the cookie
} else { // Registered users, we can use Location to redirect

and edit the input statements below them to add:
, user_host, user_agent,        and   '$user_host','$user_agent'
where appropriate.

then in reviewcom.php where i put it, find the line in commented code comment it out and change to:

Code: [Select]
                       <!-- <td><b>{$row['msg_author']}</b> - {$msg_date}</td> -->
                        <td><b>{$row['msg_author']}</b> - {$msg_date} : {$row['user_host']}</td>


oh and above it add user_host to the db select query.

cheers.
ken

ps: make sure you add user_host and user_agent columsn to the comments table in the db, and i look at the user_agents in the db, but you can always add it as above to the reviewcom page
Logged

lasa

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
    • Fotos.LaSa.nl
msg_raw_ip & msg_hdr_ip
« Reply #3 on: October 19, 2003, 06:14:57 pm »

Maybe you could also make some mysql/php code, that it makes the columns....
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 21 queries.