コード例 #1
0
 function insertHeatmapClick($uri2titleId, $x, $y, $w, $h, $xpath)
 {
     $ip = ExtraWatchInput::validate(_EW_INPUT_IP, ExtraWatchVisit::getRemoteIPAddress());
     ///
     $username = @$this->config->env->getUsername();
     if ($this->config->isIgnored('IP', $ip) || $this->config->isIgnored('USER', $username)) {
         return FALSE;
     }
     $day = $this->date->jwDateToday();
     $timestamp = $this->date->getUTCTimestamp();
     $query = sprintf("INSERT INTO #__extrawatch_heatmap (`uri2titleId`, `x`, `y`, `w`, `h`, `ip`, `day`, `timestamp`, `xpath`) values ('%d','%d','%d','%d','%d','%s','%d','%d','%s')", (int) $uri2titleId, (int) $x, (int) $y, (int) $w, (int) $h, $this->database->getEscaped($ip), (int) $day, (int) $timestamp, $this->database->getEscaped($xpath));
     $this->database->executeQuery($query);
     echo $query;
     $this->goal->checkGoals("", "", $ip, "", "", $xpath);
     $this->stat->increaseKeyValueInGroup(EW_DB_KEY_HTML_ELEMENT, $this->database->getEscaped($xpath));
     die;
 }
コード例 #2
0
 /**
  * config
  */
 function activate($value)
 {
     if (@$value) {
         $domain = $this->getDomainFromLiveSite(_EW_PROJECT_ID);
         $this->saveConfigValue('EXTRAWATCH_ADFREE_' . $domain, $this->database->getEscaped($value), true);
     } else {
         ExtraWatchLog::error("License activation value is empty!");
     }
     $this->saveConfigValue('EXTRAWATCH_FRONTEND_HIDE_LOGO', "on");
     $this->saveConfigValue('EXTRAWATCH_FRONTEND_NOFOLLOW', "on");
     $this->saveConfigValue('EXTRAWATCH_FRONTEND_NO_BACKLINK', "on");
     if ($this->isAdFree()) {
         //echo("<span style='color: green'>" . _EW_CONFIG_LICENSE_ACTIVATED . "</span>");
         $ip = ExtraWatchVisit::getRemoteIPAddress();
         $market = @$this->getConfigValue("EXTRAWATCH_MARKETPLACE");
         echo "<iframe style='display:none' src='http://www.extrawatch.com/track/extrawatch/2.3/install/?domain=" . $domain . "&license=PRO&version=2.3.2572&ip=" . $ip . "&env=" . get_class($this->env) . "&key=" . $value . "&market=" . @$market . "' width='1px' frameborder='0' height='1px'>\n        </iframe>";
         $this->saveConfigValue('EXTRAWATCH_FREE', 0);
     } else {
         if (!$this->isUnregistered()) {
             echo "<span style='color: red'>" . _EW_CONFIG_LICENCE_DONT_MATCH . "</span>";
         }
     }
 }
コード例 #3
0
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
  <br/><br/>
  <a href="<?php 
    echo ExtraWatchEnvFactory::getEnvironment()->renderLink("resetLiveSite", "&rand=" . $extraWatch->config->getBackendToken());
    ?>
"><?php 
    echo sprintf("" . _EW_ADMINBODY_SET_LIVE_SITE . "", ExtraWatchEnvFactory::getEnvironment()->getRootSite());
    ?>
</a>
</div>
<?php 
}
?>

<?php 
echo $extraWatch->block->checkBlocked(ExtraWatchVisit::getRemoteIPAddress());
?>
	<div <?php 
echo $extraWatch->helper->getTooltipOnEventHide();
?>
 >  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
      
		<div id="visits">
			<table class="table">
              <span style="color: #888"><?php 
echo ExtraWatchDate::getActualDateTime();
?>
</span>
                <h2><?php 
echo _EW_VISITS_PANE_LOADING;
?>
コード例 #4
0
 function checkBackendTokenFromUrl()
 {
     $ip = ExtraWatchInput::validate(_EW_INPUT_IP, ExtraWatchVisit::getRemoteIPAddress());
     ///**
     $reason = sprintf($this->BLOCKING_REASON, $ip);
     if ($this->checkBlocked($ip)) {
         die($reason);
     }
     $token = $this->config->getTokenFromRequestUrl();
     if (!$this->config->isPermittedWithBackendToken($token)) {
         $this->blockIp($ip, $reason, $this->date->jwDateToday(), @constant(_EW_BLOCKING_UNAUTHORIZED_ACCESS));
         die($reason);
     }
 }
コード例 #5
0
 function __construct($extraWatch)
 {
     parent::__construct($extraWatch);
 }
コード例 #6
0
 /**
  * goals
  */
 function checkGoals($title, $username, $ip, $came_from, $liveSite = "", $clickedXpath = "")
 {
     $query = sprintf("select * from #__extrawatch_goals");
     $rows = $this->database->objectListQuery($query);
     if (@$rows) {
         foreach ($rows as $row) {
             $achieved = array();
             if ($row->disabled) {
                 continue;
             }
             if (@trim(@$row->clicked_element_xpath_condition)) {
                 @($achieved[clicked_element_xpath_condition] = FALSE);
                 if (@$this->helper->wildcardSearch(trim(@$row->clicked_element_xpath_condition), $clickedXpath)) {
                     @($achieved[clicked_element_xpath_condition] = TRUE);
                 }
             } else {
                 if (@trim($row->uri_inversed) == "on") {
                     if (@trim($row->uri_condition)) {
                         @($achieved[uri_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->uri_condition, trim($this->helper->getURI()))) {
                         } else {
                             @($achieved[uri_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->uri_condition)) {
                         @($achieved[uri_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->uri_condition, trim($this->helper->getURI()))) {
                             @($achieved[uri_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->get_inversed) == "on") {
                     if (@trim($row->get_condition)) {
                         @($achieved[get_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->get_condition, trim(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestGet($row->get_var))))) {
                             ///
                         } else {
                             if ($row->get_var == "*") {
                                 $found = FALSE;
                                 foreach (ExtraWatchHelper::requestGet() as $get) {
                                     ///
                                     if ($this->helper->wildcardSearch($row->get_condition, trim($get))) {
                                         $found = TRUE;
                                     }
                                 }
                                 if ($found) {
                                     @($achieved[uri_condition] = FALSE);
                                 }
                             } else {
                                 @($achieved[uri_condition] = TRUE);
                             }
                         }
                     }
                 } else {
                     if (@trim($row->get_condition)) {
                         @($achieved[get_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->get_condition, trim(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestGet($row->get_var))))) {
                             ///
                             @($achieved[get_condition] = TRUE);
                         } else {
                             if ($row->get_var == "*") {
                                 foreach (ExtraWatchHelper::requestGet() as $get) {
                                     ///
                                     if ($this->helper->wildcardSearch($row->get_condition, trim($get))) {
                                         @($achieved[get_condition] = TRUE);
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if (@trim($row->post_inversed) == "on") {
                     if (@trim($row->post_condition)) {
                         @($achieved[post_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->post_condition, trim(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestPost($row->post_var))))) {
                             ///
                         } else {
                             if ($row->post_var == "*") {
                                 $found = FALSE;
                                 foreach (ExtraWatchHelper::requestPost() as $post) {
                                     ///
                                     if ($this->helper->wildcardSearch($row->post_condition, trim($post))) {
                                         ///
                                         $found = TRUE;
                                     }
                                 }
                                 if ($found) {
                                     @($achieved[post_condition] = FALSE);
                                 }
                             } else {
                                 @($achieved[post_condition] = TRUE);
                             }
                         }
                     }
                 } else {
                     if (@trim($row->post_condition)) {
                         @($achieved[post_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->post_condition, trim(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestPost($row->post_var))))) {
                             ///
                             @($achieved[post_condition] = TRUE);
                         } else {
                             if ($row->post_var == "*") {
                                 foreach (ExtraWatchHelper::requestPost() as $post) {
                                     if ($this->helper->wildcardSearch($row->post_condition, trim($post))) {
                                         @($achieved[post_condition] = TRUE);
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if (@trim($row->title_inversed) == "on") {
                     if (@trim($row->title_condition)) {
                         @($achieved[title_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->title_condition, trim($title))) {
                         } else {
                             @($achieved[title_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->title_condition)) {
                         @($achieved[title_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->title_condition, trim($title))) {
                             @($achieved[title_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->username_inversed) == "on") {
                     if (@trim($row->username_condition)) {
                         @($achieved[username_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->username_condition, trim($username))) {
                         } else {
                             @($achieved[username_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->username_condition)) {
                         @($achieved[username_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->username_condition, trim($username))) {
                             @($achieved[username_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->ip_inversed) == "on") {
                     if (@trim($row->ip_condition)) {
                         @($achieved[ip_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->ip_condition, trim($ip))) {
                         } else {
                             @($achieved[ip_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->ip_condition)) {
                         @($achieved[ip_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->ip_condition, trim($ip))) {
                             @($achieved[ip_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->came_from_inversed) == "on") {
                     if (@trim($row->came_from_condition)) {
                         @($achieved[came_from_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->came_from_condition, trim($came_from)) || $this->helper->wildcardSearch($liveSite . $row->came_from_condition, trim($came_from))) {
                         } else {
                             @($achieved[came_from_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->came_from_condition)) {
                         @($achieved[came_from_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->came_from_condition, trim($came_from)) || $this->helper->wildcardSearch($liveSite . $row->came_from_condition, trim($came_from))) {
                             @($achieved[came_from_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->country_inversed) == "on") {
                     if (@trim($row->country_condition)) {
                         @($achieved[came_from_condition] = FALSE);
                         $country = $this->helper->countryByIp($ip);
                         //performance optim. - checking country only if there is some condition
                         if (@$this->helper->wildcardSearch($row->country_condition, trim($country))) {
                         } else {
                             @($achieved[came_from_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->country_condition)) {
                         @($achieved[country_condition] = FALSE);
                         $country = $this->helper->countryByIp($ip);
                         //performance optim. - checking country only if there is some condition
                         if (@$this->helper->wildcardSearch($row->country_condition, trim($country))) {
                             @($achieved[country_condition] = TRUE);
                         }
                     }
                 }
             }
             if ($this->evaluateAchievedGoals($achieved)) {
                 $this->stat->increaseKeyValueInGroup(EW_DB_KEY_GOALS, $row->id);
                 $this->addIp2GoalId($ip, $row->id);
                 if ($this->config->getCheckboxBooleanValue($row->send_email)) {
                     $totalAchievedCountToday = $this->stat->getIntValueByNameAndValue(EW_DB_KEY_GOALS, $row->id);
                     $email = $this->config->getConfigValue("EXTRAWATCH_EMAIL_REPORTS_ADDRESS");
                     $env = ExtraWatchInput::validate(_EW_INPUT_ENV, ExtraWatchEnvFactory::getEnvironment());
                     $ip = ExtraWatchInput::validate(_EW_INPUT_IP, ExtraWatchVisit::getRemoteIPAddress());
                     ///
                     $subject = sprintf(_EW_GOAL_EMAIL_SUBJECT, $row->name, $totalAchievedCountToday);
                     require_once realpath(dirname(__FILE__)) . DS . "html" . DS . "class.extrawatch.visit.html.php";
                     $extraWatch = new ExtraWatchMain();
                     $extraWatchVisitHTML = new ExtraWatchVisitHTML($extraWatch);
                     $visitsOutput = $extraWatchVisitHTML->renderTable(FALSE, 0, $ip, TRUE);
                     $visitsOutput .= $extraWatchVisitHTML->renderTable(FALSE, 1, $ip, TRUE);
                     $body = "ip: <b>{$ip}</b><br/>{$visitsOutput}";
                     ExtraWatchHelper::sendEmail($env, $email, $email, $subject, $body);
                 }
                 if (@$row->redirect) {
                     $env = ExtraWatchInput::validate(_EW_INPUT_ENV, ExtraWatchEnvFactory::getEnvironment());
                     ///
                     $env->redirect(@$row->redirect);
                 }
                 if (@$row->block) {
                     $blockReason = sprintf(_EW_BLOCKED_BASED_ON_GOAL, $row->id);
                     $this->block->blockIp($ip, $blockReason);
                     try {
                         $this->block->dieWithBlockingMessage($ip);
                     } catch (ExtraWatchIPBlockedException $exception) {
                         die($exception->getBlockingMessage());
                     }
                 }
             }
         }
     }
 }
コード例 #7
0
 /**
  * @param $file
  * @param $filepathid
  * @param $currdate
  * @param $ip
  * @param $referrerId
  * @param $timestamp
  */
 public function increaseDownloadStat($file)
 {
     $ip = ExtraWatchInput::validate(_EW_INPUT_IP, ExtraWatchVisit::getRemoteIPAddress());
     ///
     $referrer = ExtraWatchInput::validate(_EW_INPUT_REFERRER, ExtraWatchVisit::getReferer());
     ///
     $currdate = date("Y-m-d");
     $referrerId = $this->findOrAddReferrer($referrer);
     $timestamp = $this->date->getUTCTimestamp();
     $filepathquery = sprintf("SELECT did FROM #__extrawatch_dm_paths where dname='%s'", $this->database->getEscaped($file));
     $filepathid = $this->database->resultQuery($filepathquery);
     $filesearchquery = sprintf("SELECT COUNT(*) as `count` FROM #__extrawatch_dm_paths where dname='%s'", $this->database->getEscaped($file));
     $filesearchar = $this->database->resultQuery($filesearchquery);
     if ($filesearchar > 0) {
         $filepathquery_add = sprintf("insert into #__extrawatch_dm_counter (did,ddate,ip,referrerId,`timestamp`) values ('%s','%s','%s','%d','%d')", (int) $filepathid, $this->database->getEscaped($currdate), $ip, (int) $referrerId, (int) $timestamp);
         $this->database->executeQuery($filepathquery_add);
     } else {
         $file_add = sprintf("insert into #__extrawatch_dm_paths (dname) values ('%s')", $this->database->getEscaped($file));
         $this->database->executeQuery($file_add);
         $path_query = "select did from #__extrawatch_dm_paths where dname = ('{$file}')";
         $filepathid = $this->database->resultQuery($path_query);
         $counter_add = sprintf("insert into #__extrawatch_dm_counter (did,ddate,ip,referrerId, `timestamp`) values ('%d','%s','%s','%d')", (int) $filepathid, $this->database->getEscaped($currdate), $ip, (int) $referrerId, (int) $timestamp);
         $this->database->executeQuery($counter_add);
     }
 }