From: <ton...@us...> - 2004-02-24 03:43:35
|
Update of /cvsroot/serverfilters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1407 Modified Files: backend.php functions.php options.php Log Message: deprecate , Index: functions.php =================================================================== RCS file: /cvsroot/serverfilters/functions.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** functions.php 23 Feb 2004 20:59:05 -0000 1.12 --- functions.php 24 Feb 2004 03:29:40 -0000 1.13 *************** *** 19,23 **** */ function filter_get() { ! global $username, $FILTERFILE; $localfile = "/tmp/serversidefilter/"; --- 19,23 ---- */ function filter_get() { ! global $username; $localfile = "/tmp/serversidefilter/"; *************** *** 25,29 **** chmod($localfile, 0777); ! $localfile .= "$FILTERFILE.$username"; if (filter_exists()) { $result = invoke_filtercmd("getrc filter", "", $localfile); --- 25,29 ---- chmod($localfile, 0777); ! $localfile .= "filterfile.$username"; if (filter_exists()) { $result = invoke_filtercmd("getrc filter", "", $localfile); *************** *** 49,80 **** } ! function write_dot_qmail() { ! global $username, $FILTERDIR, $FILTERFILE, $FILTER_APP_PATH; ! ! $tmpfile = "/tmp/.qmail-$username"; ! ! $fd = fopen($tmpfile,"w"); ! $filterpath = vd_replace($FILTERDIR); ! $filterfile = "$filterpath/$FILTERFILE"; ! $contents = "|preline $FILTER_APP_PATH $filterfile\n"; ! fwrite($fd, $contents); ! fclose($fd); ! ! $result = invoke_filtercmd("putrc forward", $tmpfile, ""); ! } ! ! function write_dot_forward() { ! global $username, $VIRTUAL_DOMAINS, $FILTERDIR, $FILTERFILE, $FILTER_APP_PATH; ! if ($VIRTUAL_DOMAINS) { ! return; ! } ! ! $tmpfile = "/tmp/.forward-$username"; $fd = fopen($tmpfile,"w"); ! $filterpath = vd_replace($FILTERDIR); ! $filterfile = "$filterpath/$FILTERFILE"; ! $contents = "|$FILTER_APP_PATH $filterfile\n"; fwrite($fd, $contents); fclose($fd); --- 49,64 ---- } ! function write_forward() { ! global $username, $FORWARD_FILE_PATH, $FORWARD_FILE_TYPE, $FILTER_APP_PATH; ! $tmpfile = "/tmp/forwardfile-$username"; $fd = fopen($tmpfile,"w"); ! $filterpath = vd_replace($FORWARD_FILE_PATH); ! $contents_array = array( ! "qmail" => "|preline $FILTER_APP_PATH $filterfile\n", ! "forward" => "|$FILTER_APP_PATH $filterfile\n" ! ); ! $contents = $contents_array[$FORWARD_FILE_TYPE]; fwrite($fd, $contents); fclose($fd); *************** *** 93,98 **** $FILTER_ARRY = explode("/", $FILTER_APP_PATH); $FILTER_APP = $FILTER_ARRY[count($FILTER_ARRY)-1]; - $set_filterfile = $FILTER_APP.'_set_filterfile'; - $set_filterfile(); } --- 77,80 ---- Index: options.php =================================================================== RCS file: /cvsroot/serverfilters/options.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** options.php 24 Feb 2004 00:27:12 -0000 1.11 --- options.php 24 Feb 2004 03:29:40 -0000 1.12 *************** *** 122,127 **** else $new['add_string'] = ""; array_push($recipies, $new); ! write_recipies($file, "/tmp/$FILTERFILE.$username.tmp"); ! filter_put("/tmp/$FILTERFILE.$username.tmp"); } elseif (array_key_exists('modify_x', $_POST)) { // Modify an existing entry --- 122,127 ---- else $new['add_string'] = ""; array_push($recipies, $new); ! write_recipies($file, "/tmp/filterfile.$username.tmp"); ! filter_put("/tmp/filterfile.$username.tmp"); } elseif (array_key_exists('modify_x', $_POST)) { // Modify an existing entry *************** *** 145,156 **** $recipies[$_POST['rule']]['toAddress'] = 'off'; $recipies[$_POST['rule']]['add_string'] = $_POST['add_string']; ! write_recipies($file, "/tmp/$FILTERFILE.$username.tmp"); ! filter_put("/tmp/$FILTERFILE.$username.tmp"); } elseif (array_key_exists('delete_x', $_POST)) { // Delete an entry $recipies = array_merge(array_slice($recipies, 0, $_POST['rule']), array_slice($recipies, $_POST['rule']+1)); ! write_recipies($file, "/tmp/$FILTERFILE.$username.tmp"); ! filter_put("/tmp/$FILTERFILE.$username.tmp"); } elseif (array_key_exists('up_x', $_POST)) { --- 145,156 ---- $recipies[$_POST['rule']]['toAddress'] = 'off'; $recipies[$_POST['rule']]['add_string'] = $_POST['add_string']; ! write_recipies($file, "/tmp/filterfile.$username.tmp"); ! filter_put("/tmp/filterfile.$username.tmp"); } elseif (array_key_exists('delete_x', $_POST)) { // Delete an entry $recipies = array_merge(array_slice($recipies, 0, $_POST['rule']), array_slice($recipies, $_POST['rule']+1)); ! write_recipies($file, "/tmp/filterfile.$username.tmp"); ! filter_put("/tmp/filterfile.$username.tmp"); } elseif (array_key_exists('up_x', $_POST)) { *************** *** 160,165 **** $recipies[$_POST['rule']] = $recipies[$_POST['rule']-1]; $recipies[$_POST['rule']-1] = $tmp; ! write_recipies($file, "/tmp/$FILTERFILE.$username.tmp"); ! filter_put("/tmp/$FILTERFILE.$username.tmp"); } } elseif (array_key_exists('down_x', $_POST)) { --- 160,165 ---- $recipies[$_POST['rule']] = $recipies[$_POST['rule']-1]; $recipies[$_POST['rule']-1] = $tmp; ! write_recipies($file, "/tmp/filterfile.$username.tmp"); ! filter_put("/tmp/filterfile.$username.tmp"); } } elseif (array_key_exists('down_x', $_POST)) { *************** *** 170,175 **** $recipies[$_POST['rule']] = $recipies[$_POST['rule']+1]; $recipies[$_POST['rule']+1] = $tmp; ! write_recipies($file, "/tmp/$FILTERFILE.$username.tmp"); ! filter_put("/tmp/$FILTERFILE.$username.tmp"); } } --- 170,175 ---- $recipies[$_POST['rule']] = $recipies[$_POST['rule']+1]; $recipies[$_POST['rule']+1] = $tmp; ! write_recipies($file, "/tmp/filterfile.$username.tmp"); ! filter_put("/tmp/filterfile.$username.tmp"); } } |