Skip to content

Commit

Permalink
update version
Browse files Browse the repository at this point in the history
revert submti_time via sessions
  • Loading branch information
davydovct committed Apr 13, 2018
1 parent 6ad0a7b commit 55b7c07
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 2.20 April 16, 2018
------------------------------
- Bug fixes and other minor improvements

Version 2.20 December 24, 2017
------------------------------
- New option for email notifications
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SMF Antispam mod
* **Version:** 2.20
* **Version:** 2.21
* **License:** GNU General Public License
* **Compatible with:** SMF 2.0 and up
* **Languages:** English, Russian
Expand Down
2 changes: 1 addition & 1 deletion RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class RoboFile extends \Robo\Tasks
{
const PACKAGE = 'antispam_cleantalk_smf';
const VERSION = '2.20';
const VERSION = '2.21';

const SMF_VERSION = '2.0.14'; // for forumPrepare

Expand Down
27 changes: 24 additions & 3 deletions cleantalkMod.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function cleantalk_sfw_check()
}
}
}
if (!empty($modSettings['cleantalk_ccf_checking']) && strpos($_SERVER['REQUEST_URI'], 'action=admin') === false && strpos($_SERVER['REQUEST_URI'], 'action=register') === false && strpos($_SERVER['REQUEST_URI'], 'action=login') === false && strpos($_SERVER['REQUEST_URI'], 'action=post') === false && strpos($_SERVER['REQUEST_URI'], 'action=tpadmin') === false && $_SERVER['REQUEST_METHOD'] == 'POST')
if (!empty($modSettings['cleantalk_ccf_checking']) && strpos($_SERVER['REQUEST_URI'], 'action=admin') === false && strpos($_SERVER['REQUEST_URI'], 'action=register') === false && strpos($_SERVER['REQUEST_URI'], 'action=login') === false && strpos($_SERVER['REQUEST_URI'], 'action=post') === false && $_SERVER['REQUEST_METHOD'] == 'POST')
{
$ct_temp_msg_data = cleantalkGetFields($_POST);
$sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
Expand Down Expand Up @@ -795,14 +795,35 @@ function ctKeyStopStopListening(){
}
</script>';
}

/**
* Calling by hook integrate_exit
*/
function cleantalk_exit()
{
global $context, $user_info;
if (
isset($context['template_layers']) &&
is_array($context['template_layers']) &&
in_array('body', $context['template_layers']) &&
($user_info['is_guest'] || $user_info['posts'] == 0)
) {
cleantalk_store_form_start_time();
}
}
/**
* Store form start time
*/
function cleantalk_store_form_start_time()
{
$_SESSION['ct_form_start_time'] = time();
}
/**
* Get form submit time
* @return int|null
*/
function cleantalk_get_form_submit_time()
{
return isset($_COOKIE['apbct_timestamp']) ? time() - intval($_COOKIE['apbct_timestamp']) : 0;
return isset($_SESSION['ct_form_start_time']) ? time() - $_SESSION['ct_form_start_time'] : null;
}

/**
Expand Down
1 change: 1 addition & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'integrate_register' => 'cleantalk_check_register',
'integrate_general_mod_settings' => 'cleantalk_general_mod_settings',
'integrate_load_theme' => 'cleantalk_load',
'integrate_exit' => 'cleantalk_exit',
'integrate_buffer' => 'cleantalk_buffer',
);

Expand Down
2 changes: 1 addition & 1 deletion modification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="www.simplemachines.org/xml/modification">
<id>cleantalk:antispam</id>
<version>2.20</version>
<version>2.21</version>
<file name="$sourcedir/Post.php">
<operation error="fatal">
<search position="after"><![CDATA[createPost($msgOptions, $topicOptions, $posterOptions);]]></search>
Expand Down
35 changes: 25 additions & 10 deletions package-info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>cleantalk:antispam</id>
<name>Anti-spam by CleanTalk</name>
<type>modification</type>
<version>2.20</version>
<version>2.21</version>
<install for="2.0 - 2.1.99">
<readme type="file" parsebbc="true">readme.txt</readme>
<readme type="file" parsebbc="true" lang="russian-utf8">readme_russian.txt</readme>
Expand Down Expand Up @@ -44,7 +44,7 @@
</readme>
</upgrade>
<upgrade from="2.12 - 2.15">
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk to 2.20 version:
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk to 2.21 version:
- Fix SFW update on save settings
- Change SFW template
- Remove plugin settings on uninstall
Expand Down Expand Up @@ -92,7 +92,7 @@
</redirect>
</upgrade>
<upgrade from="2.16">
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.16 to 2.20 version:
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.16 to 2.21 version:
- Fix create_table for sql_lite
- IPv6 support
- Update sfw_networks on plugin install
Expand All @@ -101,7 +101,7 @@
- New option to disable/enable email notifications
- Bug fixes and other minor improvements
</readme>
<readme type="inline" parsebbc="true" lang="russian-utf8">Обновление Анти-спама от Cleantalk с версии 2.16 до 2.20:
<readme type="inline" parsebbc="true" lang="russian-utf8">Обновление Анти-спама от Cleantalk с версии 2.16 до 2.21:
- Исправлен скрипт создания таблиц для sql_lite
- Поддержка IPV6
- Обновление баз SpamFireWall при установке плагина
Expand All @@ -125,12 +125,12 @@
</redirect>
</upgrade>
<upgrade from="2.17">
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.17 to 2.20 version:
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.17 to 2.21 version:
- Support Cloudflare CDN
- New option to disable/enable email notifications
- Bug fixes and other minor improvements
</readme>
<readme type="inline" parsebbc="true" lang="russian-utf8">Обновление Анти-спама от Cleantalk с версии 2.17 до 2.20:
<readme type="inline" parsebbc="true" lang="russian-utf8">Обновление Анти-спама от Cleantalk с версии 2.17 до 2.21:
- Поддержка Cloudflare CDN
- Добавлена новая опция о включении/отключении e-mail уведомлений
- Устранение багов и остальные незначительные улучшения
Expand All @@ -150,7 +150,7 @@
</redirect>
</upgrade>
<upgrade from="2.18">
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.18 to 2.20 version:
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.18 to 2.21 version:
- New option to disable/enable email notifications
- Bug fixes and other minor improvements
</readme>
Expand All @@ -173,11 +173,11 @@
</redirect>
</upgrade>
<upgrade from="2.19">
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.19 to 2.20 version:
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.19 to 2.21 version:
- New option to disable/enable email notifications
- Bug fixes and other minor improvements
</readme>
<readme type="inline" parsebbc="true" lang="russian-utf8">Обновление Анти-спама от Cleantalk с версии 2.19 до 2.20:
<readme type="inline" parsebbc="true" lang="russian-utf8">Обновление Анти-спама от Cleantalk с версии 2.19 до 2.21:
- Добавлена новая опция о включении/отключении e-mail уведомлений
- Устранение багов и остальные незначительные улучшения
</readme>
Expand All @@ -194,5 +194,20 @@
<redirect url="$boardurl/index.php?action=admin;area=modsettings" type="inline">Please stand by while
you are being redirected to this mod configuration settings.
</redirect>
</upgrade>
</upgrade>
<upgrade from="2.20">
<readme type="inline" parsebbc="true">This upgrade for Antispam by Cleantalk from 2.20 to 2.21 version:
- Bug fixes and other minor improvements
</readme>
<readme type="inline" parsebbc="true" lang="russian-utf8">Обновление Анти-спама от Cleantalk с версии 2.20 до 2.21:
- Устранение багов и остальные незначительные улучшения
</readme>
<create-dir name="cleantalk" destination="$sourcedir"/>
<require-file name="cleantalkMod.php" destination="$sourcedir/cleantalk">Mod main file</require-file>
<modification format="xml" type="file">modification.xml</modification>
<database>install.php</database>
<redirect url="$boardurl/index.php?action=admin;area=modsettings" type="inline">Please stand by while
you are being redirected to this mod configuration settings.
</redirect>
</upgrade>
</package-info>
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MOD [b]Anti-spam by CleanTalk[/b]
Version: 2.20
Version: 2.21

Anti-spam by CleanTalk mod with protection against spam bots and manual spam.
No Captcha, no questions, no counting animals, no puzzles, no math.
Expand Down
2 changes: 1 addition & 1 deletion readme_russian.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MOD [b]Анти-спам от Cleantalk[/b]
Версия: 2.20
Версия: 2.21

Анти-спам от Cleantalk с защитой против автоматического и ручного спама.
Без капчи, без вопросов, без подсчета животных, без паззлов и т.д
Expand Down
8 changes: 4 additions & 4 deletions upgrades/1.40.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<file name="$sourcedir/Register.php">
<operation error="fatal">
<search position="replace"><![CDATA[if (!isset($_POST['regSubmit']))
{
// cleantalk set start time of registration
cleantalk_store_form_start_time(-1);
}
{
// cleantalk set start time of registration
cleantalk_store_form_start_time(-1);
}
// Show the user the right form.]]></search>
<add><![CDATA[// Show the user the right form.]]></add>
Expand Down

0 comments on commit 55b7c07

Please sign in to comment.