Ejemplo n.º 1
0
 public function log()
 {
     if ($this->getCurrentOptionValue()) {
         $uri = $this->getFullActionName();
         $log = new Core_Model_Log();
         $detect = new Mobile_Detect();
         $host = !empty($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : '';
         $user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
         $other = array('user_agent' => $user_agent, 'host' => $host);
         if ($this->getSession()->getCustomerId()) {
             $log->setCustomerId($this->getSession()->getCustomerId());
         }
         $log->setUri($uri)->setDeviceName($detect->getDeviceName())->setOther(serialize($other))->save();
     }
     return $this;
 }
Ejemplo n.º 2
0
 protected function _log()
 {
     if ($this->getRequest()->isGet() && $this->getFullActionName("/") == "front/mobile/backgroundimage" && $this->getDevice()->isNative()) {
         $log = new Core_Model_Log();
         $detect = new Mobile_Detect();
         $host = !empty($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : '';
         $user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
         $other = array('user_agent' => $user_agent, 'host' => $host);
         $value_id = $this->getCurrentOptionValue()->getId() | 0;
         if ($this->getSession()->getCustomerId()) {
             $log->setCustomerId($this->getSession()->getCustomerId());
         }
         $log->setCustomerId($this->getSession()->getCustomerId())->setAppId($this->getApplication()->getId())->setValueId($value_id)->setDeviceName($detect->getDeviceName())->setOther(serialize($other))->save();
     }
     return $this;
 }