From ee9718f44eff5ef6447e134e04179026437be42f Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 31 Oct 2015 20:50:24 -0400 Subject: [PATCH 01/17] Fixes #405 Retrieve settings at global level --- admin/manage_knowledgebase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/manage_knowledgebase.php b/admin/manage_knowledgebase.php index f7dd1290..44162e0b 100644 --- a/admin/manage_knowledgebase.php +++ b/admin/manage_knowledgebase.php @@ -49,6 +49,8 @@ hesk_session_start(); hesk_dbConnect(); hesk_isLoggedIn(); +$modsForHesk_settings = mfh_getSettings(); + /* Check permissions for this feature */ if ( ! hesk_checkPermission('can_man_kb',0)) { From 30562fbc876196ecad39e3d966fa99d7b8ac4ab0 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 8 Nov 2015 17:29:43 -0500 Subject: [PATCH 02/17] Fixes #419 Fix footer on lockout screen --- inc/common.inc.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/inc/common.inc.php b/inc/common.inc.php index 62406c11..90dbf58e 100644 --- a/inc/common.inc.php +++ b/inc/common.inc.php @@ -1607,18 +1607,20 @@ function hesk_error($error, $showback = 1)
-
-
- :

-  

-

' . $hesklang['warn'] . '
' . $hesklang['dmod'] . '

'; - } - ?> +
+
+ :

+  

+

' . $hesklang['warn'] . '
' . $hesklang['dmod'] . '

'; + } + ?> +
+

From 430087e5338f488b79d8ca8a3d8f98ee847ace61 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 15 Nov 2015 12:05:36 -0500 Subject: [PATCH 03/17] #405 Fallback to ticket attachments folder for legacy KB attachments --- download_attachment.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/download_attachment.php b/download_attachment.php index e3ffe949..59ec5758 100755 --- a/download_attachment.php +++ b/download_attachment.php @@ -127,7 +127,12 @@ if (isset($_GET['kb_att'])) { // Perhaps the file has been deleted? if (!file_exists($realpath)) { - hesk_error($hesklang['attdel']); + // Let's try the ticket attachment folder. Legacy KB attachments are not automatically migrated. + $realpath = $hesk_settings['attach_dir'] . '/' . $file['saved_name']; + + if (!file_exists($realpath)) { + hesk_error($hesklang['attdel']); + } } // Update the download count @@ -161,5 +166,4 @@ if ($file['size'] > $chunksize) { readfile($realpath); } -exit(); -?> +exit(); \ No newline at end of file From 4a87f9e74b4a54dcdbe2b9477aaf8f503b8972b0 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 15 Nov 2015 12:27:28 -0500 Subject: [PATCH 04/17] Fixes #423 remove extra call to load DB functions --- admin/password.php | 1 - 1 file changed, 1 deletion(-) diff --git a/admin/password.php b/admin/password.php index 5540e5a7..7160f936 100644 --- a/admin/password.php +++ b/admin/password.php @@ -172,7 +172,6 @@ elseif (isset($_GET['h'])) { $hash = preg_replace('/[^a-zA-Z0-9]/', '', $_GET['h']); // Connect to database - hesk_load_database_functions(); hesk_dbConnect(); // Expire verification hashes older than 2 hours From 45caec4de8505699f85c3d2db5d35ae399da43c4 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 15 Nov 2015 15:05:23 -0500 Subject: [PATCH 05/17] Fixes #416 fix markup for banned emails --- admin/banned_emails.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/banned_emails.php b/admin/banned_emails.php index ae335d5f..29bc5f61 100644 --- a/admin/banned_emails.php +++ b/admin/banned_emails.php @@ -207,7 +207,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); if ($can_unban) { echo ' - From 1f5827d5a105f2e0bb5a6a5ee22bfd334c750971 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 15 Nov 2015 15:25:36 -0500 Subject: [PATCH 06/17] Fixes #415 Retain language when editing ticket --- admin/edit_post.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/edit_post.php b/admin/edit_post.php index dff99545..3eb638b6 100644 --- a/admin/edit_post.php +++ b/admin/edit_post.php @@ -223,7 +223,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
- + '; + } ?>
From acf6ff31234c3ec4bbf8e359911b6a8bac157cd7 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 15 Nov 2015 15:48:55 -0500 Subject: [PATCH 07/17] Fixes #417 Update HTML property when editing ticket/reply --- admin/edit_post.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/admin/edit_post.php b/admin/edit_post.php index 3eb638b6..9dea3f01 100644 --- a/admin/edit_post.php +++ b/admin/edit_post.php @@ -107,13 +107,16 @@ if (isset($_POST['save'])) { $tmpvar['message'] = nl2br($tmpvar['message']); } - hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` SET `message`='" . hesk_dbEscape($tmpvar['message']) . "' WHERE `id`='" . intval($tmpvar['id']) . "' AND `replyto`='" . intval($ticket['id']) . "' LIMIT 1"); + $tmpvar['html'] = hesk_POST('html'); + + hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` SET `html`='" . $tmpvar['html'] . "', `message`='" . hesk_dbEscape($tmpvar['message']) . "' WHERE `id`='" . intval($tmpvar['id']) . "' AND `replyto`='" . intval($ticket['id']) . "' LIMIT 1"); } else { $tmpvar['language'] = hesk_POST('customerLanguage'); $tmpvar['name'] = hesk_input(hesk_POST('name')) or $hesk_error_buffer[] = $hesklang['enter_your_name']; $tmpvar['email'] = hesk_validateEmail(hesk_POST('email'), 'ERR', 0); $tmpvar['subject'] = hesk_input(hesk_POST('subject')) or $hesk_error_buffer[] = $hesklang['enter_ticket_subject']; $tmpvar['message'] = hesk_input(hesk_POST('message')) or $hesk_error_buffer[] = $hesklang['enter_message']; + $tmpvar['html'] = hesk_POST('html'); // Demo mode if (defined('HESK_DEMO')) { @@ -129,8 +132,10 @@ if (isset($_POST['save'])) { hesk_error($myerror); } - $tmpvar['message'] = hesk_makeURL($tmpvar['message']); - $tmpvar['message'] = nl2br($tmpvar['message']); + if (!$tmpvar['html']) { + $tmpvar['message'] = hesk_makeURL($tmpvar['message']); + $tmpvar['message'] = nl2br($tmpvar['message']); + } foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && isset($_POST[$k])) { @@ -175,7 +180,8 @@ if (isset($_POST['save'])) { `custom18`='" . hesk_dbEscape($tmpvar['custom18']) . "', `custom19`='" . hesk_dbEscape($tmpvar['custom19']) . "', `custom20`='" . hesk_dbEscape($tmpvar['custom20']) . "', - `language`='" . hesk_dbEscape($tmpvar['language']) . "' + `language`='" . hesk_dbEscape($tmpvar['language']) . "', + `html`='" . hesk_dbEscape($tmpvar['html']) . "' WHERE `id`='" . intval($ticket['id']) . "' LIMIT 1"); } @@ -473,6 +479,10 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ?>
+ + From bb653f013131fe9479598e005bb98654e75ce200 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 16 Nov 2015 12:16:41 -0500 Subject: [PATCH 08/17] #424 Fix custom field query string parsing on admin side --- admin/new_ticket.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/new_ticket.php b/admin/new_ticket.php index 519e257d..74d23344 100644 --- a/admin/new_ticket.php +++ b/admin/new_ticket.php @@ -344,13 +344,13 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) { $k_value[] = stripslashes(hesk_input($myCB)); } } - } elseif (isset($_SESSION["c_$k"])) { - $k_value = stripslashes(hesk_input($_SESSION["c_$k"])); - } elseif (isset($_GET["c_$k"])) { + } elseif (isset($_SESSION["as_$k"])) { + $k_value = stripslashes(hesk_input($_SESSION["as_$k"])); + } elseif (isset($_GET["as_$k"])) { if ($v['type'] == 'checkbox') { - $k_value = explode('-CHECKBOX-', $_GET["c_$k"]); + $k_value = explode('-CHECKBOX-', $_GET["as_$k"]); } else { - $k_value = stripslashes(hesk_GET("c_$k")); + $k_value = stripslashes(hesk_GET("as_$k")); } } else { $k_value = ''; From 276a0906bd8f7111469dee5b9e3298ab1ce58593 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 16 Nov 2015 12:29:35 -0500 Subject: [PATCH 09/17] #420 Update ticket status before sending email --- admin/change_status.php | 1 + 1 file changed, 1 insertion(+) diff --git a/admin/change_status.php b/admin/change_status.php index c5fd953d..29cfa8ec 100644 --- a/admin/change_status.php +++ b/admin/change_status.php @@ -89,6 +89,7 @@ if ($statusRow['IsClosed']) // Closed hesk_error($hesklang['ticket_not_found']); } $ticket = hesk_dbFetchAssoc($result); + $ticket['status'] = $status; $ticket['dt'] = hesk_date($ticket['dt'], true); $ticket['lastchange'] = hesk_date($ticket['lastchange'], true); $ticket = hesk_ticketToPlain($ticket, 1, 0); From f179d6c1e23dd80b268bffd269cfa47955213a4a Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 16 Nov 2015 12:46:20 -0500 Subject: [PATCH 10/17] #435 Save mailgun settings --- admin/admin_settings_save.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/admin_settings_save.php b/admin/admin_settings_save.php index cf0c44f9..77ec1668 100644 --- a/admin/admin_settings_save.php +++ b/admin/admin_settings_save.php @@ -541,6 +541,9 @@ mfh_updateSetting('questionMarkColor', $set['questionMarkColor'], true); mfh_updateSetting('dropdownItemTextHoverBackgroundColor', $set['dropdownItemTextHoverBackgroundColor'], true); mfh_updateSetting('display_user_agent_information', $set['display_user_agent_information']); mfh_updateSetting('navbar_title_url', $set['navbar_title_url'], true); +mfh_updateSetting('mailgun_api_key', $set['mailgun_api_key'], true); +mfh_updateSetting('mailgun_domain', $set['mailgun_domain'], true); +mfh_updateSetting('use_mailgun', $set['use_mailgun'], false); // Prepare settings file and save it $settings_file_content = ' Date: Wed, 16 Dec 2015 17:21:43 -0500 Subject: [PATCH 11/17] Fixes #450 Keep
s in their proper groups --- index.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 4824a121..9a5f4c69 100644 --- a/index.php +++ b/index.php @@ -1065,7 +1065,8 @@ function print_add_ticket() ?>
+ data-sitekey=""> +
 
' . $hesklang['sec_img'] . ' ' . '' . $hesklang['reload'] . '' . - '
 
'; + '
 
'; } - echo ''; + echo ''; } ?> From 8d581daf80faedc06873dc389bd17452e01e55ae Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 23 Dec 2015 08:08:38 -0500 Subject: [PATCH 12/17] Signatures can be up to 1000 characters --- admin/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/profile.php b/admin/profile.php index 93637154..10e60425 100644 --- a/admin/profile.php +++ b/admin/profile.php @@ -178,7 +178,7 @@ function update_profile() $_SESSION['new']['signature'] = hesk_input(hesk_POST('signature')); /* Signature */ - if (strlen($_SESSION['new']['signature']) > 255) { + if (strlen($_SESSION['new']['signature']) > 1000) { $hesk_error_buffer .= '
  • ' . $hesklang['signature_long'] . '
  • '; } From 43520978829c4ea0581b50f7861b5cdbe59e63f5 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 23 Dec 2015 08:10:22 -0500 Subject: [PATCH 13/17] Signatures can be up to 1000 characters long --- admin/manage_users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/manage_users.php b/admin/manage_users.php index 4e39212b..85635d66 100644 --- a/admin/manage_users.php +++ b/admin/manage_users.php @@ -725,7 +725,7 @@ function hesk_validateUserInfo($pass_required = 1, $redirect_to = './manage_user } } - if (strlen($myuser['signature']) > 255) { + if (strlen($myuser['signature']) > 1000) { $hesk_error_buffer .= '
  • ' . $hesklang['signature_long'] . '
  • '; } From f739780f9e0f3c053f5b9a0323c9362ec34aae00 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 9 Jan 2016 20:55:17 -0500 Subject: [PATCH 14/17] Fixes #457 Move around some database stuff to fix the knowledgebase error --- knowledgebase.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/knowledgebase.php b/knowledgebase.php index daedd989..a2741297 100644 --- a/knowledgebase.php +++ b/knowledgebase.php @@ -36,12 +36,16 @@ require(HESK_PATH . 'hesk_settings.inc.php'); require(HESK_PATH . 'inc/common.inc.php'); require(HESK_PATH . 'inc/knowledgebase_functions.inc.php'); -// Are we in maintenance mode? -hesk_check_maintenance(); // Load Knowledgebase-related functions hesk_load_database_functions(); +/* Connect to database */ +hesk_dbConnect(); + +// Are we in maintenance mode? +hesk_check_maintenance(); + define('PAGE_TITLE', 'CUSTOMER_KB'); /* Is Knowledgebase enabled? */ @@ -49,9 +53,6 @@ if (!$hesk_settings['kb_enable']) { hesk_error($hesklang['kbdis']); } -/* Connect to database */ -hesk_dbConnect(); - /* Rating? */ if (isset($_GET['rating'])) { // Detect and block robots From 8e9e46ec47ae4c78e4910a786672e67b3deae1fa Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 9 Jan 2016 21:01:20 -0500 Subject: [PATCH 15/17] Fix view ticket db issue --- ticket.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ticket.php b/ticket.php index 583c42dd..2960f223 100644 --- a/ticket.php +++ b/ticket.php @@ -40,14 +40,16 @@ require(HESK_PATH . 'hesk_settings.inc.php'); require(HESK_PATH . 'inc/common.inc.php'); require(HESK_PATH . 'inc/view_attachment_functions.inc.php'); -// Are we in maintenance mode? -hesk_check_maintenance(); hesk_load_database_functions(); -hesk_session_start(); /* Connect to database */ hesk_dbConnect(); + +// Are we in maintenance mode? +hesk_check_maintenance(); + +hesk_session_start(); $modsForHesk_settings = mfh_getSettings(); $hesk_error_buffer = array(); From ae0db735a02d7249486532b22709d9610cba6e0c Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 9 Jan 2016 21:23:50 -0500 Subject: [PATCH 16/17] Fixes #456 Use the correct checkbox name --- admin/admin_settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/admin_settings.php b/admin/admin_settings.php index 7d3f1d22..4f719b20 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -2693,7 +2693,7 @@ if (defined('HESK_DEMO')) {
    - From 4d4c29e0aeb77ee2dac650486de50415f1a2ec30 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 9 Jan 2016 21:38:25 -0500 Subject: [PATCH 17/17] Update installer --- inc/header.inc.php | 2 +- inc/headerAdmin.inc.php | 2 +- install/install_functions.inc.php | 2 +- .../ajax/install-database-ajax.php | 2 + install/mods-for-hesk/installModsForHesk.php | 3 ++ install/mods-for-hesk/js/version-scripts.js | 3 ++ install/mods-for-hesk/modsForHesk.php | 54 +++++++++++-------- install/mods-for-hesk/sql/installSql.php | 9 ++++ 8 files changed, 53 insertions(+), 24 deletions(-) diff --git a/inc/header.inc.php b/inc/header.inc.php index 4d6b7933..52eac5ac 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -29,7 +29,7 @@ *******************************************************************************/ // Define the current build -define('MODS_FOR_HESK_BUILD', 23); +define('MODS_FOR_HESK_BUILD', 24); /* Check if this is a valid include */ if (!defined('IN_SCRIPT')) { diff --git a/inc/headerAdmin.inc.php b/inc/headerAdmin.inc.php index f1504330..e1fe927b 100644 --- a/inc/headerAdmin.inc.php +++ b/inc/headerAdmin.inc.php @@ -29,7 +29,7 @@ *******************************************************************************/ // Define the current build -define('MODS_FOR_HESK_BUILD', 23); +define('MODS_FOR_HESK_BUILD', 24); /* Check if this is a valid include */ if (!defined('IN_SCRIPT')) { diff --git a/install/install_functions.inc.php b/install/install_functions.inc.php index 3edade87..9512e75a 100644 --- a/install/install_functions.inc.php +++ b/install/install_functions.inc.php @@ -37,7 +37,7 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');} // We will be installing this HESK version: define('HESK_NEW_VERSION','2.6.5'); -define('MODS_FOR_HESK_NEW_VERSION','2.5.2'); +define('MODS_FOR_HESK_NEW_VERSION','2.5.3'); define('REQUIRE_PHP_VERSION','5.0.0'); define('REQUIRE_MYSQL_VERSION','5.0.7'); diff --git a/install/mods-for-hesk/ajax/install-database-ajax.php b/install/mods-for-hesk/ajax/install-database-ajax.php index b520f934..0ccc408c 100644 --- a/install/mods-for-hesk/ajax/install-database-ajax.php +++ b/install/mods-for-hesk/ajax/install-database-ajax.php @@ -52,6 +52,8 @@ if ($version == 2) { execute251Scripts(); } elseif ($version == 23) { execute252Scripts(); +} elseif ($version == 24) { + execute253Scripts(); } else { $response = 'The version "' . $version . '" was not recognized. Check the value submitted and try again.'; print $response; diff --git a/install/mods-for-hesk/installModsForHesk.php b/install/mods-for-hesk/installModsForHesk.php index 6e293bca..3e9075fb 100644 --- a/install/mods-for-hesk/installModsForHesk.php +++ b/install/mods-for-hesk/installModsForHesk.php @@ -77,6 +77,9 @@ function echoInitialVersionRows($version) if ($version < 23) { printRow('2.5.2'); } + if ($version < 24) { + printRow('2.5.3'); + } } function printRow($version) diff --git a/install/mods-for-hesk/js/version-scripts.js b/install/mods-for-hesk/js/version-scripts.js index 424ef110..6f5c4b2a 100644 --- a/install/mods-for-hesk/js/version-scripts.js +++ b/install/mods-for-hesk/js/version-scripts.js @@ -65,6 +65,9 @@ function processUpdates(startingVersion) { } else if (startingVersion < 23) { startVersionUpgrade('252'); executeUpdate(23, '252', '2.5.2'); + } else if (startingVersion < 24) { + startVersionUpgrade('253'); + executeUpdate(24, '253', '2.5.3'); } else { installationFinished(); } diff --git a/install/mods-for-hesk/modsForHesk.php b/install/mods-for-hesk/modsForHesk.php index 712de220..a95229f9 100644 --- a/install/mods-for-hesk/modsForHesk.php +++ b/install/mods-for-hesk/modsForHesk.php @@ -122,7 +122,7 @@ hesk_dbConnect(); if ($version != MODS_FOR_HESK_NEW_VERSION) { echo '
    '; echo '
    '; - echo '

    Mods for HESK has detected that you currently have ' . $version . ' installed. + echo '

    Mods for HESK has detected that you currently have version ' . $version . ' installed. The button you should click to upgrade has been highlighted for you. However, if Mods for HESK selected the wrong version, click here to reset them.

    '; echo '
    '; @@ -130,6 +130,18 @@ hesk_dbConnect(); } ?>
    +
    + + 2.5.2 +
    btn-block disablable" href="installModsForHesk.php?v=20">2.4.2
    +
    +
    + +
    btn-block disablable" href="installModsForHesk.php?v=19">2.4.1
    -
    -
    - -
    btn-block disablable" href="installModsForHesk.php?v=16">2.3.1
    +
    +
    + +
    btn-block disablable" href="installModsForHesk.php?v=15">2.3.0
    -
    -
    - -
    btn-block disablable" href="installModsForHesk.php?v=12">2.1.1
    +
    +
    + +
    btn-block disablable" href="installModsForHesk.php?v=11">2.1.0
    -
    -
    - -
    btn-block disablable" href="installModsForHesk.php?v=8">1.7.0
    +
    +
    + +
    btn-block disablable" href="installModsForHesk.php?v=7">1.6.1
    -
    -
    - -
    1.4.1
    -
    - 1.4.0 -

    +
    + 1.4.0 +
    1.3.0 diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 57162b37..000a4248 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -693,4 +693,13 @@ function execute252Scripts() hesk_dbConnect(); executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '2.5.2' WHERE `Key` = 'modsForHeskVersion'"); +} + +// Version 2.5.3 +function execute253Scripts() +{ + global $hesk_settings; + hesk_dbConnect(); + + executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '2.5.3' WHERE `Key` = 'modsForHeskVersion'"); } \ No newline at end of file