From 8ad159e962f1f7f59bedee30443b4bbe0f236803 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 11 Mar 2008 09:48:31 +0000 Subject: [PATCH] Added info, if server is currently installing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9656 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_servGeneric.inc | 21 +++++++++++++++++++ gosa-plugins/systems/admin/systems/server.tpl | 7 +++++++ 2 files changed, 28 insertions(+) diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc index 54256514a..81942231f 100644 --- a/gosa-plugins/systems/admin/systems/class_servGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_servGeneric.inc @@ -48,6 +48,9 @@ class servgeneric extends plugin var $fai_activated =FALSE; var $view_logged = FALSE; + var $currently_installing = FALSE; + var $currently_installing_warned = FALSE; + function servgeneric (&$config, $dn= NULL, $parent= NULL) { /* Check if FAI is activated */ @@ -74,6 +77,17 @@ class servgeneric extends plugin $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses); $this->netConfigDNS->set_acl_category("server"); $this->netConfigDNS->set_acl_base($this->base); + + /* Check if this host is currently in installation process*/ + $o = new gosaSupportDaemon(); + $e_types = DaemonEvent::get_event_types(USER_EVENT | SYSTEM_EVENT | HIDDEN_EVENT); + $evts = $o->get_entries_by_mac(array($this->netConfigDNS->macAddress)); + foreach($evts as $evt){ + if(isset($e_types['QUEUED'][$evt['HEADERTAG']]) && + $e_types['QUEUED'][$evt['HEADERTAG']] == "DaemonEvent_reinstall"){ + $this->currently_installing =TRUE; + } + } /* Save dn for later references */ $this->orig_dn= $this->dn; @@ -213,6 +227,7 @@ class servgeneric extends plugin } $smarty->assign("netconfig", $str); $smarty->assign("modes", $this->modes); + $smarty->assign("currently_installing", $this->currently_installing); return($smarty->fetch (get_template_path('server.tpl', TRUE))); } @@ -308,6 +323,12 @@ class servgeneric extends plugin } } + /* Warn the user, that this host is currently installing */ + if($this->currently_installing && !$this->currently_installing_warned){ + $this->currently_installing_warned = TRUE; + $message[] = _("This host is currently installing, if you really want to save it, save again."); + } + return ($message); } diff --git a/gosa-plugins/systems/admin/systems/server.tpl b/gosa-plugins/systems/admin/systems/server.tpl index 01e35a3a6..9cf149f7c 100644 --- a/gosa-plugins/systems/admin/systems/server.tpl +++ b/gosa-plugins/systems/admin/systems/server.tpl @@ -63,6 +63,10 @@ +{/if}
+ +{if $currently_installing} + {t}System installation in progress, the FAI state cannot be changed right now.{/t} +{else} {render acl=$FAIstateACL} +{render acl=$FAIstateACL} +{/render}
{/if} -- 2.30.2