From 93922335ad6e80fa5ba6d887031841c2a91334b7 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Mon, 16 Mar 2015 18:06:20 -0500
Subject: [PATCH] thread: Log remote IP for staff replies and notes

---
 include/class.ticket.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index e7546870e..35e624753 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -1823,6 +1823,9 @@ class Ticket {
         if(!$vars['staffId'] && $thisstaff)
             $vars['staffId'] = $thisstaff->getId();
 
+        if (!$vars['ip_address'] && $_SERVER['REMOTE_ADDR'])
+            $vars['ip_address'] = $_SERVER['REMOTE_ADDR'];
+
         if(!($response = $this->getThread()->addResponse($vars, $errors)))
             return null;
 
@@ -1942,6 +1945,8 @@ class Ticket {
         }elseif($poster) { //string
             $vars['poster'] = $poster;
         }
+        if (!$vars['ip_address'] && $_SERVER['REMOTE_ADDR'])
+            $vars['ip_address'] = $_SERVER['REMOTE_ADDR'];
 
         if(!($note=$this->getThread()->addNote($vars, $errors)))
             return null;
-- 
GitLab