Nicolas Daems

How-To - Customize UserCheck Page to send email and report issue

Discussion created by Nicolas Daems on Sep 20, 2017

Hi,

 

Few months ago we developped a small hack in UserCheck in order to send an email and report wrongly categorized website to Helpdesk team.

 

 

Please find the way if you're looking for such feature (Compatible in R77.30 & R80.x)

 

  • UserCheck portal relies on a javascript library stored on the Gateway.
  • Edit this files on the Gateways 
    • vi /opt/CPUserCheckPortal/htdocs/UserCheck/js/UCTools
  • Add your javascript fonction which will collect info and send email from User Application

 

function submitform()
{
// Possible Values
// [user_name] => UserName ()
// [orig_url] => http://www.facebook.com/
// [resource_hmac] => 64f1ca1aebff4e9d58c40b8e5db920450777c5f08660ebace3fd0d31d9dde7a8
// [resource] => http://www.facebook.com/
// [application_name] => Facebook
// [application_id] => 10080872
// [category] => Social Networking
// [product] => apcl
// [version] => r7520
// [src_ip] => 172.16.1.200
// [incident_id] => 8A1F15DF-6D72-6F67-6F76-696E97150744
// [application_name_orig] => Facebook

var Variables = window.oUserAction.incidentObject.Variables;
var user_name = Variables['user_name'];
var category = Variables['category'];
var origUrl = Variables['resource'];

//Get the application name. If this variable has been modified (added application icon for example), take the original.
var appname = Variables['application_name_orig'];
if(appname === undefined)
appname = Variables['application_name'];

var link = "mailto:helpdesk@mydomain.com"
+ "&subject=" + escape("Page Blocked")
+ "&body=" + escape("Username: " + user_name + "\r\n" + "URL: " + origUrl + "\r\n" + "Application : " + appname + "\r\n" + "Category : " + category + "\r\n");

window.location.href = link;
}

 

  • Save the file. In case of Upgrade this file will be overwrited
  • Last modification has to be done in the UserCheck Page via the SmartConsole.
  • Edit the UserCheck Page and and the following code to call the Javascript function
    • <a href="javascript: submitform();">Request</a>

Outcomes