diff --git a/admin/admin_settings.php b/admin/admin_settings.php index 7967ca47..63e291b0 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -465,6 +465,31 @@ $modsForHesk_settings = mfh_getSettings(); ?> + + + / + + + + ' . $hesklang['exists'] . ', '; + if ($attachmentsWritable) { + $enable_use_attachments = 1; + echo '' . $hesklang['writable'] . ''; + } else { + echo '' . $hesklang['not_writable'] . '
' . $hesklang['e_cdir']; + } + } else { + echo '' . $hesklang['no_exists'] . ', ' . $hesklang['not_writable'] . '
' . $hesklang['e_cdir']; + } + ?> + + @@ -798,6 +823,20 @@ $modsForHesk_settings = mfh_getSettings(); value=""/> +
+ + +
+ +
+
- - - - -
-
+ + + + + +
+
@@ -2015,8 +2011,8 @@ function new_article() $content = hesk_getHTML( hesk_POST('content') ); // Clean the HTML code - require(HESK_PATH . 'inc/htmlpurifier/HTMLPurifier.php'); - $purifier = new HeskHTMLPurifier(); + require(HESK_PATH . 'inc/htmlpurifier/HeskHTMLPurifier.php'); + $purifier = new HeskHTMLPurifier($hesk_settings['cache_dir']); $content = $purifier->heskPurify($content); } else diff --git a/admin/service_messages.php b/admin/service_messages.php index 5e8d0978..7ee9ba1c 100644 --- a/admin/service_messages.php +++ b/admin/service_messages.php @@ -492,7 +492,7 @@ function save_sm() // Clean the HTML code require(HESK_PATH . 'inc/htmlpurifier/HeskHTMLPurifier.php'); - $purifier = new HeskHTMLPurifier(); + $purifier = new HeskHTMLPurifier($hesk_settings['cache_dir']); $message = $purifier->heskPurify($message); // Any errors? @@ -661,7 +661,7 @@ function new_sm() // Clean the HTML code require(HESK_PATH . 'inc/htmlpurifier/HeskHTMLPurifier.php'); - $purifier = new HeskHTMLPurifier(); + $purifier = new HeskHTMLPurifier($hesk_settings['cache_dir']); $message = $purifier->heskPurify($message); // Any errors? diff --git a/css/mods-for-hesk-new.css b/css/mods-for-hesk-new.css index ed39b438..3881aa10 100644 --- a/css/mods-for-hesk-new.css +++ b/css/mods-for-hesk-new.css @@ -172,4 +172,8 @@ button.dropdown-submit { .timeline-header.header-info { font-size: 14px !important; +} + +.full-width { + width: 100%; } \ No newline at end of file diff --git a/inc/admin_functions.inc.php b/inc/admin_functions.inc.php index 329d7d4c..ac790bcb 100644 --- a/inc/admin_functions.inc.php +++ b/inc/admin_functions.inc.php @@ -709,3 +709,53 @@ function hesk_checkPermission($feature, $showerror = 1) } } // END hesk_checkPermission() + +function hesk_purge_cache($type = '', $expire_after_seconds = 0) +{ + global $hesk_settings; + + $cache_dir = dirname(dirname(__FILE__)).'/'.$hesk_settings['cache_dir'].'/'; + + if ( ! is_dir($cache_dir)) + { + return false; + } + + switch ($type) + { + case 'export': + $files = glob($cache_dir.'hesk_export_*', GLOB_NOSORT); + break; + case 'status': + $files = glob($cache_dir.'status_*', GLOB_NOSORT); + break; + case 'cf': + $files = glob($cache_dir.'cf_*', GLOB_NOSORT); + break; + default: + hesk_rrmdir(trim($cache_dir, '/'), true); + return true; + } + + if (is_array($files)) + { + array_walk($files, 'hesk_unlink_callable', $expire_after_seconds); + } + + return true; + +} // END hesk_purge_cache() + + +function hesk_rrmdir($dir, $keep_top_level=false) +{ + $files = $keep_top_level ? array_diff(scandir($dir), array('.','..','index.htm')) : array_diff(scandir($dir), array('.','..')); + + foreach ($files as $file) + { + (is_dir("$dir/$file")) ? hesk_rrmdir("$dir/$file") : @unlink("$dir/$file"); + } + + return $keep_top_level ? true : @rmdir($dir); + +} // END hesk_rrmdir() diff --git a/inc/common.inc.php b/inc/common.inc.php index 83c8f1df..de31a962 100644 --- a/inc/common.inc.php +++ b/inc/common.inc.php @@ -246,6 +246,12 @@ function hesk_unlink($file, $older_than = 0) } // END hesk_unlink() +function hesk_unlink_callable($file, $key, $older_than=0) +{ + return hesk_unlink($file, $older_than); +} // END hesk_unlink_callable() + + function hesk_utf8_urldecode($in) { $in = preg_replace("/%u([0-9a-f]{3,4})/i", "&#x\\1;", urldecode($in)); @@ -1726,9 +1732,43 @@ function hesk_check_maintenance($dodie = true)
-

-

- + {$hesklang['hni1']}

+ {$hesklang['hni2']}

+ {$hesklang['hni3']}"; + } + // Hesk appears to be installed, show a "Maintenance in progress" message + else + { + echo " + {$hesklang['mm1']}

+ {$hesklang['mm2']}

+ {$hesklang['mm3']}"; + } + ?>
private ticket into a public $hesklang['tab_1']='General'; $hesklang['tab_2']='Help Desk'; $hesklang['tab_3']='Knowledgebase'; -$hesklang['tab_4']='Custom Fields'; $hesklang['tab_5']='Misc'; $hesklang['disable']='Disable'; $hesklang['dat']='Date & Time'; @@ -1766,7 +1765,6 @@ $hesklang['mm3']='We apologize for the inconvenience and ask that you please try $hesklang['mma1']='Maintenance mode is active!'; $hesklang['mma2']='Customers are not able to use the help desk.'; $hesklang['tools']='Tools'; -$hesklang['banemail']='Banned Emails'; $hesklang['banemail_intro']='Prevent certain email addresses from submitting tickets to your help desk.'; $hesklang['no_banemails']='No emails are being banned.'; $hesklang['eperm']='Permanent email bans:'; @@ -1786,7 +1784,6 @@ $hesklang['can_ban_emails']='Can ban emails'; $hesklang['can_unban_emails']='Can unban emails (enables Can ban emails)'; $hesklang['eisban']='This email address is banned.'; $hesklang['click_unban']='Click here to unban.'; -$hesklang['banip']='Banned IPs'; $hesklang['banip_intro']='Visitors from banned IP addresses will not be able to view or submit tickets and login into the help desk.'; $hesklang['ipperm']='Permanent IP bans:'; $hesklang['iptemp']='Login failure bans:'; @@ -2029,11 +2026,11 @@ $hesklang['clr_view']='Color preview on text'; $hesklang['cbc']='Changeable by customers'; $hesklang['ccc']='Can customers change this status?'; $hesklang['del_status']='Delete this status?'; -$hesklang['ex_status']='Existing Statuses'; +$hesklang['ex_status']='Existing statuses'; $hesklang['status_hesk']='Built-in Statuses (cannot be modified here)'; $hesklang['status_custom']='Custom Statuses'; $hesklang['status_custom_none']='No custom statuses. You can add them using the form above.'; -$hesklang['status_save']='Save Status'; +$hesklang['status_save']='Save status'; $hesklang['list_tkt_status']='List all tickets with this status'; $hesklang['new_status']='New custom status'; $hesklang['edit_status']='Edit custom status'; @@ -2051,6 +2048,21 @@ $hesklang['frames2']='Prevent loading HESK in frames on third party domains'; $hesklang['numsub']='Submitted tickets'; // Will show how many tickets this user submitted $hesklang['hidf']='Hidden inputs are not visible to customers on the Submit a ticket form (the value will still be visible on ticket details page if they are set as public). They behave as normal text fields for staff members.'; $hesklang['rcheck']='Do not select a default option'; +$hesklang['refresh_page']='Refresh this page'; +$hesklang['banemail']='Ban emails'; +$hesklang['banip']='Ban IPs'; +$hesklang['tab_4']='Custom fields'; +$hesklang['del_kba']='Delete this article'; +$hesklang['del_kbaa']='Permanently delete this article'; +$hesklang['hni1']='HESK not installed yet?'; +$hesklang['hni2']='It appears that this help desk has not been properly installed and configured yet.'; +$hesklang['hni3']='To install HESK, follow Instructions in the documentation'; +$hesklang['cf']='Cache folder'; +$hesklang['e_cdir']='Hesk will not be able to parse emails or cache results unless the cache folder exists and is writable.'; +$hesklang['step1']='Step 1'; +$hesklang['step2']='Step 2'; +$hesklang['dffs']='When download completes, delete the file from server'; +$hesklang['fd']='Export file deleted from server'; // DO NOT CHANGE BELOW if (!defined('IN_SCRIPT')) die('PHP syntax OK!'); diff --git a/ticket.php b/ticket.php index a794cefd..3542bcc8 100644 --- a/ticket.php +++ b/ticket.php @@ -259,9 +259,15 @@ if (!$show['show']) {
-
+

+
@@ -284,7 +290,8 @@ if (!$show['show']) { echo '' . $hesklang['close_action'] . ''; } } - ?>

+ ?> +