2017-04-28 14:57:49 +02:00
|
|
|
<?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';
|
2018-01-31 15:25:51 +01:00
|
|
|
g.text = 'try { document.domain = \'".$config->fields['domain']."\'; } catch(ev) { /*console.log(ev);*/ }';
|
2017-04-28 14:57:49 +02:00
|
|
|
s.parentNode.insertBefore(g, s);
|
|
|
|
|
" ;
|
|
|
|
|
}
|