Code

Updated language detection; try to use user settings first, the detect browser language
[gosa.git] / include / class_ppdManager.inc
index a5fad07309cc51686f14454dc121246d4b754ddb..7e416556d036bcf13f8aa23af19f69c783d3b019 100644 (file)
@@ -73,6 +73,12 @@ class ppdManager
                 continue;
             }
 
+                       /* Change model name .. */
+                       if ((preg_match("/^\*".$attribute.":*\s+/",$line)) && ($attribute == "ModelName")){
+                               $line= "*$attribute: \"$value\"\n";
+                               $done =true;
+                       }
+
                        if (($fsection) && ($section != "NO_SECTION")){
                                if (preg_match("/^\*CloseGroup:*\s+\**$section\/*/", $line)){
                                        $fsection= false;
@@ -136,10 +142,9 @@ class ppdManager
        {
                if(!is_readable($ppdFile)){
                        print_red(sprintf(_("Specified ppd file '%s' can't be opened for reading."),$ppdFile));
-               }elseif(is_writeable($ppdFile.".tmp")){
+               }elseif(!is_writeable(preg_replace("#(^.*/).*$#","\\1",$ppdFile.".tmp"))){
                        print_red(sprintf(_("The required tmp file file '%s' can't be opened for writing."),$ppdFile.".tmp"));
                }else{
-
                        foreach ($properties as $name => $section){
                                foreach ($section as $attribute => $value){
                                        if (is_array($value)){