Skip to content

Commit

Permalink
API target/view show IP when always on machine
Browse files Browse the repository at this point in the history
  • Loading branch information
proditis committed Nov 28, 2024
1 parent 705899f commit f0d848f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend/modules/api/models/Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ public function afterFind()
if (Yii::$app->user->identity->instance)
$this->ip = long2ip(Yii::$app->user->identity->instance->ip);
else if($this->ondemand && $this->ondemand->state==1)
{
$this->ip = long2ip($this->ip);
}
else if($this->ondemand && $this->ondemand->state!=1)
$this->ip = long2ip(0);
else
$this->ip=0;
}
$this->ip=long2ip($this->ip);
}

}

0 comments on commit f0d848f

Please sign in to comment.