Esempio n. 1
0
 /**
  * @return \GeoIp2\Model\City|bool
  */
 public function getCity()
 {
     try {
         $ip = $this->httpRequest->getClientIp();
         $city = $this->getReader()->city($ip);
     } catch (\Exception $e) {
         $this->logger->critical($e);
         $city = false;
     }
     return $city;
 }
Esempio n. 2
0
 /**
  * get user code.
  *
  * @param mixed $id
  *
  * @return string
  */
 protected function getUserCode($id)
 {
     $ipAddress = $this->_phpEnvironmentRequest->getClientIp(true);
     $cookiefrontend = $this->_cookieManager->getCookie('frontend');
     $usercode = $ipAddress . $cookiefrontend . $id;
     return md5($usercode);
 }