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')) {
- 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 = ' + 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); diff --git a/admin/edit_post.php b/admin/edit_post.php index dff99545..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"); } @@ -223,7 +229,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
- + '; + } ?>
@@ -471,6 +479,10 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ?>
+ + 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)) { 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'] . '
  • '; } 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 = ''; 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 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'] . '
  • '; } 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 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'] . '

    '; + } + ?> +
    +

    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/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 ''; } ?> 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 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 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();