Files
tomolino-processmaker/js/domain.js.php
tomolimo b59d157cfa Changed way to rewrite helpdeskform form
Added a try/catch statement to prevent javascript error messages when document.domain can't be written
Changed version to 3.2.4
Fixes #45
2018-01-31 15:25:51 +01:00

18 lines
599 B
PHP

<?php
define('GLPI_ROOT','../../..');
include (GLPI_ROOT."/inc/includes.php");
header("Content-type: application/javascript");
$config = PluginProcessmakerConfig::getInstance() ;
if( isset($config->fields['domain']) && $config->fields['domain'] != '' ) {
echo "
//debugger;
var d = document,
g = d.createElement('script'),
s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.text = 'try { document.domain = \'".$config->fields['domain']."\'; } catch(ev) { /*console.log(ev);*/ }';
s.parentNode.insertBefore(g, s);
" ;
}