From c5e24c85a781354c36134bc7d833540434d384be Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 30 Jan 2008 06:46:40 +0000 Subject: [PATCH] Moved function to suport daemon class git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8639 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../include/class_daemonCommunicator.inc | 40 ------------------- gosa-core/include/class_gosaSupportDaemon.inc | 19 ++++++++- 2 files changed, 18 insertions(+), 41 deletions(-) delete mode 100644 gosa-core/include/class_daemonCommunicator.inc diff --git a/gosa-core/include/class_daemonCommunicator.inc b/gosa-core/include/class_daemonCommunicator.inc deleted file mode 100644 index b1bcd8355..000000000 --- a/gosa-core/include/class_daemonCommunicator.inc +++ /dev/null @@ -1,40 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -class daemonCommunicator -{ - static function send($header, $to, $data= array()) - { - $xml_message= ""; - - /* Get communication object */ - $d= new gosaSupportDaemon(TRUE,10); - - /* Prepare data */ - foreach ($data as $key => $value){ - $xml_message.= "<$key>$value"; - } - - return $d->send("
$header
$to".$xml_message."
"); - } -} - -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?> diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index 944e1fa2d..bd5766367 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -534,7 +534,7 @@ class gosaSupportDaemon /*! \brief Returns an array containing all queued entries. @return Array All queued entries as an array. */ - public function send($data, $answer_expected= FALSE) + public function _send($data, $answer_expected= FALSE) { $this->b_error = FALSE; $this->s_error = ""; @@ -553,6 +553,23 @@ class gosaSupportDaemon return($ret); } + + static function send($header, $to, $data= array()) + { + $xml_message= ""; + + /* Get communication object */ + $d= new gosaSupportDaemon(TRUE,10); + + /* Prepare data */ + foreach ($data as $key => $value){ + $xml_message.= "<$key>$value"; + } + + return $d->_send("
$header
$to".$xml_message."
"); + } + + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -- 2.30.2