diff options
Diffstat (limited to 'plugins/Live/Visitor.php')
-rw-r--r-- | plugins/Live/Visitor.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php index b03d37e650..d9bb556efd 100644 --- a/plugins/Live/Visitor.php +++ b/plugins/Live/Visitor.php @@ -39,6 +39,7 @@ class Visitor implements VisitorInterface 'idSite' => $this->getIdSite(), 'idVisit' => $this->getIdVisit(), 'visitIp' => $this->getIp(), + 'userId' => $this->getUserId(), 'visitorId' => $this->getVisitorId(), // => false are placeholders to be filled in API later @@ -84,6 +85,15 @@ class Visitor implements VisitorInterface return false; } + function getUserId() + { + if (isset($this->details['user_id']) + && !is_null($this->details['user_id'])) { + return $this->details['user_id']; + } + return false; + } + function getVisitServerHour() { return date('G', strtotime($this->details['visit_last_action_time'])); @@ -134,6 +144,7 @@ class Visitor implements VisitorInterface $toUnset = array('config_id'); if (Piwik::isUserIsAnonymous()) { $toUnset[] = 'idvisitor'; + $toUnset[] = 'user_id'; $toUnset[] = 'location_ip'; } foreach ($toUnset as $keyName) { |