summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b976ba)
raw | patch | inline | side by side (parent: 3b976ba)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 24 Apr 2008 15:44:47 +0000 (15:44 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 24 Apr 2008 15:44:47 +0000 (15:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10677 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc b/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc
index 2fe99311f4acb457f1f356258469e5d1f0b9b0cf..fe72164d2ea787168b9528d62d5b275d3fec9439 100644 (file)
{
if(is_dir($path)){
$this->path= $path;
- }else{
+ }elseif(is_link($path) && (is_dir(readlink($path)))) {
+ $this->path= $path;
+ } else {
msg_dialog::display(_("PPD manager error"), sprintf(_("The specified path '%s' does not exist."),$path), ERROR_DIALOG);
return (false);
}
}
/* Recurse through all "common" directories */
- if(is_dir($path.'/'.$file)){
- $list= array_merge($list, $this->findPPD($path.'/'.$file));
+ $check_path= $path.'/'.$file;
+ if(is_dir($check_path) || (is_link($check_path) && (is_dir(readlink($check_path))))){
+ $list= array_merge($list, $this->findPPD($check_path));
continue;
}
/* Check for PPD extension */
- if (preg_match('/\.ppd$/i', $file)){
+ if (preg_match('/\.ppd(.gz)?$/i', $file)){
$list[]= $path.'/'.$file;
}
}
$section= preg_replace('/^\*/', '', $section);
$attribute= preg_replace('/^\*/', '', $attribute);
- $rp= @fopen($file, "r");
- $wp= @fopen("$file.tmp", "w");
+ $rp= @gzopen($file, "r");
+ $wp= @gzopen("$file.tmp", "w");
- while (!feof($rp)){
- $lines[]= fgets($rp, 1024);
+ while (!gzeof($rp)){
+ $lines[]= gzgets($rp, 1024);
}
$ret = "";
$ret .=$line;
}
- fwrite($wp,$ret);
+ gzwrite($wp,$ret);
- fclose($wp);
- fclose($rp);
+ gzclose($wp);
+ gzclose($rp);
copy("$file.tmp", "$file");
unlink("$file.tmp");
$option= "";
$properties= array();
- $fh= fopen ($ppdFile, 'r');
- while (!feof($fh)) {
+ $fh= gzopen ($ppdFile, 'r');
+ while (!gzeof($fh)) {
/* Read line */
- $line= fgets($fh, 256);
+ $line= gzgets($fh, 256);
if (strlen($line) >= 256){
trigger_error(_('Parsing PPD file %s failed - line too long. Trailing characters have been ignored'), E_USER_WARNING);
}
}
}
}
- fclose ($fh);
+ gzclose ($fh);
return ($properties);
}
/* Remember modified timestamp, to speed up next request */
$this->timestamps[$ppdFile] = filemtime($ppdFile);
- $fh= fopen ($ppdFile, 'r');
- while ((!feof($fh))&&($fh)) {
+ $fh= gzopen ($ppdFile, 'r');
+ while ((!gzeof($fh))&&($fh)) {
/* Read line */
- $line= fgets($fh, 256);
+ $line= gzgets($fh, 256);
if (strlen($line) >= 256){
trigger_error(_('Parsing PPD file %s failed - line too long. Trailing characters have been ignored'), E_USER_WARNING);
}
break;
}
}
- fclose ($fh);
+ gzclose ($fh);
/* Write out a notice that the PPD file seems to be broken if we can't
extract any usefull informations */