Code

Updated display image, moved into goto images.
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_workstationService.inc
index 5da717a4c8a105dbc996a6692d272ffdaf7e34a0..c78dc46969cb4d71a9afe3848cb293e296a45934 100644 (file)
@@ -62,8 +62,8 @@ class workservice extends plugin
         "1400x1050" =>  "1400x1050", 
         "1600x1200" =>  "1600x1200");
 
-    if(isset($this->config->data['MAIN']['RESOLUTION_HOOK'])){
-      $file = $this->config->data['MAIN']['RESOLUTION_HOOK'];
+    if(isset($this->config->data['MAIN']['RESOLUTIONS'])){
+      $file = $this->config->data['MAIN']['RESOLUTIONS'];
 
       if(is_readable($file)){
         $str = file_get_contents($file);
@@ -76,7 +76,7 @@ class workservice extends plugin
         }
         //natcasesort($this->gotoXResolutions);
       }else{
-        print_red(sprintf(_("You have specified an external resolution hook which can't be read, please check the permission of the file '%s'."),$file));
+        msg_dialog::display(_("Configuration error"), msgPool::cannotReadFile($file), WARNING_DIALOG);
       }
     }
 
@@ -447,6 +447,12 @@ class workservice extends plugin
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);
     $this->cleanup();
+
+    /* Send goto reload event to gosaSupportDaemon */
+    if(count($this->attrs)){
+      $this->send_goto_reload(); 
+    }
+
     $ldap->modify ($this->attrs); 
     new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     if (!$ldap->success()){
@@ -469,7 +475,7 @@ class workservice extends plugin
       }
     } else {
       $drivers = array("ati", "atimisc", "chips", "cirrus", "cyrix", "fbdev", "fglrx",
-          "i128", "i740", "i810", "imstt", "mga", "neomagic", "newport", "nsc",  "nv", "nvidia",
+          "i128", "i740", "i810", "intel", "imstt", "mga", "neomagic", "newport", "nsc",  "nv", "nvidia",
           "r128", "radeon", "rendition", "s3", "s3virge", "savage", "siliconmotion",
           "sis", "tdfx", "tga", "trident", "tseng", "vesa", "vga", "vmware");
     }
@@ -506,6 +512,45 @@ class workservice extends plugin
             "goFonHardware"         => _("Telephone hardware")) 
             ));
   }
+
+
+  /*! \brief  Send goto_reload event to support daemon
+   */
+  function send_goto_reload()
+  {
+    $targets = array();
+    if(isset($this->parent) && ($this->parent instanceOf worktabs)){
+      $targets[] = $this->parent->by_object['workgeneric']->netConfigDNS->ipHostNumber;
+    }
+    if(isset($this->parent) && ($this->parent instanceOf ogrouptabs)){
+      $member = $this->parent->by_object['ogroup']->member;
+      $oc = $this->parent->by_object['ogroup']->objcache;
+      foreach($member as $mem){
+        if(isset($oc[$mem]['macAddress'])){
+          $targets[] = $oc[$mem]['macAddress']; 
+        }
+      }
+    }
+    if(count($targets) && class_available("gosaSupportDaemon") && class_available("DaemonEvent_goto_reload")){
+      $o_g = new gosaSupportDaemon();
+      $evt = new DaemonEvent_goto_reload($this->config);
+      $evt -> set_type(TRIGGERED_EVENT);
+      $evt -> add_targets($targets);
+      $o_g->append($evt);
+    } 
+  }
+
+
+  function PrepareForCopyPaste($source)
+  {
+    plugin::PrepareForCopyPaste($source);
+
+    if(preg_match("/\+/",$this->gotoXHsync)){
+      $this->AutoSync = true;
+      $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync);
+      $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync);
+    }
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: