From: cajus Date: Wed, 30 Jan 2008 09:24:18 +0000 (+0000) Subject: Added activation signals X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=24baea21c1fedc92d83aabcd7bd34a119b8c6545;p=gosa.git Added activation signals git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8653 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index 82bb857b8..9ac6d7d1f 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -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 */ diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index 0b58f7667..8b31f4329 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -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); + } }