diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/listchatconfig.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/listchatconfig.tpl.php index 9c884c8bd..e1232caa4 100644 --- a/lhc_web/design/defaulttheme/tpl/lhchat/listchatconfig.tpl.php +++ b/lhc_web/design/defaulttheme/tpl/lhchat/listchatconfig.tpl.php @@ -59,7 +59,10 @@ - + + + + diff --git a/lhc_web/doc/CHANGELOG.txt b/lhc_web/doc/CHANGELOG.txt index 51ebb1d57..495a77e0a 100644 --- a/lhc_web/doc/CHANGELOG.txt +++ b/lhc_web/doc/CHANGELOG.txt @@ -1,3 +1,18 @@ +4.44v + +1. You can enter IP or IP range in back office which is not allowed to be blocked. +2. Widget theme translations will override only default language and use default translation for other languages. +3. 8.* PHP fixes. +4. Transaction will be used for online vars update to avoid inconsistency. +5. If your VPS has multiple IP you can configure which one should be used fot SMTP sending. DigitalOcean scenario with Reserved IP. +6. Submenu will be hidden for main left menu while rendering back office page. +7. Widget resize improvements. +8. Auto assignment consistency improvements. +9. Views will use dynamic date range and not fixed. +10. Various other fixes/improvements. + +execute doc/update_db/update_314.sql for update + 4.43v 1. Embedded forms in chat now can completely hide form content on success submission. diff --git a/lhc_web/doc/update_db/structure.json b/lhc_web/doc/update_db/structure.json index 108278e84..9e16b33fe 100644 --- a/lhc_web/doc/update_db/structure.json +++ b/lhc_web/doc/update_db/structure.json @@ -10361,6 +10361,13 @@ "explain": "Which ip should not be allowed to chat", "hidden": "0" }, + { + "identifier": "unban_ip_range", + "value": "", + "type": "0", + "explain": "Which ip should not be allowed to be blocked", + "hidden": "0" + }, { "identifier": "update_ip", "value": "127.0.0.1", diff --git a/lhc_web/doc/update_db/update_314.sql b/lhc_web/doc/update_db/update_314.sql new file mode 100644 index 000000000..7bbfdc59f --- /dev/null +++ b/lhc_web/doc/update_db/update_314.sql @@ -0,0 +1 @@ +INSERT INTO `lh_chat_config` (`identifier`,`value`,`type`,`explain`,`hidden`) VALUES ('unban_ip_range','','0','Which ip should not be allowed to be blocked','0'); \ No newline at end of file diff --git a/lhc_web/lib/core/lhcore/lhupdate.php b/lhc_web/lib/core/lhcore/lhupdate.php index e35c9147b..87b7ed2d4 100644 --- a/lhc_web/lib/core/lhcore/lhupdate.php +++ b/lhc_web/lib/core/lhcore/lhupdate.php @@ -3,8 +3,8 @@ class erLhcoreClassUpdate { - const DB_VERSION = 313; - const LHC_RELEASE = 443; + const DB_VERSION = 314; + const LHC_RELEASE = 444; public static function doTablesUpdate($definition){ $updateInformation = self::getTablesStatus($definition); diff --git a/lhc_web/modules/lhchat/blockedusers.php b/lhc_web/modules/lhchat/blockedusers.php index d05aa10e0..02410aca6 100644 --- a/lhc_web/modules/lhchat/blockedusers.php +++ b/lhc_web/modules/lhchat/blockedusers.php @@ -39,7 +39,17 @@ $form = new ezcInputForm( INPUT_POST, $definition ); $Errors = array(); - if ( $form->hasValidData( 'IPToBlock' ) && $form->IPToBlock != '' ) { + $ignorable_ip = erLhcoreClassModelChatConfig::fetch('unban_ip_range')->current_value; + + if (!($form->hasValidData( 'IPToBlock' ) && $form->IPToBlock != '')) { + $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/blockedusers','Please enter an IP to block'); + } + + if ($form->hasValidData( 'IPToBlock' ) && $form->IPToBlock != '' && $ignorable_ip != '' && erLhcoreClassIPDetect::isIgnored($form->IPToBlock,explode(',',$ignorable_ip))) { + $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/blockedusers','This IP can not be blocked!'); + } + + if (empty($Errors)) { $ipBlock = new erLhcoreClassModelChatBlockedUser(); $ipBlock->ip = $form->IPToBlock; $ipBlock->user_id = erLhcoreClassUser::instance()->getUserID(); @@ -47,7 +57,7 @@ $ipBlock->saveThis(); $tpl->set('block_saved',true); } else { - $tpl->set('errors',array(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/blockedusers','Please enter an IP to block'))); + $tpl->set('errors',$Errors); } } diff --git a/lhc_web/modules/lhchat/blockuser.php b/lhc_web/modules/lhchat/blockuser.php index 2632cd4e7..78a9d6eca 100644 --- a/lhc_web/modules/lhchat/blockuser.php +++ b/lhc_web/modules/lhchat/blockuser.php @@ -77,6 +77,12 @@ } } +$ignorable_ip = erLhcoreClassModelChatConfig::fetch('unban_ip_range')->current_value; + +if ($ignorable_ip != '' && erLhcoreClassIPDetect::isIgnored($chat->ip, explode(',',$ignorable_ip))) { + $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/blockedusers','This IP can not be blocked!'); +} + $params['chat'] = $chat; $params['user'] = $currentUser->getUserData(true); diff --git a/lhc_web/modules/lhinstall/install.php b/lhc_web/modules/lhinstall/install.php index 80ed76f3c..38aa50594 100644 --- a/lhc_web/modules/lhinstall/install.php +++ b/lhc_web/modules/lhinstall/install.php @@ -1580,6 +1580,7 @@ ('track_domain', '', 0, 'Set your domain to enable user tracking across different domain subdomains.', 0), ('max_message_length','500',0,'Maximum message length in characters', '0'), ('need_help_tip','1',0,'Show need help tooltip?', '0'), + ('unban_ip_range','','0','Which ip should not be allowed to be blocked','0'), ('recaptcha_data','a:4:{i:0;b:0;s:8:\"site_key\";s:0:\"\";s:10:\"secret_key\";s:0:\"\";s:7:\"enabled\";i:0;}','0','Re-captcha configuration','1'), ('need_help_tip_timeout','24',0,'Need help tooltip timeout, after how many hours show again tooltip?', '0'), ('use_secure_cookie','0',0,'Use secure cookie, check this if you want to force SSL all the time', '0'),