Skip to content

Commit 58d46ea

Browse files
committed
Minor changes.
* Feedback query on settings save. * Meta tags have been added to avoid caching for SpamFireWall stop page.
1 parent 1684f1c commit 58d46ea

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

antispambycleantalk.php

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,10 +726,22 @@ public function onExtensionBeforeSave($name, $data){
726726
$new_config=json_decode($data->params);
727727

728728
if(isset($new_config->apikey) && $new_config->apikey != $config['apikey'] && trim($new_config->apikey) != '' && $new_config->apikey != 'enter key'){
729-
729+
self::ctSendAgentVersion($new_config->apikey);
730730
}
731731
}
732+
/**
733+
* This event is triggered after update extension
734+
* Joomla 2.5+
735+
* @access public
736+
*/
732737

738+
public function onExtensionAfterUpdate($name, $data){
739+
$config = $this->getCTConfig();
740+
//Sending agent version
741+
if(isset($config['apikey']) && trim($config['apikey']) != '' && $config['apikey'] != 'enter key'){
742+
self::ctSendAgentVersion($config['apikey']);
743+
}
744+
}
733745

734746
/*
735747
exception for MijoShop ajax calls
@@ -1736,6 +1748,34 @@ private function sendAdminEmail($subject, $message, $is_html = false) {
17361748
* $params - array of XML params
17371749
* return XML RPS server response
17381750
*/
1751+
private function ctSendAgentVersion($apikey)
1752+
{
1753+
self::getCleantalk();
1754+
$ctFbParams['feedback'] = '0:' . self::ENGINE;
1755+
defined('_JEXEC') or die('Restricted access');
1756+
if(!defined('DS')){
1757+
define('DS', DIRECTORY_SEPARATOR);
1758+
}
1759+
require_once(dirname(__FILE__) . DS . 'cleantalk.class.php');
1760+
$ct_request = new CleantalkRequest;
1761+
1762+
foreach ($ctFbParams as $k => $v) {
1763+
$ct_request->$k = $v;
1764+
}
1765+
$ct_request->auth_key = $apikey;
1766+
$ct_request->agent = self::ENGINE;
1767+
$config = self::dbGetServer();
1768+
$result = NULL;
1769+
1770+
self::$CT->work_url = $config['ct_work_url'];
1771+
self::$CT->server_ttl = $config['ct_server_ttl'];
1772+
self::$CT->server_changed = $config['ct_server_changed'];
1773+
$result = self::$CT->sendFeedback($ct_request);
1774+
if (self::$CT->server_change) {
1775+
self::dbSetServer(self::$CT->work_url, self::$CT->server_ttl, time());
1776+
}
1777+
return $result;
1778+
}
17391779
private function ctSendRequest($method, $params) {
17401780
self::getCleantalk();
17411781

antispambycleantalk.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<license>GNU/GPLv2</license>
88
<authorEmail>welcome@cleantalk.org</authorEmail>
99
<authorUrl>cleantalk.org</authorUrl>
10-
<version>4.4</version>
10+
<version>4.5</version>
1111
<description>PLG_CLEANTALK_DESCRIPTION</description>
1212
<files>
1313
<filename plugin="antispambycleantalk">antispambycleantalk.php</filename>

spamfirewall.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
<head>
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
<meta http-equiv="cache-control" content="max-age=0" />
9+
<meta http-equiv="cache-control" content="no-cache" />
10+
<meta http-equiv="expires" content="0" />
11+
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
12+
<meta http-equiv="pragma" content="no-cache" />
713

814
<!-- <title></title> -->
915

0 commit comments

Comments
 (0)