From 61ec7728c425f0e31ca4656166aaaea8cfbc2a4c Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 22:17:56 -0500 Subject: [PATCH 01/21] Squashed commits: [9157ee5] squish with version change [de99bb5] squish with version only changes [a9954fa] squish with version commit [f67c9c4] #136 Update print [032dbfc] #136 Update submit_ticket [5a41ae9] squish with version commit [9dc287b] squish with version commit --- admin/admin_main.php | 4 ++-- admin/admin_reply_ticket.php | 4 ++-- admin/admin_submit_ticket.php | 4 ++-- admin/banned_emails.php | 4 ++-- admin/banned_ips.php | 4 ++-- admin/edit_note.php | 4 ++-- admin/edit_post.php | 4 ++-- admin/export.php | 4 ++-- admin/find_tickets.php | 4 ++-- admin/lock.php | 4 ++-- admin/mail.php | 4 ++-- admin/manage_canned.php | 4 ++-- admin/manage_categories.php | 4 ++-- admin/manage_ticket_templates.php | 4 ++-- admin/manage_users.php | 4 ++-- admin/new_ticket.php | 4 ++-- admin/options.php | 4 ++-- admin/profile.php | 4 ++-- admin/show_tickets.php | 4 ++-- change_status.php | 4 ++-- inc/email_functions.inc.php | 4 ++-- inc/header.inc.php | 4 ++-- inc/knowledgebase_functions.inc.php | 4 ++-- inc/posting_functions.inc.php | 4 ++-- inc/print_tickets.inc.php | 4 ++-- inc/profile_functions.inc.php | 4 ++-- inc/show_admin_nav.inc.php | 4 ++-- index.php | 4 ++-- install/index.php | 4 ++-- knowledgebase.php | 4 ++-- print.php | 4 ++-- submit_ticket.php | 4 ++-- suggest_articles.php | 4 ++-- suggest_email.php | 4 ++-- ticket.php | 4 ++-- 35 files changed, 70 insertions(+), 70 deletions(-) diff --git a/admin/admin_main.php b/admin/admin_main.php index 4fe6e7c2..002a94ff 100644 --- a/admin/admin_main.php +++ b/admin/admin_main.php @@ -1,12 +1,12 @@ Date: Sun, 22 Feb 2015 11:15:31 -0500 Subject: [PATCH 02/21] #136 Update admin_settings --- admin/admin_settings.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/admin/admin_settings.php b/admin/admin_settings.php index 3a352f31..d1bf83dc 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -1,12 +1,12 @@ ' . $hesklang['beta'] . ' '; ?>
- + +
+

+

+
'; + ?> +
+ +
+
Date: Sun, 22 Feb 2015 11:17:00 -0500 Subject: [PATCH 03/21] #136 Update admin_settings_save --- admin/admin_settings_save.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/admin_settings_save.php b/admin/admin_settings_save.php index 5fbbe941..3579edf9 100644 --- a/admin/admin_settings_save.php +++ b/admin/admin_settings_save.php @@ -1,12 +1,12 @@ Other */ +$set['submittedformat'] = hesk_checkMinMax( intval( hesk_POST('s_submittedformat') ) , 0, 2, 2); $set['updatedformat'] = hesk_checkMinMax( intval( hesk_POST('s_updatedformat') ) , 0, 2, 2); /*** MISC ***/ @@ -827,6 +828,7 @@ $hesk_settings[\'open_only\']=' . $set['open_only'] . '; $hesk_settings[\'ticket_list\']=array(' . $set['ticket_list'] . '); // --> Other +$hesk_settings[\'submittedformat\']=\'' . $set['submittedformat'] . '\'; $hesk_settings[\'updatedformat\']=\'' . $set['updatedformat'] . '\'; From fa17916280e1d9536ddbe97c0c7e85ef51572810 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 11:19:57 -0500 Subject: [PATCH 04/21] #136 Update admin_ticket --- admin/admin_ticket.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 82055da9..181f78f6 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -1,12 +1,12 @@
-
From d0fbcf9b273f47ae4f6754b14f582886eb2b8a7e Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 11:40:15 -0500 Subject: [PATCH 05/21] #136 Update change_status --- admin/change_status.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/change_status.php b/admin/change_status.php index 3b2dd317..8e82bfe7 100644 --- a/admin/change_status.php +++ b/admin/change_status.php @@ -1,12 +1,12 @@ Date: Sun, 22 Feb 2015 11:40:23 -0500 Subject: [PATCH 06/21] #136 Update delete_tickets --- admin/delete_tickets.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/delete_tickets.php b/admin/delete_tickets.php index 52b1f774..f72ac309 100644 --- a/admin/delete_tickets.php +++ b/admin/delete_tickets.php @@ -1,12 +1,12 @@ Date: Sun, 22 Feb 2015 11:40:30 -0500 Subject: [PATCH 07/21] #136 Update admin index.php --- admin/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/index.php b/admin/index.php index 9abe808e..e7bd3ba2 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,12 +1,12 @@ Date: Sun, 22 Feb 2015 11:40:41 -0500 Subject: [PATCH 08/21] #136 Update knowledgebase_private --- admin/knowledgebase_private.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/admin/knowledgebase_private.php b/admin/knowledgebase_private.php index 39cb99a4..ead71f9d 100644 --- a/admin/knowledgebase_private.php +++ b/admin/knowledgebase_private.php @@ -1,12 +1,12 @@ Date: Sun, 22 Feb 2015 11:40:49 -0500 Subject: [PATCH 09/21] #136 Update manage_knowledgebase --- admin/manage_knowledgebase.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/admin/manage_knowledgebase.php b/admin/manage_knowledgebase.php index bd3f164b..c70af6ba 100644 --- a/admin/manage_knowledgebase.php +++ b/admin/manage_knowledgebase.php @@ -1,12 +1,12 @@ 1); $result = hesk_dbQuery('SELECT `parent`, COUNT(*) AS `num` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'kb_categories` GROUP BY `parent`'); @@ -186,6 +189,8 @@ while (count($kb_cat) > 0) $text_short = $cat['name'].$type.' ('.$cat['articles'].', '.$cat['articles_private'].', '.$cat['articles_draft'].')'; + $total_articles += $cat['articles']; + // Generate KB menu icons $menu_icons = ' ' @@ -269,6 +274,13 @@ if (!isset($_SESSION['hide']['treemenu'])) + @@ -367,7 +379,7 @@ if (!isset($_SESSION['hide']['new_article']))
- +
@@ -1335,7 +1347,7 @@ function edit_article()
- +
From dcff56a6f665f6885b0a353e500d1a93c5764e47 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 11:40:56 -0500 Subject: [PATCH 10/21] #136 Update password.php --- admin/password.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/password.php b/admin/password.php index 6c3ab8e5..41f916f6 100644 --- a/admin/password.php +++ b/admin/password.php @@ -1,12 +1,12 @@
    '.$hesk_error_buffer.'
'; hesk_process_messages($hesk_error_buffer,'NOREDIRECT'); } + elseif (defined('HESK_DEMO')) + { + hesk_process_messages($hesklang['ddemo'],'NOREDIRECT'); + } else { // Get user data from the database From 7cf8f5310941f3d97aadbc4c31280629d88e54b2 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 11:41:05 -0500 Subject: [PATCH 11/21] #136 Update reports --- admin/reports.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/reports.php b/admin/reports.php index 771a896f..821d3193 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -1,12 +1,12 @@ '.$totals['worked'].''; + echo ''.$totals['worked'].''; } ?> @@ -511,7 +511,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); '.$totals['worked'].''; + echo ''.$totals['worked'].''; } ?> @@ -940,7 +940,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); '.$totals['worked'].''; + echo ''.$totals['worked'].''; } ?> From 17b714c97e49f141cdcc490e90f8fc8cb82ddf33 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 11:41:11 -0500 Subject: [PATCH 12/21] #136 Update service_messages --- admin/service_messages.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/service_messages.php b/admin/service_messages.php index 40939492..156821a7 100644 --- a/admin/service_messages.php +++ b/admin/service_messages.php @@ -1,12 +1,12 @@
-

+

From 107d02b1984b7a5e283bce5265039b72cfe3616f Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 22:16:30 -0500 Subject: [PATCH 13/21] #136 Update admin_functions --- inc/admin_functions.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/admin_functions.inc.php b/inc/admin_functions.inc.php index 18c60720..6a2d0f0b 100644 --- a/inc/admin_functions.inc.php +++ b/inc/admin_functions.inc.php @@ -1,12 +1,12 @@ Date: Sun, 22 Feb 2015 22:16:36 -0500 Subject: [PATCH 14/21] #136 Update common --- inc/common.inc.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/inc/common.inc.php b/inc/common.inc.php index 29947b88..7df8f27f 100644 --- a/inc/common.inc.php +++ b/inc/common.inc.php @@ -1,12 +1,12 @@ 4294967296) + { + $ip = 4294967296; + } + $res = hesk_dbQuery("SELECT `id` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."banned_ips` WHERE {$ip} BETWEEN `ip_from` AND `ip_to` LIMIT 1"); return ( hesk_dbNumRows($res) == 1 ) ? hesk_dbResult($res) : false; @@ -1273,7 +1283,7 @@ function hesk_makeURL($text, $class = '') // matches an email address $text = preg_replace_callback( - '#(^|[\n\t (>.])(([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?))#i', + '/(^|[\n\t (>])(' . '(?:(?:(?:[^@,"\[\]\x5c\x00-\x20\x7f-\xff\.]|\x5c(?=[@,"\[\]\x5c\x00-\x20\x7f-\xff]))(?:[^@,"\[\]\x5c\x00-\x20\x7f-\xff\.]|(?<=\x5c)[@,"\[\]\x5c\x00-\x20\x7f-\xff]|\x5c(?=[@,"\[\]\x5c\x00-\x20\x7f-\xff])|\.(?=[^\.])){1,62}(?:[^@,"\[\]\x5c\x00-\x20\x7f-\xff\.]|(?<=\x5c)[@,"\[\]\x5c\x00-\x20\x7f-\xff])|[^@,"\[\]\x5c\x00-\x20\x7f-\xff\.]{1,2})|"(?:[^"]|(?<=\x5c)"){1,62}")@(?:(?!.{64})(?:[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.?|[a-zA-Z0-9]\.?)+\.(?:xn--[a-zA-Z0-9]+|[a-zA-Z]{2,6})|\[(?:[0-1]?\d?\d|2[0-4]\d|25[0-5])(?:\.(?:[0-1]?\d?\d|2[0-4]\d|25[0-5])){3}\])' . ')/iu', create_function( "\$matches", "return make_clickable_callback(MAGIC_URL_EMAIL, \$matches[1], \$matches[2], '', '$class');" From 917ef469f503933231d8478835809a654fee7320 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 22:16:44 -0500 Subject: [PATCH 15/21] #136 Update show_search_form --- inc/show_search_form.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/show_search_form.inc.php b/inc/show_search_form.inc.php index 67fba139..d43dcb5d 100644 --- a/inc/show_search_form.inc.php +++ b/inc/show_search_form.inc.php @@ -1,12 +1,12 @@ $name) + foreach ($admins as $staff_id => $staff_name) { - echo ''; + echo ''; } ?> From b669e4c0dc32cd27093321f5b622a43bc75199b5 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 22:16:56 -0500 Subject: [PATCH 16/21] #136 Update ticket_list --- inc/ticket_list.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/ticket_list.inc.php b/inc/ticket_list.inc.php index 290b7981..b88049ca 100644 --- a/inc/ticket_list.inc.php +++ b/inc/ticket_list.inc.php @@ -1,12 +1,12 @@ 0) // Print date submitted if ( hesk_show_column('dt') ) { - switch ($hesk_settings['updatedformat']) + switch ($hesk_settings['submittedformat']) { case 1: $ticket['dt'] = hesk_formatDate($ticket['dt']); From 1632cb9c581004e93a67b99afbcb8a13863698b3 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 22:17:02 -0500 Subject: [PATCH 17/21] #136 Update install.php --- install/install.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/install.php b/install/install.php index 514cecef..fb2b5d38 100644 --- a/install/install.php +++ b/install/install.php @@ -1,12 +1,12 @@ Date: Sun, 22 Feb 2015 22:17:08 -0500 Subject: [PATCH 18/21] #136 Update install_functions --- install/install_functions.inc.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/install/install_functions.inc.php b/install/install_functions.inc.php index d9708125..77cbac28 100644 --- a/install/install_functions.inc.php +++ b/install/install_functions.inc.php @@ -1,12 +1,12 @@ Other +$hesk_settings[\'submittedformat\']=\'' . $set['submittedformat'] . '\'; $hesk_settings[\'updatedformat\']=\'' . $set['updatedformat'] . '\'; @@ -721,7 +722,7 @@ Under no circumstance is the removal of copyright headers from the script source TRADEMARK POLICY -HESK is a US registered trademark of Klemen Stirn. Certain usages of the Trademark are fine and no specific permission from the author is needed: +HESK is a US and EU registered trademark of Klemen Stirn. Certain usages of the Trademark are fine and no specific permission from the author is needed: - there is no commercial intent behind the use @@ -887,7 +888,7 @@ function hesk_iFooter() global $hesk_settings; ?> -

 
Powered by Help Desk Software HESK - brought to you by Help Desk Software SysAid

+

 
Powered by Help Desk Software HESK, brought to you by SysAid

From 4ec52a3b200033b6c4366c071790010297e4452c Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 22:17:18 -0500 Subject: [PATCH 19/21] #136 Update language file --- language/en/text.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/language/en/text.php b/language/en/text.php index 94ea32b6..8288c811 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -2,7 +2,7 @@ /* * Language file for Help Desk Software HESK (www.hesk.com) * Language: ENGLISH -* Version: 2.6.0 beta 1 from 30th December 2014 +* Version: 2.6.0 * Author: Klemen Stirn (http://www.hesk.com) * * !!! This file must be saved in UTF-8 encoding without byte order mark (BOM) !!! @@ -1349,7 +1349,8 @@ $hesklang['ms09']='Sep'; $hesklang['ms10']='Oct'; $hesklang['ms11']='Nov'; $hesklang['ms12']='Dec'; -$hesklang['lcf']='List date format'; +$hesklang['sdf']='Submitted date format'; +$hesklang['lcf']='Updated date format'; $hesklang['lcf0']='Short descriptive'; $hesklang['lcf1']='Date and time'; $hesklang['lcf2']='HESK style'; @@ -1367,8 +1368,8 @@ $hesklang['ticket_tpl_saved']='Your ticket template has been saved for future us $hesklang['ticket_tpl_removed']='Selected ticket template has been removed from the database'; $hesklang['ticket_tpl_not_found']='Ticket template not found'; $hesklang['sel_ticket_tpl']='Select the ticket template you would like to edit'; -$hesklang['ent_ticket_tpl_title']='Please enter reply title'; -$hesklang['ent_ticket_tpl_msg']='Please enter reply message'; +$hesklang['ent_ticket_tpl_title']='Please enter template title'; +$hesklang['ent_ticket_tpl_msg']='Please enter template message'; $hesklang['ticket_tpl_id']='Missing ticket template ID'; $hesklang['select_ticket_tpl']='Select a ticket template'; $hesklang['list_tickets_cat']='List all tickets in this category'; @@ -1397,7 +1398,7 @@ $hesklang['ednote2']='Note message saved'; $hesklang['perm_deny']='Permission denied'; $hesklang['mis_note']='Missing note ID'; $hesklang['no_note']='Note with this ID not found'; -$hesklang['save_reply']='Save and continue later'; +$hesklang['sacl']='Save and continue later'; $hesklang['reply_saved']='Your reply message has been saved for later.'; $hesklang['submit_as']='Submit as:'; $hesklang['sasc']='Submit as Customer reply'; @@ -1428,7 +1429,7 @@ $hesklang['email_unbanned']='Email ban deleted'; $hesklang['banby']='Banned by'; $hesklang['delban']='Delete ban'; $hesklang['delban_confirm']='Delete this ban?'; -$hesklang['baned_e']='You have been banned from submiting new support tickets.'; +$hesklang['baned_e']='You have been banned from submitting new support tickets.'; $hesklang['baned_ip']='You have been banned from this help desk'; $hesklang['can_ban_emails']='Can ban emails'; $hesklang['can_unban_emails']='Can unban emails (enables Can ban emails)'; @@ -1527,6 +1528,9 @@ $hesklang['anyown']='Any owner'; $hesklang['pfr']='Another POP3 fetching task is still in progress.'; $hesklang['pjt']='Task timeout'; $hesklang['pjt2']='minutes after start'; +$hesklang['nkba']='Knowledgebase search requires enough unique articles to work properly.

Consider adding more articles to the knowledgebase to improve search and article suggestion results.'; +$hesklang['saa']='Sticky articles are displayed at the top of articles list'; +$hesklang['yhbr']='You have been locked out the system for %s minutes because of too many replies to a ticket.'; $hesklang['sir']='ReCaptcha V1 API (old)'; $hesklang['sir2']='ReCaptcha V2 API (recommended)'; $hesklang['rcpb']='Site key (Public key)'; From ff355bdf3126b6aeac0d3ac1e3165709ce9f022d Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 22:17:27 -0500 Subject: [PATCH 20/21] #136 Update javascript / CSS --- hesk_javascript.js | 8 ++++---- hesk_style.css | 4 ++-- hesk_style_RTL.css | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hesk_javascript.js b/hesk_javascript.js index facdd230..53abee94 100644 --- a/hesk_javascript.js +++ b/hesk_javascript.js @@ -1,11 +1,11 @@ /******************************************************************************* * Title: Help Desk Software HESK -* Version: 2.6.0 beta 1 from 30th December 2014 +* Version: 2.6.0 from 22nd February 2015 * Author: Klemen Stirn * Website: http://www.hesk.com ******************************************************************************** * COPYRIGHT AND TRADEMARK NOTICE -* Copyright 2005-2014 Klemen Stirn. All Rights Reserved. +* Copyright 2005-2015 Klemen Stirn. All Rights Reserved. * HESK is a registered trademark of Klemen Stirn. * The HESK may be used and modified free of charge by anyone @@ -323,7 +323,7 @@ function hesk_checkPassword(password) var numbers = "0123456789"; var lowercase = "abcdefghijklmnopqrstuvwxyz"; var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - var punctuation = "!.@$L#*()%~<>{}[]"; + var punctuation = "!.@$#*()%~<>{}[]"; var combinations = 0; @@ -346,7 +346,7 @@ function hesk_checkPassword(password) var totalCombinations = Math.pow(combinations, password.length); var timeInSeconds = (totalCombinations / 200) / 2; var timeInDays = timeInSeconds / 86400 - var lifetime = 3650; + var lifetime = 365000; var percentage = timeInDays / lifetime; var friendlyPercentage = hesk_cap(Math.round(percentage * 100), 98); diff --git a/hesk_style.css b/hesk_style.css index 56c11b6f..99749089 100644 --- a/hesk_style.css +++ b/hesk_style.css @@ -485,8 +485,8 @@ div.success { } div.notice { - border: 1px solid #fcefa1; - background: #fbf9ee; + border: 1px solid #fcefa1; + background: #fff9de; color: #363636; padding: 10px; vertical-align: middle; diff --git a/hesk_style_RTL.css b/hesk_style_RTL.css index d866def8..8a390bdd 100644 --- a/hesk_style_RTL.css +++ b/hesk_style_RTL.css @@ -486,7 +486,7 @@ div.success { div.notice { border: 1px solid #fcefa1; - background: #fbf9ee; + background: #fff9de; color: #363636; padding: 10px; vertical-align: middle; From f562b591453514c5a0cbef6e475f9544815563c7 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 22 Feb 2015 22:17:38 -0500 Subject: [PATCH 21/21] #136 Update reply_ticket --- reply_ticket.php | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/reply_ticket.php b/reply_ticket.php index 7bcec0da..166c98fb 100644 --- a/reply_ticket.php +++ b/reply_ticket.php @@ -1,12 +1,12 @@ NOW() LIMIT 1"); +if (hesk_dbNumRows($res) == 1) +{ + if (hesk_dbResult($res) >= $hesk_settings['attempt_limit']) + { + unset($_SESSION); + hesk_error( sprintf($hesklang['yhbb'],$hesk_settings['attempt_banmin']) , 0); + } +} + /* Get details about the original ticket */ $res = hesk_dbQuery("SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE `trackid`='{$trackingID}' LIMIT 1"); if (hesk_dbNumRows($res) != 1) @@ -154,6 +165,22 @@ if ($ticket['locked']) exit(); } +// Prevent flooding ticket replies +$res = hesk_dbQuery("SELECT `staffid` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` WHERE `replyto`='{$ticket['id']}' AND `dt` > DATE_SUB(NOW(), INTERVAL 10 MINUTE) ORDER BY `id` ASC"); +if (hesk_dbNumRows($res) > 0) +{ + $sequential_customer_replies = 0; + while ($tmp = hesk_dbFetchAssoc($res)) + { + $sequential_customer_replies = $tmp['staffid'] ? 0 : $sequential_customer_replies + 1; + } + if ($sequential_customer_replies > 10) + { + hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."logins` (`ip`, `number`) VALUES ('".hesk_dbEscape($_SERVER['REMOTE_ADDR'])."', ".intval($hesk_settings['attempt_limit'] + 1).")"); + hesk_error( sprintf($hesklang['yhbr'],$hesk_settings['attempt_banmin']) , 0); + } +} + /* Insert attachments */ if ($hesk_settings['attachments']['use'] && !empty($attachments)) {