0
在ITOP,这怎么可能保存在门票调用者的IP地址(用户请求和事件)ITOP - 获取调用者的IP车票
我试图修改datamodel.itop-tickets.xml在我的推广模块。我添加了一个名为'ip'的字段,但在<methods>
部分我无法使用$_SERVER['REMOTE_ADDR']
获取客户端的IP。
<methods>
<method id="DBInsertNoReload" _delta="redefine">
<static>false</static>
<access>public</access>
<type>Overload-DBObject</type>
<code><![CDATA[
public function DBInsertNoReload()
{
$oMutex = new iTopMutex('ticket_insert');
$oMutex->Lock();
$iNextId = MetaModel::GetNextKey(get_class($this));
$sRef = $this->MakeTicketRef($iNextId);
$this->Set('ref', $sRef);
$iKey = parent::DBInsertNoReload();
$oMutex->Unlock();
return $iKey;
$this->Set('ip', $_SERVER['REMOTE_ADDR']);
}
]]></code>
</method>
</methods>