From: hickert Date: Thu, 9 Oct 2008 11:07:43 +0000 (+0000) Subject: Updated opsi. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b2497dfaf6ee111d496601a906d82ddb881572e0;p=gosa.git Updated opsi. -Renamed variable from "parent_mode" to "standalone" -Fixed problem with creation of clients. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12654 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc index b9ab712b0..046abca99 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc @@ -40,7 +40,7 @@ class opsiGeneric extends plugin public $initial_description = ""; private $init_failed = FALSE; // Is true if the opsi communication failed - private $parent_mode = TRUE; // Is true if this is a standlone plugin. (Not samba) + private $standalone = TRUE; // Is true if this is a standlone plugin. (Not samba) private $is_installed= FALSE; // Is true is the hast is already installed. public $attributes = array("mac","note","description"); @@ -61,7 +61,7 @@ class opsiGeneric extends plugin */ $this->parent = $parent; if($parent instanceof wingeneric){ - $this->parent_mode = FALSE; + $this->standalone = FALSE; } /* Get hostId @@ -89,6 +89,12 @@ class opsiGeneric extends plugin $this->init_failed = FALSE; $this->initially_was_account = FALSE; + /* We are a standalone plugin. + */ + if($this->standalone ) { + $this->is_account = TRUE; + } + /* Try to load client infos from the gosa support daemon */ if(!empty($this->hostId)){ @@ -234,6 +240,7 @@ class opsiGeneric extends plugin */ if($this->init_failed){ $smarty = get_smarty(); + $smarty->assign("standalone ", $this->standalone ); $smarty->assign("init_failed",TRUE); $smarty->assign("message",$this->opsi->get_error()); return($smarty->fetch(get_template_path("generic.tpl",TRUE,dirname(__FILE__)))); @@ -243,7 +250,7 @@ class opsiGeneric extends plugin which has the opsi tab enabled. Check if the opsi is added or removed and display state buttons. */ - if(!$this->parent_mode){ + if(!$this->standalone ){ if(isset($_POST['modify_state'])){ if($this->is_account){ $this->is_account= FALSE; @@ -271,11 +278,10 @@ class opsiGeneric extends plugin /* Create HTML output of this plugin */ $smarty = get_smarty(); + $smarty->assign("standalone", $this->standalone ); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); } - - $smarty->assign("parent_mode", $this->parent_mode); $smarty->assign("is_installed", $this->is_installed); $smarty->assign("init_failed",FALSE); $divSLP = new divSelectBox(); @@ -547,13 +553,13 @@ class opsiGeneric extends plugin /* Get hostId */ - if(isset($_POST['hostId']) && $this->parent_mode){ + if(isset($_POST['hostId']) && $this->standalone ){ $this->hostId = get_post('hostId'); } /* Send actions like 'install' or 'wake' to the si server */ - if(isset($_POST['opsi_action']) && isset($_POST['opsi_trigger_action']) && $this->parent_mode){ + if(isset($_POST['opsi_action']) && isset($_POST['opsi_trigger_action']) && $this->standalone ){ $action = $_POST['opsi_action']; if($action == "install"){ $this->install_client(); diff --git a/gosa-plugins/opsi/admin/opsi/generic.tpl b/gosa-plugins/opsi/admin/opsi/generic.tpl index aa67b431d..742dbdc2e 100644 --- a/gosa-plugins/opsi/admin/opsi/generic.tpl +++ b/gosa-plugins/opsi/admin/opsi/generic.tpl @@ -13,7 +13,7 @@ - {if $parent_mode} + {if $standalone} @@ -82,7 +82,7 @@
{t}Name{/t}

 


- {if $parent_mode} + {if $standalone}

 {t}Action{/t}