Code

Do not call GOsa-si methods until it is configured.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Jun 2011 12:25:22 +0000 (12:25 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Jun 2011 12:25:22 +0000 (12:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20912 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc

index 99ccc4ba640c8de212a84c235fa77b9fbf678539..32524695f7f3270872215284db3eac1517ab1b4b 100644 (file)
@@ -894,48 +894,51 @@ class workstartup extends plugin
     if ((isset($this->attrs['gotoLdapServer']) && class_available("DaemonEvent")) || $this->gotoLdap_inherit){
       $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
       $o_queue = new gosaSupportDaemon();
-      if(isset($events['TRIGGERED']['DaemonEvent_reload_ldap_config'])){
-        $evt = $events['TRIGGERED']['DaemonEvent_reload_ldap_config'];
-        $macs = array();
-    
-        /* Get list of macAddresses 
-         */
-        if(isset($this->parent->by_object['ogroup'])){
+      if($o_queue->is_configured()){
+
+        if(isset($events['TRIGGERED']['DaemonEvent_reload_ldap_config'])){
+          $evt = $events['TRIGGERED']['DaemonEvent_reload_ldap_config'];
+          $macs = array();
         
-          /* If we are an object group, add all member mac
+          /* Get list of macAddresse
            */
-          $p = $this->parent->by_object['ogroup'];
-          foreach($p->memberList as $dn => $obj){
-            if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
-              $macs[] = $p->objcache[$dn]['macAddress'];
+          if(isset($this->parent->by_object['ogroup'])){
+          
+            /* If we are an object group, add all member macs 
+             */
+            $p = $this->parent->by_object['ogroup'];
+            foreach($p->memberList as $dn => $obj){
+              if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
+                $macs[] = $p->objcache[$dn]['macAddress'];
+              }
             }
+          }elseif(isset($this->parent->by_object['workgeneric']->netConfigDNS->macAddress)){
+
+            /* We are a workstation. Add current mac.
+             */
+            $mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
+            if(!empty($mac)){
+              $macs[] = $mac;
+            }          
+          }elseif(isset($this->parent->by_object['servgeneric']->netConfigDNS->macAddress)){
+
+            /* We are a server. Add current mac.
+             */
+            $mac = $this->parent->by_object['servgeneric']->netConfigDNS->macAddress;
+            if(!empty($mac)){
+              $macs[] = $mac;
+            }          
           }
-        }elseif(isset($this->parent->by_object['workgeneric']->netConfigDNS->macAddress)){
-
-          /* We are a workstation. Add current mac.
-           */
-          $mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
-          if(!empty($mac)){
-            $macs[] = $mac;
-          }          
-        }elseif(isset($this->parent->by_object['servgeneric']->netConfigDNS->macAddress)){
 
-          /* We are a server. Add current mac.
+          /* Trigger event for all member objects 
            */
-          $mac = $this->parent->by_object['servgeneric']->netConfigDNS->macAddress;
-          if(!empty($mac)){
-            $macs[] = $mac;
-          }          
-        }
-
-        /* Trigger event for all member objects 
-         */
-        foreach($macs as $mac){
-          $tmp = new $evt['CLASS_NAME']($this->config);
-          $tmp->set_type(TRIGGERED_EVENT);
-          $tmp->add_targets(array($mac));
-          if(!$o_queue->append($tmp)){
-            msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
+          foreach($macs as $mac){
+            $tmp = new $evt['CLASS_NAME']($this->config);
+            $tmp->set_type(TRIGGERED_EVENT);
+            $tmp->add_targets(array($mac));
+            if(!$o_queue->append($tmp)){
+              msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
+            }
           }
         }
       }