diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index ab04844b46e360fc20483f39e03ff39cdba823ff..2c832a6e79dfb508812e38627a5a3d3acdfa40ac 100644 (file)
{
#FIXME: bad idea about referencing global variables from within classes
global $config;
{
#FIXME: bad idea about referencing global variables from within classes
global $config;
+ if(!isset($config) || !$config){
+ $config = session::global_get('config');
+ }
// Detect timeout
if($timeout == null){
// Detect timeout
if($timeout == null){
- $timeout = $config->get_cfg_value("gosaSupportTimeout",15);
+ $timeout = $config->get_cfg_value("core","gosaSupportTimeout",15);
}
/* This should only be the case if we call this from setup.
}
/* This should only be the case if we call this from setup.
if(!is_object($config)) { return; }
# load from config, store statically
if(!is_object($config)) { return; }
# load from config, store statically
- if ($config->get_cfg_value("gosaSupportURI") != ""){
+ if ($config->get_cfg_value("core","gosaSupportURI") != ""){
if ($this->s_host == ""){
if ($this->s_host == ""){
- $this->s_host= preg_replace("/^.*@([^:]+):.*$/", "$1", $config->get_cfg_value("gosaSupportURI"));
- $this->i_port= preg_replace("/^.*@[^:]+:(.*)$/", "$1", $config->get_cfg_value("gosaSupportURI"));
- $this->s_encryption_key = preg_replace("/^(.*)@[^:]+:.*$/", "$1", $config->get_cfg_value("gosaSupportURI"));
+ $this->s_host= preg_replace("/^.*@([^:]+):.*$/", "$1", $config->get_cfg_value("core","gosaSupportURI"));
+ $this->i_port= preg_replace("/^.*@[^:]+:(.*)$/", "$1", $config->get_cfg_value("core","gosaSupportURI"));
+ $this->s_encryption_key = preg_replace("/^(.*)@[^:]+:.*$/", "$1", $config->get_cfg_value("core","gosaSupportURI"));
}
$this->is_configured = TRUE;
$this->f_timeout = $timeout;
}
$this->is_configured = TRUE;
$this->f_timeout = $timeout;
}
@DEBUG(DEBUG_SI, $line, "<b>".$class."::".$function."</b>" , $file, "<i>".htmlentities($data)."</i>", $info="");
}
@DEBUG(DEBUG_SI, $line, "<b>".$class."::".$function."</b>" , $file, "<i>".htmlentities($data)."</i>", $info="");
+ $start = microtime(1);
/*******
Start sending data
/*******
Start sending data
/* Check if something went wrong while reading */
if($this->o_sock->is_error()){
$this->set_error($this->o_sock->get_error());
/* Check if something went wrong while reading */
if($this->o_sock->is_error()){
$this->set_error($this->o_sock->get_error());
+ @DEBUG(DEBUG_SI, $line, "<b>".$class."::".$function."</b>" , $file, sprintf('%.7f', microtime(1) - $start) , "<b>FAILED Duration:</b>");
return($ret);
}
return($ret);
}
array($data=>$data),"Fire & forget, not result.! ".$this->get_error());
}
}
array($data=>$data),"Fire & forget, not result.! ".$this->get_error());
}
}
+
+ @DEBUG(DEBUG_SI, $line, "<b>".$class."::".$function."</b>" , $file, sprintf('%.7f', microtime(1) - $start) , "<b>Duration:</b>");
return($ret);
}
return($ret);
}
function clean_queue_from_mac($mac)
{
global $config;
function clean_queue_from_mac($mac)
{
global $config;
+ if(!isset($config) || !$config){
+ $config = session::global_get('config');
+ }
/* First of all we have to check which jobs are startet
* for $mac
/* First of all we have to check which jobs are startet
* for $mac
$tmp->add_targets(array($mac));
$tmp->set_type(TRIGGERED_EVENT);
if(!$this->append($tmp)){
$tmp->add_targets(array($mac));
$tmp->set_type(TRIGGERED_EVENT);
if(!$this->append($tmp)){
- msg_dialog::display(_("Error"), sprintf(_("Cannot send abort event for entry %s!"),$entry['ID']) , ERROR_DIALOG);
+ msg_dialog::display(_("Error"), sprintf(_("Cannot send abort event for entry %s!"), bold($entry['ID'])) , ERROR_DIALOG);
new log("debug","DaemonEvent ", "gosaSupportDaemon::clean_queue_from_mac()", array($mac => $mac),
"FAILED, could not send 'DaemonEvent_faireboot' for entry ID (".$entry['ID'].") - ".$this->get_error());
}else{
new log("debug","DaemonEvent ", "gosaSupportDaemon::clean_queue_from_mac()", array($mac => $mac),
"FAILED, could not send 'DaemonEvent_faireboot' for entry ID (".$entry['ID'].") - ".$this->get_error());
}else{
* Failed or waiting events, can be removed without any trouble.
*/
if(!$this->remove_entries(array($entry['ID']))){
* Failed or waiting events, can be removed without any trouble.
*/
if(!$this->remove_entries(array($entry['ID']))){
- msg_dialog::display(_("Error"), sprintf(_("Cannot remove entry %s!"),$entry['ID']) , ERROR_DIALOG);
+ msg_dialog::display(_("Error"), sprintf(_("Cannot remove entry %s!"), bold($entry['ID'])) , ERROR_DIALOG);
}
;break;
}
}
;break;
}