Code

Updated work startup
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_terminalStartup.inc
index 7a08cea1bc2c79739a9b9d0fe9fe8f2428a1d5ad..3a9a237e50e3e14edb183b42e6c9c0fb355108a1 100644 (file)
@@ -1,11 +1,6 @@
 <?php
 class termstartup extends plugin
 {
-  /* CLI vars */
-  var $cli_summary= "Manage terminal startup options";
-  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 $goLdapServerList= array();
   var $gotoBootKernel= "default";
@@ -167,7 +162,7 @@ class termstartup extends plugin
     /* Do we represent a valid terminal? */
     if (!$this->is_account && $this->parent === NULL){
       $display= "<img alt=\"\" src=\"images/stop.png\" align=middle>&nbsp;<b>".
-        _("This 'dn' has no terminal features.")."</b>";
+        msgPool::noValidExtension(_("terminal"))."</b>";
       return ($display);
     }
 
@@ -209,7 +204,7 @@ class termstartup extends plugin
     if(isset($_POST['gotoShareAdd']) && $this->acl_is_writeable("gotoShare")){
       /* We assign a share to this user, if we don't know where to mount the share */
       if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){
-        print_red(_("You must specify a valid mount point."));
+        msg_dialog(_("Error"), msgPool::invalid(_("Mount point")), WARNING_DIALOG);
       }else{
         $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']];
         $s_mount = $_POST['gotoShareMountPoint'];
@@ -445,25 +440,25 @@ class termstartup extends plugin
 
     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 system terminal/startup 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");
 
     /* Send ldap configuration update
      */
-    if ($ldap_changed){
-      $events = DaemonEvent::get_event_types(SYSTEM_EVENT);
+    if ($ldap_changed && class_available("DaemonEvent")){
+      $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENTS);
       $o_queue = new gosaSupportDaemon();
-      if(isset($events['BY_CLASS']['DaemonEvent_reload_ldap_config'])){
-        $evt = $events['BY_CLASS']['DaemonEvent_reload_ldap_config'];
+      if(isset($events['TRIGGERED']['DaemonEvent_reload_ldap_config'])){
+        $evt = $events['TRIGGERED']['DaemonEvent_reload_ldap_config'];
         $tmp = new $evt['CLASS_NAME']($this->config);
         $tmp->set_type(TRIGGERED_EVENT);
         $tmp->add_targets(array($this->parent->by_object['termgeneric']->netConfigDNS->macAddress));
         if(!$o_queue->append($tmp)){
-          msg_dialog::display(_("Daemon"),sprintf(_("Something went wrong while talking to the daemon: %s."),
-                $o_queue->get_error()),ERROR_DIALOG);
+          msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
         }
       }
     }
   }