From 949fefc8f4ffc54c050ec82a2656dbfede2c87b1 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 5 May 2008 09:51:32 +0000 Subject: [PATCH] updated si git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10758 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_gosaSupportDaemon.inc | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index 774d0e633..76c3e7c25 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -1671,6 +1671,77 @@ class gosaSupportDaemon return($this->_send($xml_msg,TRUE) == TRUE && !$this->is_error()); } + + /*! \brief Returns log file informations for a given mac address + @param $mac The mac address to fetch logs for. + @retrun Array A Multidimensional array containing log infos. + MAC_00_01_6C_9D_B9_FA['install_20080311_090900'][0]=debconf.log + MAC_00_01_6C_9D_B9_FA['install_20080311_090900'][1]=syslog.log + install_20080313_144450 ... + */ + public function get_log_info_for_mac($mac) + { + $xml_msg = " + +
gosa_show_log_by_mac
+ GOSA + GOSA + ".$mac." +
"; + + $res = $this->_send($xml_msg,TRUE); + $ret = array(); + if(isset($res['XML'])){ + + /* Filter all entry that look like this + MAC_00_01_6C_9D_B9_FA + */ + foreach($res['XML'] as $name => $entry){ + if(preg_match("/^MAC/",$name)){ + + /* Get list of available log files + */ + foreach($entry as $log_date){ + $xml_msg2 = " +
gosa_show_log_files_by_date_and_mac
+ GOSA + GOSA + ".$log_date." + ".$mac." +
"; + + $ret[$mac][$log_date] = array(); + $res = $this->_send($xml_msg2,TRUE); + $ret[$mac][$log_date]['DATE_STR'] = $log_date; + $ret[$mac][$log_date]['REAL_DATE'] = strtotime(preg_replace("/[^0-9]*/","",$log_date)); + if(isset($res['XML']['SHOW_LOG_FILES_BY_DATE_AND_MAC'])){ + $ret[$mac][$log_date]['FILES'] = $res['XML']['SHOW_LOG_FILES_BY_DATE_AND_MAC']; + } + } + } + } + } + return($ret); + } + + public function get_log_file($mac,$date,$file) + { + $xml_msg =" + +
gosa_get_log_file_by_date_and_mac
+ GOSA + GOSA + ".$date." + ".$mac." + ".$file." +
"; + + $res = $this->_send($xml_msg,TRUE); + if(isset($res['XML'][strtoupper($file)])){ + return(base64_decode($res['XML'][strtoupper($file)])); + } + return(""); + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -- 2.30.2