Code

Added activation signals
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 30 Jan 2008 09:24:18 +0000 (09:24 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 30 Jan 2008 09:24:18 +0000 (09:24 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8653 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc

index 82bb857b8a7a422fcab6a2008db15e851cc3529e..9ac6d7d1f5278980aed38507e8c2a31d995b85ec 100644 (file)
@@ -8,7 +8,7 @@ class termgeneric extends plugin
   var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
 
   /* Generic terminal attributes */
-  var $gotoMode= "disabled";
+  var $gotoMode= "locked";
   var $gotoTerminalPath= "";
   var $gotoSwapServer= "";
   var $gotoSyslogServer= "";
@@ -117,8 +117,8 @@ class termgeneric extends plugin
       }
     }
 
-    $this->modes["disabled"]= _("Locked");
-    $this->modes["enabled"]= _("Activated");
+    $this->modes["locked"]= _("Locked");
+    $this->modes["active"]= _("Activated");
 
     /* Set base */
     if ($this->dn == "new"){
@@ -500,6 +500,12 @@ class termgeneric extends plugin
       $this->move($this->orig_dn, $this->dn);
     }
 
+    /* Detect mode changes */
+    $activate= (isset($this->saved_attributes['gotoMode']) &&
+        $this->gotoMode != $this->saved_attributes['gotoMode'] &&
+        $this->gotoMode == "enabled" &&
+        tests::is_ip($this->netConfigDNS->ipHostNumber));
+
     plugin::save();
 
     /* Strip out 'default' values */
@@ -571,10 +577,11 @@ class termgeneric extends plugin
     $this->netConfigDNS->cn = $this->cn;
     $this->netConfigDNS->save();
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of object system terminal/generic with dn '%s' failed."),$this->dn));
-  }
-
-
 
+    if ($activate){
+      gosaSupportDaemon::send("gosa_set_activated_for_installation", $this->netConfigDNS->ipHostNumber);
+    }
+  }
 
 
   /* Display generic part for server copy & paste */
index 0b58f76678c800179c4416f8782660c06d602e34..8b31f43295040dfe5cdd245ef1c2afdc9ab47c92 100644 (file)
@@ -475,6 +475,12 @@ class workgeneric extends plugin
   /* Save to LDAP */
   function save()
   {
+    /* Detect mode changes */
+    $activate= (isset($this->saved_attributes['gotoMode']) &&
+        $this->gotoMode != $this->saved_attributes['gotoMode'] &&
+        $this->gotoMode == "active" &&
+        tests::is_ip($this->netConfigDNS->ipHostNumber));
+
     plugin::save();
 
     /* Strip out 'default' values */
@@ -559,6 +565,10 @@ class workgeneric extends plugin
     $this->netConfigDNS->cn = $this->cn;
     $this->netConfigDNS->save();
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/generic with dn '%s' failed."),$this->dn));
+
+    if ($activate){
+      gosaSupportDaemon::send("gosa_set_activated_for_installation", $this->netConfigDNS->ipHostNumber);
+    }
   }