summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bdf7a9f)
raw | patch | inline | side by side (parent: bdf7a9f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Aug 2008 09:45:24 +0000 (09:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Aug 2008 09:45:24 +0000 (09:45 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12293 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc | patch | blob | history |
diff --git a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc
index e963399626454d40da3960168859ff76acffe465..e7784775b5eb2c15c9a3af1a81b3bbb061a29313 100644 (file)
/* Get hostId */
if($hostId != "new"){
- if(preg_match("/^opsi=/",$hostId)){
+ if(preg_match("/^opsi:/",$hostId)){
$this->hostId = preg_replace("/^opsi:=([^,]*),.*$/","\\1",$hostId);
- }else{
- $this->hostId = &$this->parent->cn;
-// $this->mac = &$this->parent->netConfigDNS->macAddress;
+ }elseif($this->parent instanceof wingeneric){
+ $this->hostId = $this->parent->cn;
+ $this->hostId = preg_replace('/\$$/',"",$this->hostId);
}
}
-
+
/* Try to plugin */
$this->init();
}
$list = $this->opsi->list_clients($this->hostId);
$err |= $this->opsi->is_error();
foreach($list as $entry){
- if(preg_match("/^".normalizePreg($this->hostId).".$/i",$entry['NAME'][0]['VALUE'])){
+ if(preg_match("/^".normalizePreg($this->hostId)."$/i",$entry['NAME'][0]['VALUE'])){
$this->initially_was_account = TRUE;
foreach(array("description" => "DESCRIPTION","mac" => "MAC", "note" => "NOTES") as $des => $src){
$this->$des = $entry[$src][0]['VALUE'];
public function save()
{
- /* Check if this a new opsi client
- -Do we have to create this client first?
- */
if(!$this->initially_was_account && $this->is_account){
$res = $this->opsi->add_client($this->hostId,$this->mac,$this->note,$this->description);
if($this->opsi->is_error()){
}
}
foreach($add as $name => $data){
+ echo "Adding '$name' to ".$this->hostId."<br>";
$this->opsi->add_product_to_client($name,$this->hostId);
if($this->opsi->is_error()){
msg_dialog::display(_("Error"),msgPool::siError($this->opsi->get_error()),ERROR_DIALOG);
return;
}
- $this->opsi->set_product_properties($name,$data['CFG'],$this->hostId);
- if($this->opsi->is_error()){
- msg_dialog::display(_("Error"),msgPool::siError($this->opsi->get_error()),ERROR_DIALOG);
- return;
+ if(!empty($data['CFG'])){
+ $this->opsi->set_product_properties($name,$data['CFG'],$this->hostId);
+ if($this->opsi->is_error()){
+ msg_dialog::display(_("Error"),msgPool::siError($this->opsi->get_error()),ERROR_DIALOG);
+ return;
+ }
}
}