From 40e97ede1a0e4036444cdf2125e8100724a07a22 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 6 Sep 2015 18:34:58 -0400 Subject: [PATCH] #326 Some more user agent stuff --- admin/admin_submit_ticket.php | 5 +++++ admin/admin_ticket.php | 4 +++- inc/posting_functions.inc.php | 9 ++++++--- index.php | 6 ++++++ submit_ticket.php | 5 +++++ 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/admin/admin_submit_ticket.php b/admin/admin_submit_ticket.php index f73a3496..e3bb1c83 100644 --- a/admin/admin_submit_ticket.php +++ b/admin/admin_submit_ticket.php @@ -281,6 +281,11 @@ $tmpvar['longitude'] = hesk_POST('longitude', 'E-4'); $tmpvar['html'] = $modsForHesk_settings['rich_text_for_tickets']; +// Set user agent and screen res to null +$tmpvar['user_agent'] = NULL; +$tmpvar['screen_resolution_height'] = NULL; +$tmpvar['screen_resolution_width'] = NULL; + // Insert ticket to database $ticket = hesk_newTicket($tmpvar); diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index cf7e9e73..0c2fb373 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -884,7 +884,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); } if ($ticket['user_agent'] !== NULL && $ticket['screen_resolution_height'] !== NULL - && $ticket['screen_resolution_width'] !== NULL): + && $ticket['screen_resolution_height'] != 0 + && $ticket['screen_resolution_width'] !== NULL + && $ticket['screen_resolution_width'] != 0): ?> 1, 'deny_attribute'=>'style')); - $userAgent = $_SERVER["HTTP_USER_AGENT"]; // Insert ticket into database hesk_dbQuery(" @@ -102,7 +101,9 @@ function hesk_newTicket($ticket, $isVerified = true) `latitude`, `longitude`, `html`, - `user_agent` + `user_agent`, + `screen_resolution_height`, + `screen_resolution_width` ) VALUES ( @@ -147,7 +148,9 @@ function hesk_newTicket($ticket, $isVerified = true) '".hesk_dbEscape($ticket['latitude'])."', '".hesk_dbEscape($ticket['longitude'])."', '".hesk_dbEscape($ticket['html'])."', - '".hesk_dbEscape($userAgent)."' + '".hesk_dbEscape($ticket['user_agent'])."', + '".hesk_dbEscape($ticket['screen_resolution_height'])."', + '".hesk_dbEscape($ticket['screen_resolution_width'])."' ) "); diff --git a/index.php b/index.php index 90de1e19..46b5df74 100644 --- a/index.php +++ b/index.php @@ -1055,8 +1055,14 @@ if (!$show['show']) {
+ + +
diff --git a/submit_ticket.php b/submit_ticket.php index 9a763cea..12ab0c23 100644 --- a/submit_ticket.php +++ b/submit_ticket.php @@ -452,6 +452,11 @@ $tmpvar['longitude'] = hesk_POST('longitude'); // Set html $tmpvar['html'] = $modsForHesk_settings['rich_text_for_tickets_for_customers']; +// Set screen res and user agent +$tmpvar['screen_resolution_height'] = hesk_POST('screen_resolution_height'); +$tmpvar['screen_resolution_width'] = hesk_POST('screen_resolution_width'); +$tmpvar['user_agent'] = $_SERVER['HTTP_USER_AGENT']; + // Should the helpdesk validate emails? $createTicket = true; if ($modsForHesk_settings['customer_email_verification_required'])