summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82b1dab)
raw | patch | inline | side by side (parent: 82b1dab)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Aug 2008 12:33:36 +0000 (12:33 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Aug 2008 12:33:36 +0000 (12:33 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12244 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/opsi/admin/opsi/class_opsi.inc | patch | blob | history | |
gosa-plugins/opsi/admin/opsi/class_opsi_generic.inc | [new file with mode: 0644] | patch | blob |
gosa-plugins/opsi/admin/opsi/opsi_tabs.inc | [new file with mode: 0644] | patch | blob |
diff --git a/gosa-plugins/opsi/admin/opsi/class_opsi.inc b/gosa-plugins/opsi/admin/opsi/class_opsi.inc
index 4425391381b8298cf19d02bc94081baee1168b36..e41133b6d3209fd04d21972a3ca6b730dc791bbd 100644 (file)
/*! \brief This is the opsi base class, it handles
. gosa daemon requests and prepares data for opsi plugins.
*/
-class opsi
+class opsi extends gosaSupportDaemon
{
+ private $config = NULL;
+
+ /*! \brief Create opsi object.
+ @param
+ @return
+ */
+ public function __construct($config)
+ {
+ $this->config = $config;
+ gosaSupportDaemon::__construct($config);
+ $this->target = "00:01:6c:9d:b9:fa";
+ }
+
+ /******************
+ Opsi handling
+ ******************/
+
+ function get_hosts_for_system_management()
+ {
+ $res = $this->list_clients();
+
+ $data = array();
+ foreach($res as $entry){
+ $data[] = array(
+ "dn" => "opsi:=".$entry['NAME'].",".get_ou("winstations").$this->config->current['BASE'],
+ "objectClass" => array("gosa_opsi_client"),
+ "cn" => array(0 => $entry['NAME']),
+ "description" => array(0 => $entry['DESCRIPTION']),
+ "macAddress" => array(0 => $entry['MAC']),
+ "opsi_notes" => array(0 => $entry['NOTES']));
+
+ }
+
+ return($data);
+ }
+
+
+ /******************
+ SI Communication functions
+ ******************/
/*! \brief Returns a list of netboot products.
@param
@return
*/
- public static function opsi_get_netboot_products()
+ public function get_netboot_products($host = "")
{
- /* <xml>
- <header>gosa_opsi_get_netboot_products</header>
- <source>GOSA</source>
- <target>00:01:6c:9d:b9:fa</target>
- </xml>
- <xml>
- <header>gosa_opsi_get_netboot_products</header>
- <source>GOSA</source>
- <target>GOSA</target>
- <hostId>limux-cl-2.intranet.gonicus.de</hostId>
- </xml> */
+ $data = array();
+ /* Append host attribute to query data
+ */
+ if(!empty($host)){
+ $data['hostId'] = trim($host);
+ }
+
+ $res = $this->send_data("gosa_opsi_get_netboot_products",$this->target,$data,TRUE);
+ $items = array();
+ if($res['XML']['ITEM']['PRODUCTID']){
+ foreach($res['XML']['ITEM']['PRODUCTID'] as $id => $name){
+ $items[$name]['NAME'] = $name;
+ $items[$name]['DESC'] = $res['XML']['ITEM']['DESCRIPTION'][$id];
+ }
+ }
+ return($items);
}
@param
@return
*/
- public static function gosa_opsi_get_local_products()
+ public function get_local_products($host = "")
{
- /* <xml>
- <header>gosa_opsi_get_local_products</header>
- <source>GOSA</source>
- <target>GOSA</target>
- </xml>
- <xml>
- <header>gosa_opsi_get_local_products</header>
- <source>GOSA</source>
- <target>GOSA</target>
- <hostId>limux-cl-2.intranet.gonicus.de</hostId>
- </xml> */
+ $data = array();
+ /* Append host attribute to query data
+ */
+ if(!empty($host)){
+ $data['hostId'] = trim($host);
+ }
+
+ $res = $this->send_data("gosa_opsi_get_local_products",$this->target,$data,TRUE);
+ $items = array();
+ if($res['XML']['ITEM']['PRODUCTID']){
+ foreach($res['XML']['ITEM']['PRODUCTID'] as $id => $name){
+ $items[$name]['NAME'] = $name;
+ $items[$name]['DESC'] = $res['XML']['ITEM']['DESCRIPTION'][$id];
+ }
+ }
+ return($items);
}
@param
@return
*/
- public static function gosa_opsi_get_product_properties()
+ public function get_product_properties()
{
/* <xml>
<header>gosa_opsi_get_product_properties</header>
<hostId>limux-cl-2.intranet.gonicus.de</hostId>
</xml>
*/
+
}
@param
@return
*/
- public static function gosa_opsi_set_product_properties()
+ public function set_product_properties()
{
/* <xml>
<header>gosa_opsi_set_product_properties</header>
@param
@return
*/
- public static function gosa_opsi_get_client_hardware()
+ public function get_client_hardware()
{
/* <xml>
<header>gosa_opsi_get_client_hardware</header>
@param
@return
*/
- public static function gosa_opsi_get_client_software()
+ public function get_client_software()
{
/* <xml>
<header>gosa_opsi_get_client_software</header>
@param
@return
*/
- public static function gosa_opsi_list_clients()
+ public function list_clients()
{
- /* <xml>
- <header>gosa_opsi_list_clients</header>
- <source>GOSA</source>
- <target>00:01:6c:9d:b9:fa</target>
- </xml>
- */
+ $data = array();
+ $res = $this->send_data("gosa_opsi_list_clients",$this->target,$data,TRUE);
+ $items = array();
+ if(isset($res['XML']['ITEM'])){
+ foreach($res['XML']['ITEM'] as $type => $val){
+ foreach($val as $key => $value){
+ $items[$key][$type] = $value;
+ }
+ }
+ }
+ return($items);
}
@param
@return
*/
- public static function gosa_opsi_del_client()
+ public function del_client()
{
/* <xml>
<header>gosa_opsi_del_client</header>
@param
@return
*/
- public static function job_opsi_install_client()
+ public function job_opsi_install_client()
{
/* <xml>
<header>job_opsi_install_client</header>
@param
@return
*/
- public static function gosa_opsi_add_client()
+ public function add_client()
{
/* <xml>
<header>gosa_opsi_add_client</header>
@param
@return
*/
- public static function gosa_opsi_add_product_to_client()
+ public function add_product_to_client()
{
/* <xml>
<header>gosa_opsi_add_product_to_client</header>
@param
@return
*/
- public static function gosa_opsi_del_product_from_client()
+ public function del_product_from_client()
{
/* <xml>
<header>gosa_opsi_del_product_from_client</header>
*/
}
}
-
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/gosa-plugins/opsi/admin/opsi/class_opsi_generic.inc b/gosa-plugins/opsi/admin/opsi/class_opsi_generic.inc
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+class opsi_generic extends plugin
+{
+
+}
+
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/opsi/admin/opsi/opsi_tabs.inc b/gosa-plugins/opsi/admin/opsi/opsi_tabs.inc
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+class opsi_tabs extends tabs
+{
+
+}
+
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>