Skip to content

Commit

Permalink
4.44v
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jul 31, 2024
1 parent a023ab8 commit 366b78d
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@
<?php include(erLhcoreClassDesign::designtpl('lhchat/part/chat_settings.tpl.php'));?>

<?php include(erLhcoreClassDesign::designtpl('lhchat/part/listchatconfig/banned_ip_range.tpl.php'));?>


<?php $attribute = 'unban_ip_range'; ?>
<?php include(erLhcoreClassDesign::designtpl('lhchat/part/chat_settings.tpl.php'));?>

<?php $attribute = 'track_online_visitors';$boolValue = true;?>
<?php include(erLhcoreClassDesign::designtpl('lhchat/part/chat_settings.tpl.php'));?>

Expand Down
15 changes: 15 additions & 0 deletions lhc_web/doc/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 7 additions & 0 deletions lhc_web/doc/update_db/structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions lhc_web/doc/update_db/update_314.sql
Original file line number Diff line number Diff line change
@@ -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');
4 changes: 2 additions & 2 deletions lhc_web/lib/core/lhcore/lhupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 12 additions & 2 deletions lhc_web/modules/lhchat/blockedusers.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,25 @@
$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();
$ipBlock->datets = time();
$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);
}
}

Expand Down
6 changes: 6 additions & 0 deletions lhc_web/modules/lhchat/blockuser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions lhc_web/modules/lhinstall/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 366b78d

Please sign in to comment.