Code

Removed a couple of print_red calls
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sun, 16 Mar 2008 15:52:59 +0000 (15:52 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sun, 16 Mar 2008 15:52:59 +0000 (15:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9884 594d385d-05f5-0310-b6e9-bd551577e9d8

13 files changed:
gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc
gosa-plugins/goto/admin/systems/ppd/class_printerPPDSelectionDialog.inc
gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc
gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc
gosa-plugins/goto/admin/systems/services/repository/class_servRepository.inc
gosa-plugins/goto/admin/systems/services/repository/class_servRepositorySetup.inc
gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc
gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc
gosa-plugins/mail/admin/groups/mail/class_groupMail.inc
gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc
gosa-plugins/systems/admin/systems/class_serverService.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/class_termDNS.inc

index 08e8fecebf9464ae1abd66d07c99da00163991d0..cb31df27d10df66057ca5561d0291ee1bfe13c75 100644 (file)
@@ -194,7 +194,7 @@ class printerPPDDialog extends plugin
 
     /* Get PPD informations and set vendor / modell / name */ 
     if((!file_exists($AbsoluteSourceName)) || (!is_readable($AbsoluteSourceName))){
-      print_red(sprintf(_("Can't select PPD file '%s', the file is not readable"),$AbsoluteSourceName));   
+      msg_dialog::display(_("PPD error"), msgPool::cannotReadFile($AbsoluteSourceName), ERROR_DIALOG);
       return;
     }
     $res  = $this->ppdManager->loadDescription($AbsoluteSourceName);
@@ -211,7 +211,7 @@ class printerPPDDialog extends plugin
     /* Create the vendors path, if it doesn't exists already */
     if(!is_dir($AbsoluteDestinationPath.$Vendor)){
       if(!(@mkdir($AbsoluteDestinationPath.$Vendor))){
-        print_red(sprintf(_("Can't create folder '%s' for the uploaded ppd file."),$AbsoluteDestinationPath.$Vendor));
+        msg_dialog::display(_("PPD error"), msgPool::cannotCreateFolder($AbsoluteDestinationPath.$Vendor), ERROR_DIALOG);
         return(false);
       }
     }
@@ -219,7 +219,7 @@ class printerPPDDialog extends plugin
     /* Create destination file handle */
     $fp = @fopen($AbsoluteDestinationPath.$PPDName,"w+");
     if(!$fp){
-      print_red(sprintf(_("Can't create file '%s' to store modifed ppd informations."),$AbsoluteDestinationPath.$PPDName));
+      msg_dialog::display(_("PPD error"), msgPool::cannotWriteFile($AbsoluteDestinationPath.$PPDName), ERROR_DIALOG);
       return(false);
     }
 
@@ -243,7 +243,7 @@ class printerPPDDialog extends plugin
   {
     /* Check if file exists && is readable */
     if((!is_file($_PathOnHdd)) || (!is_readable($_PathOnHdd))){
-      print_red(sprintf(_("Can't add new ppd file, the source file '%s' is not accessible."),$_PathOnHdd));
+      msg_dialog::display(_("PPD error"), msgPool::cannotReadFile($_PathOnHdd), ERROR_DIALOG);
       return(false);
     }
     
@@ -261,7 +261,7 @@ class printerPPDDialog extends plugin
 
     /* Check if parse was successfull */
     if(empty($name) || empty($vendor)){
-      print_red(sprintf(_("The given ppd file '%s' seams to be invalid, can't get any model or vendor informations."),$_PathOnHdd));
+      msg_dialog::display(_("PPD error"), sprintf(_("Cannot parse PPD '%s'!"), $_PathOnHdd), ERROR_DIALOG);
       return(false);
     }
 
@@ -284,7 +284,7 @@ class printerPPDDialog extends plugin
         $found = true;
         if(!$overwrite){
           if(!copy($_PathOnHdd,$_PathOnHdd."_back")){
-            print_red(sprintf(_("Can't add new ppd file, the source file '%s' is not accessible."),$_PathOnHdd));         
+            msg_dialog::display(_("PPD error"), msgPool::cannotReadFile($_PathOnHdd), ERROR_DIALOG);
           }else{
             $this->add_ppd_later = $_PathOnHdd."_back";
             $this->add_later_msg_dialog = new msg_dialog(_("Overwrite existing PPD"),
@@ -298,7 +298,7 @@ class printerPPDDialog extends plugin
     /* Create the vendors path, if it doesn't exists already */
     if(!is_dir($this->pathToPPD.$vendor)){
       if(!(@mkdir($this->pathToPPD.$vendor))){
-        print_red(sprintf(_("Can't create folder '%s' for the uploaded ppd file."),$this->pathToPPD.$vendor));
+        msg_dialog::display(_("PPD error"), msgPool::cannotCreateFolder($this->pathToPPD.$vendor), ERROR_DIALOG);
         return(false);
       }
     }
@@ -308,11 +308,11 @@ class printerPPDDialog extends plugin
 
     /* Check file handle & contents */
     if(!$fp){
-      print_red(sprintf(_("Can't save file '%s'."),$filename));
+      msg_dialog::display(_("PPD error"), msgPool::cannotWriteFile($filename), ERROR_DIALOG);
       return;
     }
     if(empty($contents)){
-      print_red(_("Uploaded ppd file is empty, can't create new ppd file."));
+      msg_dialog::display(_("PPD error"), msgPool::incorrectUpload(_("file is empty")), ERROR_DIALOG);
       return;
     }
     
@@ -498,7 +498,7 @@ class printerPPDDialog extends plugin
             $str  .=  "</select>\n";
 
           }else{
-            print_red(sprintf(_("Unsupported ppd type '%s' used for '%s' "),$type,$name));
+            msg_dialog(_("PPD error"), sprintf(_("PPD type '%s' is not supported!"), $type), ERROR_DIALOG);
           }
           $str .= "</td></tr>\n";
         }
@@ -515,13 +515,13 @@ class printerPPDDialog extends plugin
     if(file_exists($path)){
       if(is_writeable($path)){
         if(!@unlink($path)){
-          print_red(sprintf(_("Removing old ppd file '%s' failed."),$path));
+          msg_dialog(_("PPD error"), msgPool::cannotDeleteFile($path), ERROR_DIALOG);
         }
       }else{
-        print_red(sprintf(_("Removing old ppd file '%s' failed. File is not accessible."),$path));
+        msg_dialog(_("PPD error"), msgPool::cannotDeleteFile($path), ERROR_DIALOG);
       }
     }else{
-      print_red(sprintf(_("Removing old ppd file '%s' failed. File does not exists or is not accessible."),$path));
+      msg_dialog(_("PPD error"), msgPool::cannotDeleteFile($path), ERROR_DIALOG);
     }
   }
 
index ec93f23f9dceb3a9d78b61268d704409e8bd2188..6d724bfdc55b7cd9f5331e329beaa1af80930185 100644 (file)
@@ -72,7 +72,7 @@ class printerPPDSelectionDialog extends plugin
         return($smarty->fetch(get_template_path('remove_ppd.tpl', TRUE)));
 
       }else{
-        print_red(sprintf(_("Could not found specified ppd file '%s'."),$id_to_del));
+        msg_dialog::display(_("PPD error"), msgPool::fileDoesNotExist($id_to_del), ERROR_DIALOG);
       }
     }
 
@@ -80,6 +80,7 @@ class printerPPDSelectionDialog extends plugin
     if(isset($_POST['delete_ppd_confirm']) && !empty($this->current_del_id)){
 
       /* check if file is removeable */
+      $is_ok = false;
       if(is_writeable($this->current_del_id)){
         $is_ok = @unlink($this->current_del_id);
 
@@ -93,12 +94,10 @@ class printerPPDSelectionDialog extends plugin
             }
           }
         }
-      }else{
-        $is_ok = false;
       }
 
       if(!$is_ok){
-        print_red(_("Something went wrong while trying to remove the ppd file from server, possibly we have no write access."));
+        msg_dialog::display(_("PPD error"), msgPool::cannotDeleteFile($this->current_del_id), ERROR_DIALOG);
       }
     }
 
@@ -118,7 +117,7 @@ class printerPPDSelectionDialog extends plugin
     if((isset($_GET['act']))&&($_GET['act']=="open"))  {
       
       if((!empty($_GET['id'])) && (!isset( $this->header[base64_decode($_GET['id'])]))){
-        print_red(sprintf(_("Selected vendor '%s' does not exists in our list of ppds."),base64_decode($_GET['id'])));      
+        msg_dialog::display(_("PPD error"), sprintf(_("Cannot locate vendor '%s' in available PPDs!"), base64_decode($_GET['id'])), ERROR_DIALOG);
         $this->Vendor = ""; 
       }else{
         $this->Vendor = base64_decode($_GET['id']);
index ee617fd6143278e0dadab860c539d6aa2cd98c57..a91d6837d205c70e062617f953a7c7852e78b86b 100644 (file)
@@ -28,7 +28,7 @@ class goKioskService extends goService{
 
     /* Load list of profiles and check if they still exists */
     if ($this->baseDir == ""){
-      print_red(msgPool::cmdnotfound("KIOSKPATH",_("Kiosk profile service")));
+      msg_dialog::display(_("Configuration error"), msgPool::cmdnotfound("KIOSKPATH",_("Kiosk profile service")), ERROR_DIALOG);
     }else{
       $this->gotoKioskProfiles = array();
       if(isset($this->attrs['gotoKioskProfile']) && is_array($this->attrs['gotoKioskProfile'])){
@@ -51,15 +51,12 @@ class goKioskService extends goService{
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
     $ldap->search("(&(objectClass=gotoEnvironment)(gotoKioskProfile=*/".$this->cn."/*))",array("cn"));
-    $str ="";
-    $cnt = 3;
-    while($cnt && $attrs = $ldap->fetch()){
-      $str .= $attrs['cn'][0].", ";
-      $cnt --;
-    }    
-    $str = preg_replace("/, $/","",$str);
-    if($cnt != 3){
-      print_red(sprintf(_("Can not remove kiosk profile service, it is currently in use by following user(s) : %s."),$str));
+    if ($ldap->count() != 0){
+      $obj= array();
+      while($attrs = $ldap->fetch()){
+        $obj[$ldap->getDN()]= $attrs['cn'][0];
+      }    
+      msg_dialog::display(_("Error"), msgPool::stillInUse(_("Kiosk profile service"), msgPool::buildList($obj)), ERROR_DIALOG);
     }else{
       goService::remove_from_parent();
     }
@@ -109,9 +106,6 @@ class goKioskService extends goService{
             'exists'  => TRUE);
         $this->gotoKioskProfiles[] = $tmp;
       }
-      if(!is_writeable($this->baseDir)){
-        print_red(sprintf(_("Can't save new kiosk profiles, possibly permission denied for folder: '%s'."),$this->baseDir));
-      }
     }
 
     $only_once = true;
@@ -130,27 +124,31 @@ class goKioskService extends goService{
         $ldap = $this->config->get_ldap_link();
         $ldap->cd($this->config->current['BASE']);
         $ldap->search("(&(objectClass=gotoEnvironment)(gotoKioskProfile=*".$name.")",array("cn","uid","gotoKioskProfile"));
-        $used_by = "";
-        $cnt = 3;
-        while(($attrs = $ldap->fetch()) && ($cnt)){
-          $cnt --;
-          $check = preg_replace("/^.*\//i","",$attrs['gotoKioskProfile'][0]);
-          if($check == $name){
-            $used_by .= $attrs['cn'][0].", ";
+
+        if ($ldap->count() != 0){
+
+          $obj= array();
+          $found= false;
+          while(($attrs = $ldap->fetch()) && ($cnt)){
+            $check = preg_replace("/^.*\//i","",$attrs['gotoKioskProfile'][0]);
+            if($check == $name){
+              $obj[$ldap->getDN()]= $attrs['cn'][0];
+              $found= true;
+            }
+          }
+          if ($found){
+            msg_dialog::display(_("Error"), msgPool::stillInUse(_("Kiosk profile"), msgPool::buildList($obj)), ERROR_DIALOG);
           }
-        }
-        $used_by = preg_replace("/, $/","",$used_by);
-        if(!empty($used_by)){
-          print_red(sprintf(_("Can't remove kioks profile, it is still in use by the following objects '%s'."),$used_by));
         }else{
           if($this->gotoKioskProfiles[$id]['initial']){
             $res = @unlink($filename);
             if(!$res){
               if(!is_writeable($filename)){
-                print_red(sprintf(_("Can't delete '%s'. Error was: permission denied."), $filename));
+                msg_dialog::display(_("Error"), msgPool::cannotDeleteFile($filename), ERROR_DIALOG);
               }
               if(!file_exists($filename)){
-                print_red(sprintf(_("Can't delete '%s'. Error was: file doesn't exist."), $filename));
+                msg_dialog::display(_("Error"), msgPool::fileDoesNotExist($filename), ERROR_DIALOG);
               }
             }
             unset($this->gotoKioskProfiles[$id]);
@@ -214,7 +212,7 @@ class goKioskService extends goService{
         $path = $this->baseDir."/".$profile['name'];
         $fp = @fopen($path,"w");
         if(!$fp){
-          print_red(_("Can't save new kiosk profiles, possibly permission denied for folder")." : ",$path);
+          msg_dialog::display(_("Error"), msgPool::cannotWriteFile($path), ERROR_DIALOG);
         }else{
           fwrite($fp,$contents,strlen($contents));
           $this->attrs['gotoKioskProfile'][] = $method.$profile['name'];
index 74889adbd63c59130b3a87bda2560975ab24a6a2..c0535dd6c25dc4062d4cbd483e8489d14b074e6d 100644 (file)
@@ -39,10 +39,10 @@ class servnfs extends plugin
     $this->charsets = array();
 
     if(!file_exists(CONFIG_DIR."/encodings")){
-      print_red(sprintf(_("The file '%s/encodings' does not exist, can't get supported charsets."),CONFIG_DIR));
+      msg_dialog::display(_("Error"), msgPool::fileDoesNotExist(CONFIG_DIR."/encodings"), ERROR_DIALOG);
     }else{
       if(!is_readable(CONFIG_DIR."/encodings")){
-        print_red(sprintf(_("Can't read '%s/encodings', please check permissions."),CONFIG_DIR));
+        msg_dialog::display(_("Error"), msgPool::cannotReadFile(CONFIG_DIR."/encodings"), ERROR_DIALOG);
       }else{
         $fp = fopen(CONFIG_DIR."/encodings","r");
         $i = 100;
index 47dcd5b67c2f643fc5190e298109ecd2513437a1..a3557c402bb855c7821654febca75dd7d59c4599 100644 (file)
@@ -126,20 +126,21 @@ class servrepository extends goService
           $ldap->cd ($this->config->current['BASE']);
 
           $ldap->search("(&(objectClass=gotoWorkstation)(objectClass=FAIobject)(FAIdebianMirror=".$url."))",array("cn","FAIclass"));
-
-          $found = false;
-          $found_in = " ";
-          while($attrs = $ldap->fetch()){
-            foreach($attrs['FAIclass'] as $class){
-              if(preg_match("/".str_replace("/","\/",$release)."$/i",$class)){
-                $found = true;  
-                $found_in .= $attrs['cn'][0]." ";
+          if ($ldap->count() != 0){
+            $obj= array();
+            $found= false;
+            while($attrs = $ldap->fetch()){
+              foreach($attrs['FAIclass'] as $class){
+                if(preg_match("/".str_replace("/","\/",$release)."$/i",$class)){
+                  $obj[$ldap->getDN()]= $attrs['cn'][0];
+                  $found= true;
+                }
               }
             }
-          }
 
-          if($found){
-            print_red(sprintf(_("You can't delete this release, it is still used by these workstations [%s]. Please solve this dependencies first, to keep data base consistency."),$found_in));
+            if ($found){
+              msg_dialog::display(_("Error"), msgPool::stillInUse(_("FAI release"), msgPool::buildList($obj)), ERROR_DIALOG);
+            }
           }else{
             if(isset($this->repositories[$value])){
               unset($this->repositories[$value]);
@@ -160,20 +161,21 @@ class servrepository extends goService
             $release = $this->repositories[$value]['Release'];
 
             $ldap->search("(&(objectClass=gotoWorkstation)(objectClass=FAIobject)(FAIdebianMirror=".$url."))",array("cn","FAIclass"));
-
-            $found = false;
-            $found_in = " ";
-            while($attrs = $ldap->fetch()){
-              foreach($attrs['FAIclass'] as $class){
-                if(preg_match("/".str_replace("/","\/",$release)."$/i",$class)){
-                  $found = true;
-                  $found_in .= $attrs['cn'][0]." ";
+            if ($ldap->count() != 0){
+              $found = false;
+              $obj= array();
+              while($attrs = $ldap->fetch()){
+                foreach($attrs['FAIclass'] as $class){
+                  if(preg_match("/".str_replace("/","\/",$release)."$/i",$class)){
+                    $found = true;
+                    $obj[$ldap->getDN()]= $attrs['cn'][0];
+                  }
                 }
               }
-            }
 
-            if($found){
-              print_red(sprintf(_("Be careful editing this release, it is still used by these workstations [%s]."),$found_in));
+              if($found){
+                msg_dialog::display(_("Warning"), msgPool::stillInUse(_("FAI release"), msgPool::buildList($obj)), WARNING_DIALOG);
+              }
             } 
 
             if(isset($this->repositories[$value])){
@@ -199,12 +201,12 @@ class servrepository extends goService
     if(isset($_POST['repository_setup_save']) && is_object($this->dialog)){
       $this->dialog->save_object();
       if(($this->dialog->is_new_name())&&(isset($this->repositories[$this->dialog->GetName()]))){
-        print_red(msgPool::duplicated(_("Name"))); 
+        msg_dialog::display(_("Error"), msgPool::duplicated(_("Name")), ERROR_DIALOG);
       }else
 
       if(count($this->dialog->check())!=0){
         foreach($this->dialog->check() as $msg){
-          print_red($msg);
+          msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
         }
       }else{
         $obj = $this->dialog->save();
index d67efece5f1ff3ac52b3adbc8941524c8a84fe43..1637b8330194f3fca11e1ca5fc85280079b60ec3 100644 (file)
@@ -193,7 +193,7 @@ class servRepositorySetup  extends plugin
       $res = shell_exec($cmd);
       $res2 = trim($res);
       if(!$res || empty($res2)){
-        print_red( msgPool::cmdexecfailed("REPOSITORY_HOOK",$cmd,_("Repository service")));
+        msg_dialog::display(_("Error"), msgPool::cmdexecfailed("REPOSITORY_HOOK", $cmd, _("Repository service")), ERROR_DIALOG);
       }else{  
         $tmp = split("\n",$res);
         foreach($tmp as $hook){
index 7914d49186ea65917811693164d585da6e7d7b7f..9f6a329eea86a5db1237d01dc395d733d840354b 100644 (file)
@@ -95,7 +95,7 @@ class goShareServer extends goService{
     if(isset($_POST['NFSsave']) && isset($this->o_subWindow) && is_object($this->o_subWindow)){
       if(count($this->o_subWindow->check())>0){
         foreach($this->o_subWindow->check() as $msg) {
-          print_red($msg);
+          msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
         }
       }else{
         $this->o_subWindow->save_object();
@@ -226,15 +226,11 @@ class goShareServer extends goService{
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
     $ldap->search("(|(gotoProfileServer=*|$id)(gotoShare=*|$id|*||*))", array("cn"));
-    $cnt= $ldap->count();
-    if ($cnt){
-      $msg= sprintf(_("The share can't be removed since it is still used by %d users:"), $cnt);
-      $msg.= "<br><br><ul>";
+    if ($ldap->count != 0){
       while ($attrs= $ldap->fetch()){
-        $msg.= "<li>".$attrs["cn"][0]."</li>";
+        $obj[$ldap->getDN()]= $attrs['cn'][0];
       }
-      $msg.= "</ul>"._("Please correct the share-/profile settings of these users");
-      print_red($msg);
+      msg_dialog::display(_("Error"), msgPool::stillInUse(_("share"), msgPool::buildList($obj)), ERROR_DIALOG);
 
     } else {
       /* Finally remove it */
index 69c1ee8917aaae11c72fc88bf51da0d7ec6f74bc..be6c24701e31779e2bf74391fdc5e13d9a34dccf 100644 (file)
@@ -177,11 +177,11 @@ class servkolab extends goService {
 
     /* Integration check, not translated because they can't pop up at all, only for debug */ 
     if(count($this->kolabHost) == 0){
-      print_red("Server - Kolab tab : This is not possible, we can't remove an account which doesn't exists.");
+      msg_dialog::display(_("Internal error"), _("Kolab account does not exist!"), ERROR_DIALOG);
       return;
     }
     if(!isset($this->hostname) || (empty($this->hostname))){
-      print_red("The required attribute hostname seams to empty.");
+      msg_dialog::display(_("Error"), msgPool::required(_("hostname")), ERROR_DIALOG);
     }
 
     /* Our hostname is in kolabHosts and there is a only one entry 
index f5b48722ea0c2f3ef82d94f3cd598e4da45aefca..3a7f6284c7a879a631504d275cd24fd1b5627d49 100644 (file)
@@ -79,7 +79,7 @@ class mailgroup extends plugin
     if ($cls && class_exists($cls)){
       $this->method= $cls;
     } else {
-      print_red(sprintf(_("There is no mail method '%s' specified in your gosa.conf available."), $this->mmethod));
+      msg_dialog::display(_("Configuration error"), sprintf(_("Cannot locate mail method '%s'!"), $this->mmethod), ERROR_DIALOG);
     }
 
     /* Load Mailserver  
@@ -434,13 +434,11 @@ class mailgroup extends plugin
         /* Valid email address specified? */
         $address= $_POST['forward_address'];
         if (!tests::is_email($address)){
-
-          print_red (msgPool::invalid(_("forward address")));
-
+          msg_dialog::display(_("Error"), msgPool::invalid(_("forward address")), ERROR_DIALOG);
         } elseif ($address == $this->mail
             || in_array($address, $this->gosaMailAlternateAddress)) {
 
-          print_red (_("Adding your one of your own addresses to the forwarders makes no sense."));
+          msg_dialog::display(_("Error"), _("Cannot forward to users own mail address!"), ERROR_DIALOG);
 
         } else {
 
@@ -466,12 +464,12 @@ class mailgroup extends plugin
       if ($_POST['alternate_address'] != "" && $this->acl_is_writeable("gosaMailAlternateAddress")){
 
         if (!tests::is_email($_POST['alternate_address'])){
-          print_red (msgPool::invalid(_("alternate address")));
+          msg_dialog::display(_("Error"),msgPool::invalid(_("Alternate address")), ERROR_DIALOG);
 
         } elseif (($user= $this->addAlternate ($_POST['alternate_address'])) != ""){
           $ui= get_userinfo();
           if ($user != $ui->username){
-            print_red (msgPool::duplicated(_("Mail address")));
+          msg_dialog::display(_("Error"),msgPool::duplicated(_("Mail address")), ERROR_DIALOG);
           }
         }
       }
index 755ce472d356cefe610915e577a06fb4172de5ff..49fac88eca8736a39e0d89b36661c44da5a65735 100644 (file)
@@ -140,7 +140,7 @@ class gospamserver extends goService{
       $msgs = $this->dialog->check();
       if(count($msgs)){
         foreach($msgs as $msg){
-          print_red($msg);
+          msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
         }
       }elseif($this->acl_is_writeable("saRule")){
         $ret = $this->dialog->save();
@@ -214,7 +214,7 @@ class gospamserver extends goService{
       if(tests::is_ip($post) || tests::is_domain($post) || (tests::is_ip_with_subnetmask($post))){
         $this->TrustedNetworks[$post] = $post;
       }else{
-        print_red(msgPool::invalid(_("Trusted network")));
+        msg_dialog::display(_("Error"), msgPool::invalid(_("Trusted network")), ERROR_DIALOG);
       }
     }
   }
index c984753b7896424c655721d5756d7b59b6afc419..1d259c284f53193b1cd35537e822ad8f906d2aa2 100644 (file)
@@ -170,7 +170,7 @@ class ServerService extends plugin
           $this->plugins[$s_entry] = $new_obj;
           $this->plugins[$s_entry]->is_account = false;
         }else{
-          print_red($str);
+          msg_dialog::display(_("Error"), $str, ERROR_DIALOG);
         }
       }
     }
@@ -218,7 +218,7 @@ class ServerService extends plugin
       $msgs = $this->dialog->check();
       if(count($msgs)){
         foreach($msgs as $msg){
-          print_red($msg);
+          msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
         }
       }else{
         $this->plugins[$this->current] = $this->dialog;
@@ -329,7 +329,7 @@ class ServerService extends plugin
   {
     /* Skip if this is a new server */
     if($this->dn == "new"){
-      print_red(_("Can't set status while this server is not saved."));
+      msg_dialog::display(_("Information"), _("Cannot update service status until it has been saved!"), INFO_DIALOG);
       return;
     }
 
@@ -341,7 +341,7 @@ class ServerService extends plugin
     }elseif($method == RESTART_SERVICE){
       $action = SERVICE_RESTARTED;
     }else{
-      print_red(sprintf(_("The specified method '%s' can't executed for services."),$action));
+      msg_dialog::display(_("Error"), _("Cannot update service status!"), ERROR_DIALOG);
       return;
     }
     
index 6adc26b4041b07a469d7e61e6f9ee538a3eae15b..f56c0b574001d2e5259f207f0990d78599f92e5b 100644 (file)
@@ -327,7 +327,7 @@ class systems extends plugin
           $this->systab->by_object[$tabname]->base = $this->DivListSystem->selectedBase;
           $this->systab->base = $this->DivListSystem->selectedBase;
         }else{
-          print_red(msgPool::permCreate());
+          msg_dialog::display(_("Error"), msgPool::permCreate(), ERROR_DIALOG);
         }
       }
     }
@@ -380,7 +380,7 @@ class systems extends plugin
         session::set('objectinfo',$this->dn);
         add_lock ($this->dn, $this->ui->dn);
       }else{ 
-        print_red (_("You can't edit this object type yet!"));
+        msg_dialog::display(_("Error"), _("Editing this type of object is not supported yet!"), ERROR_DIALOG);
         del_lock($this->dn);
       }
     }
@@ -408,7 +408,7 @@ class systems extends plugin
         session::set('objectinfo',$this->dn);
         return ($smarty->fetch(get_template_path('password.tpl', TRUE)));
       }else{
-        print_red(_("You are not allowed to change the password for this object."));
+        msg_dialog::display(_("Permission error"), _("You have no permission to change this password!"), ERROR_DIALOG);
       }
     }
 
@@ -420,7 +420,7 @@ class systems extends plugin
     /* Correctly specified? */
     if (isset($_POST['password_finish'])){
       if ($_POST['new_password'] != $_POST['repeated_password']){
-        print_red (_("Passwords entered as new and repeated do not match!"));
+        msg_dialog::display(_("Error"), _("The passwords you've entered as 'New password' and 'Repeated password' do not match!"), ERROR_DIALOG);
         return($smarty->fetch(get_template_path('password.tpl', TRUE)));
       }
     }
@@ -474,10 +474,10 @@ class systems extends plugin
           $ldap->modify($attrs);
           new log("security","systems/".get_class($this),$this->dn,array_keys($attrs),$ldap->get_error());
         }else{
-          print_red(_("You are not allowed to change the password for this object."));
+          msg_dialog::display(_("Permission error"), _("You have no permission to change this password!"), ERROR_DIALOG);
         }
       }else{
-        print_red(_("Can't detect object to change password."));
+        msg_dialog::display(_("Error"), _("Cannot determine object to change password!"), ERROR_DIALOG);
       }
       session::un_set('objectinfo');
     }
@@ -648,7 +648,7 @@ class systems extends plugin
           } else {
             /* Normally this shouldn't be reached, send some extra
                logs to notify the administrator */
-            print_red (msgPool::permDelete());
+            msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
             new log("security","systems/".get_class($this),$dn,array(),"Tried to trick deletion.");
           }
           /* Remove lock file after successfull deletion */
@@ -726,7 +726,7 @@ class systems extends plugin
 
         /* Obviously the user isn't allowed to delete. Show message and
            clean session. */
-        print_red (msgPool::permDelete());
+        msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
       }
     }
 
@@ -791,7 +791,7 @@ class systems extends plugin
 
         /* Normally this shouldn't be reached, send some extra
            logs to notify the administrator */
-        print_red(msgPool::permDelete());
+        msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
         new log("security","systems/".get_class($this),$dn,array(),"Tried to trick deletion.");
       }
 
@@ -823,7 +823,7 @@ class systems extends plugin
           }
         }
         if(!$found){
-          print_red(sprintf(_("Can't set gotoMode to status 'active', the current object couldn't be identified.")));
+          msg_dialog::display(_("Internal error"), _("Cannot set mode to 'active'!"), ERROR_DIALOG);
         }
 
       }
index 86bdcc6bac6b15c4284e9d5956d5bbd9c1abce8f..4c34e9eb41a206b1c37062a0f9445a9dae26d3fb 100644 (file)
@@ -286,7 +286,7 @@ class termDNS extends plugin
       $msgs = $this->dialog->check(array());
       if(count($msgs)){
         foreach($msgs as $msg){
-          print_red($msg);
+          msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
         }
       }else{
         $this->dhcpHostEntry = $this->dialog->save();