mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Issue #4757 - Make IP readable in email notification on user_changed_ip trigger.
This commit is contained in:
@@ -2136,24 +2136,25 @@ class e_user extends e_user_model
|
|||||||
// Don't update if main admin is logged in as current (non main admin) user
|
// Don't update if main admin is logged in as current (non main admin) user
|
||||||
if(!$this->getParentId())
|
if(!$this->getParentId())
|
||||||
{
|
{
|
||||||
|
$iph = e107::getIPHandler();
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$this->set('last_ip', $this->get('user_ip'));
|
$this->set('last_ip', $this->get('user_ip'));
|
||||||
$current_ip = e107::getIPHandler()->getIP();
|
$current_ip = $iph->getIP();
|
||||||
$update_ip = '';
|
$update_ip = '';
|
||||||
$edata = [];
|
$edata = [];
|
||||||
|
|
||||||
if($this->get('user_ip') != $current_ip)
|
if($this->get('user_ip') != $current_ip)
|
||||||
{
|
{
|
||||||
|
$old_ip = (string) $this->get('user_ip');
|
||||||
$update_ip = ", user_ip = '".$current_ip."'";
|
$update_ip = ", user_ip = '".$current_ip."'";
|
||||||
$edata = [
|
$edata = [
|
||||||
'old_ip' => $this->get('user_ip'),
|
'old_ip' => $iph->ipDecode($old_ip),
|
||||||
'new_ip' => $current_ip,
|
'new_ip' => $iph->ipDecode($current_ip),
|
||||||
'time' => date('c'),
|
'time' => date('c'),
|
||||||
'user_id' => $this->getId(),
|
'user_id' => $this->getId(),
|
||||||
'user_name' => $this->get('user_name'),
|
'user_name' => $this->get('user_name'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->set('user_ip', $current_ip);
|
$this->set('user_ip', $current_ip);
|
||||||
|
Reference in New Issue
Block a user