Code

Updated work startup
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_terminalService.inc
index bd0451f3c2bda2b158f50b45d2684df735b7f634..da078940e67b70fa7af1270f424e09f8bed2fc26 100644 (file)
@@ -2,11 +2,6 @@
 
 class termservice extends plugin
 {
-  /* CLI vars */
-  var $cli_summary= "Manage terminal service aspects";
-  var $cli_description= "Some longer text\nfor help";
-  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
   /* Generic terminal attributes */
   var $gotoLpdEnable= FALSE;
   var $gotoXMonitor= "";
@@ -100,8 +95,8 @@ class termservice 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);
         $lines = split("\n",$str);
@@ -112,7 +107,7 @@ class termservice extends plugin
           }
         }
       }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(_("Configuration error"), msgPool::cannotReadFile($file), WARNING_DIALOG);
       }
     }
 
@@ -448,7 +443,9 @@ class termservice extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->dn);
     $ldap->modify($this->attrs);
-    show_ldap_error($ldap->get_error(),_("Could not remove terminal service."));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+    }
   }
 
 
@@ -488,13 +485,12 @@ class termservice extends plugin
         /* Check vsync for correct usage */
         $val= preg_replace ("/\s/", "", $this->gotoXVsync);
         if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) && $this->acl_is_writeable("gotoXVsync")){
-
-          $message[]= _("Please specify a valid VSync range.");
+          $message[]= msgPool::invalid(_("VSync range"));
         } elseif ($this->acl_is_writeable("gotoXVsync")){
           list($v1,$v2)= preg_split ("/[-+]/", $val);
           if ($v2 != ""){
             if ($v1 > $v2){
-              $message[]= _("Please specify a valid VSync range.");
+              $message[]= msgPool::invalid(_("VSync range"));
             }
           }
         }
@@ -502,13 +498,12 @@ class termservice extends plugin
         /* Check hsync for correct usage */
         $val= preg_replace ("/\s/", "", $this->gotoXHsync);
         if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) && $this->acl_is_writeable("gotoXHsync")){
-
-          $message[]= _("Please specify a valid HSync range.");
+          $message[]= msgPool::invalid(_("HSync range"));
         } elseif ($this->acl_is_writeable("gotoXHsync")){
           list($v1,$v2)= preg_split ("/[-+]/", $val);
           if ($v2 != ""){
             if ($v1 > $v2){
-              $message[]= _("Please specify a valid HSync range.");
+              $message[]= msgPool::invalid(_("HSync range"));
             }
           }
         }
@@ -587,7 +582,9 @@ class termservice extends plugin
     $ldap->modify ($this->attrs); 
     new log("modify","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
 
-    show_ldap_error($ldap->get_error(), sprintf(_("Saving of object system terminal/service with dn '%s' failed."),$this->dn));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+    }
     $this->handle_post_events("modify");
   }
 
@@ -607,7 +604,7 @@ class termservice extends plugin
     } else {
       foreach( 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") as $driver){
         $drivers[] = $driver;
@@ -636,8 +633,8 @@ class termservice extends plugin
             "gotoXDriver"             => _("Gfx driver"),
             "gotoXResolution"         => _("Gfx resolution"),
             "gotoXColordepth"         => _("Gfx color depth"),
-            "gotoXHsync"              => _("Hsync"),
-            "gotoXVsync"              => _("Vsync"),
+            "gotoXHsync"              => _("HSync"),
+            "gotoXVsync"              => _("VSync"),
             "AutoSync"                => _("Auto-Sync"),
             "gotoLpdEnable"           => _("Printer service enabled"),
             "gotoLpdServer"           => _("Spool server"),