From: <jgs...@us...> - 2004-03-01 17:43:04
|
Update of /cvsroot/serverfilters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20191 Modified Files: README backend.php recipie_functions.php Log Message: Added skeleton file stuff. Fixed several bugs. Index: backend.php =================================================================== RCS file: /cvsroot/serverfilters/backend.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** backend.php 1 Mar 2004 07:06:59 -0000 1.18 --- backend.php 1 Mar 2004 17:24:00 -0000 1.19 *************** *** 25,29 **** $result = invoke_filtercmd("getrc filter", "", $localfile); } else { ! touch($localfile); } return $localfile; --- 25,30 ---- $result = invoke_filtercmd("getrc filter", "", $localfile); } else { ! create_filter(); ! local_filter_get(); } return $localfile; *************** *** 40,44 **** function local_filter_put($file) { $err_code = invoke_filtercmd("putrc filter", $file, ""); ! unlink($file); } --- 41,45 ---- function local_filter_put($file) { $err_code = invoke_filtercmd("putrc filter", $file, ""); ! //unlink($file); } *************** *** 131,143 **** $location = "H"; break; ! case "Body" : $field = ""; $location = "B"; break; ! case "Any Header" : $field = ""; $location = "H"; break; ! case "Any part of Message" : $field = ""; $location = "HB"; --- 132,144 ---- $location = "H"; break; ! case _("Body") : $field = ""; $location = "B"; break; ! case _("Any Header") : $field = ""; $location = "H"; break; ! case _("Anywhere") : $field = ""; $location = "HB"; *************** *** 151,175 **** $string = preg_quote($string); switch ($matching) { ! case "Contains" : $prefix = ".*"; $suffix = ""; break; ! case "Begins With" : $prefix = " "; $suffix = ""; break; ! case "Ends With" : $prefix = ".*"; $suffix = "$"; break; ! case "Is Exactly" : $prefix = " "; $suffix = "$"; break; ! case "Custom" : $prefix = ""; $suffix = ""; $string = stripslashes($string); break; } fputs($fd, ":0${location}${procaction1}\n* ${field}${prefix}${string}${suffix}\n${copystring}\n"); --- 152,180 ---- $string = preg_quote($string); switch ($matching) { ! case _("Contains") : $prefix = ".*"; $suffix = ""; break; ! case _("Begins With") : $prefix = " "; $suffix = ""; break; ! case _("Ends With") : $prefix = ".*"; $suffix = "$"; break; ! case _("Is Exactly") : $prefix = " "; $suffix = "$"; break; ! case _("Matches Regex") : $prefix = ""; $suffix = ""; $string = stripslashes($string); break; + default : + $prefix = ".*"; + $suffix = ""; + break; } fputs($fd, ":0${location}${procaction1}\n* ${field}${prefix}${string}${suffix}\n${copystring}\n"); *************** *** 244,256 **** $location = "h"; break; ! case "Body" : $field = ""; $location = "b"; break; ! case "Any Header" : $field = ""; $location = "h"; break; ! case "Any part of Message" : $field = ""; $location = "w"; --- 249,261 ---- $location = "h"; break; ! case _("Body") : $field = ""; $location = "b"; break; ! case _("Any Header") : $field = ""; $location = "h"; break; ! case _("Anywhere") : $field = ""; $location = "w"; *************** *** 264,288 **** $string = preg_quote($string); switch ($matching) { ! case "Contains" : $prefix = ".*"; $suffix = ""; break; ! case "Begins With" : $prefix = " "; $suffix = ""; break; ! case "Ends With" : $prefix = ".*"; $suffix = "$"; break; ! case "Is Exactly" : $prefix = " "; $suffix = "$"; break; ! case "Custom" : $prefix = ""; $suffix = ""; $string = stripslashes($string); break; } fputs($fd, "if (/${field}${prefix}${string}${suffix}/:${location})\n{\n${copystring}\n}\n"); --- 269,297 ---- $string = preg_quote($string); switch ($matching) { ! case _("Contains") : $prefix = ".*"; $suffix = ""; break; ! case _("Begins With") : $prefix = " "; $suffix = ""; break; ! case _("Ends With") : $prefix = ".*"; $suffix = "$"; break; ! case _("Is Exactly") : $prefix = " "; $suffix = "$"; break; ! case _("Matches Regex") : $prefix = ""; $suffix = ""; $string = stripslashes($string); break; + default : + $prefix = ".*"; + $suffix = ""; + break; } fputs($fd, "if (/${field}${prefix}${string}${suffix}/:${location})\n{\n${copystring}\n}\n"); Index: recipie_functions.php =================================================================== RCS file: /cvsroot/serverfilters/recipie_functions.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** recipie_functions.php 1 Mar 2004 14:56:05 -0000 1.11 --- recipie_functions.php 1 Mar 2004 17:24:00 -0000 1.12 *************** *** 203,206 **** --- 203,220 ---- $nf = fopen($file, "w"); + $header = ""; + $footer = ""; + if (file_exists("../plugins/serversidefilter/skeleton/header")) { + $header_ary = file("../plugins/serversidefilter/skeleton/header"); + foreach ($header_ary as $line) + $header = $header . $line; + } + if (file_exists("../plugins/serversidefilter/skeleton/footer")) { + $footer_ary = file("../plugins/serversidefilter/skeleton/footer"); + foreach ($footer_ary as $line) + $footer = $footer . $line; + } + + fputs($nf, $header); fputs($nf, "##Begin Filter Configuration -- Please do not edit by hand, use SquirrelMail\n"); fputs($nf, "MAILDIR=$MAILDIR # Default mail directory\n"); *************** *** 211,217 **** write_default_recipie($nf); fputs($nf, "\n##End Filter Configuration\n"); fclose($nf); filter_put($file); - unlink($file); if (isset($FORWARD_FILE_PATH)) write_forward(); --- 225,231 ---- write_default_recipie($nf); fputs($nf, "\n##End Filter Configuration\n"); + fputs($nf, $footer); fclose($nf); filter_put($file); if (isset($FORWARD_FILE_PATH)) write_forward(); |