Skip to content

Commit ce7bca0

Browse files
author
davydovct
committed
minor fixes
1 parent 7c34533 commit ce7bca0

File tree

2 files changed

+37
-14
lines changed

2 files changed

+37
-14
lines changed

antispambycleantalk.php

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,9 @@ private function checkIsPaid($ct_api_key=null, $force_check = false){
197197
if (empty($api_key))
198198
{
199199
$key_is_ok=false;
200-
$result = CleantalkHelper::noticePaidTill($api_key);
201-
if (empty($result['error']))
202-
{
200+
$npd_result = CleantalkHelper::noticePaidTill($api_key);
201+
if (empty($npd_result['error']))
203202
$key_is_ok = true;
204-
}
205203
}
206204
else
207205
{
@@ -238,8 +236,8 @@ private function checkIsPaid($ct_api_key=null, $force_check = false){
238236
if($last_status!=1&&$new_status==1)
239237
$show_notice=1;
240238
}
241-
}
242-
$result = CleantalkHelper::noticePaidTill($api_key);
239+
}
240+
$result = ($npd_result) ? $npd_result : CleantalkHelper::noticePaidTill($api_key);
243241
if(empty($result['error']))
244242
{
245243
if(isset($result['show_review']) && $result['show_review'] == 1)
@@ -516,10 +514,11 @@ public function onAfterInitialise(){
516514
}
517515

518516
$app = JFactory::getApplication();
519-
$plugin = JPluginHelper::getPlugin('system', 'antispambycleantalk');
520-
$jparam = new JRegistry($plugin->params);
521-
$sfw_enable = $jparam->get('sfw_enable', 0);
522-
$ct_apikey = trim($jparam->get('apikey', 0));
517+
$CTconfig = $this->getCTConfig();
518+
$plugin = JPluginHelper::getPlugin('system', 'antispambycleantalk');
519+
$jparam = new JRegistry($plugin->params);
520+
$sfw_enable = $CTconfig['sfw_enable'];
521+
$ct_apikey = $CTconfig['apikey'];
523522
$sfw_log = (array)$jparam->get('sfw_log', 0);
524523
$output = null;
525524
/*
@@ -555,10 +554,10 @@ public function onAfterInitialise(){
555554
*/
556555
if($sfw_enable == 1)
557556
{
558-
$sfw_last_check = $jparam->get('sfw_last_check', 0);
559-
$sfw_last_send_log = $jparam->get('sfw_last_send_log', 0);
557+
$sfw_last_check = $CTconfig['sfw_last_check'];
558+
$sfw_last_send_log = $CTconfig['sfw_last_send_log'];
560559
$save_params = array();
561-
$sfw_check_interval = $jparam->get('sfw_check_interval', 0);
560+
$sfw_check_interval = $CTconfig['sfw_check_interval'];
562561
if ($sfw_check_interval > 0 && ($sfw_last_check + $sfw_check_interval) < time() && $ct_apikey !== '')
563562
self::update_sfw_db_networks($ct_apikey);
564563
if(time()-$sfw_last_send_log>3600)
@@ -766,7 +765,6 @@ public function onAfterInitialise(){
766765
}
767766
if (isset($_POST['send_connection_report']) && $_POST['send_connection_report'] === 'yes')
768767
{
769-
$CTconfig = $this->getCTConfig();
770768
$output['result']=null;
771769
$output['data']=null;
772770
if ($CTconfig['connection_reports']['negative_report'] !== null)
@@ -2059,6 +2057,11 @@ private function getCTConfig() {
20592057

20602058
$config['apikey'] = trim($jreg->get('apikey', ''));
20612059
$config['ct_key_is_ok'] = $jreg->get('ct_key_is_ok',0);
2060+
$config['sfw_enable'] = $jreg->get('sfw_enable', 0);
2061+
$config['sfw_last_check'] = $jreg->get('sfw_last_check', 0);
2062+
$config['sfw_check_interval'] = $jreg->get('sfw_check_interval', 86400);
2063+
$config['sfw_last_send_log'] = $jreg->get('sfw_last_send_log', 0);
2064+
$config['sfw_reload_timeout'] = $jreg->get('sfw_reload_timeout', 3);
20622065
$config['server_url'] = $jreg->get('server_url', 'http://moderate.cleantalk.org');
20632066
$config['work_url'] = $jreg->get('work_url', '');
20642067
$config['server_ttl'] = $jreg->get('server_ttl', 0);

plugin-updates.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<updates>
3+
<update>
4+
<name>Antispam by CleanTalk</name>
5+
<description>Antispam plugin for Joomla registrations and contacts, for VurtueMart, Rapid Contact, VTEM Contact, JComments 2.3, 3.0.</description>
6+
<element>antispambycleantalk</element>
7+
<type>plugin</type>
8+
<folder>system</folder>
9+
<client_id>0</client_id>
10+
<client>0</client>
11+
<version>5.6</version>
12+
<infourl title="Antispam by CleanTalk">https://cleantalk.org/joomla-anti-spam-plugin-without-captcha</infourl>
13+
<downloads>
14+
<downloadurl type="full" format="zip">https://github.com/CleanTalk/joomla25-3x-antispam/archive/5.6.zip</downloadurl>
15+
</downloads>
16+
<tags>
17+
<tag>stable</tag>
18+
</tags>
19+
<maintainer>CleanTalk</maintainer>
20+
<maintainerurl>https://cleantalk.org</maintainerurl>
21+
<targetplatform name="joomla" version="[23].*"/>
22+
</update>
323
<update>
424
<name>Antispam by CleanTalk</name>
525
<description>Antispam plugin for Joomla registrations and contacts, for VurtueMart, Rapid Contact, VTEM Contact, JComments 2.3, 3.0.</description>

0 commit comments

Comments
 (0)