From: <ton...@us...> - 2004-02-22 22:27:41
|
Update of /cvsroot/serverfilters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10751 Modified Files: functions.php backend.php Log Message: When invoking filtercmd, pass an RC file type instead of a full RC file path Index: backend.php =================================================================== RCS file: /cvsroot/serverfilters/backend.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** backend.php 22 Feb 2004 21:20:16 -0000 1.10 --- backend.php 22 Feb 2004 22:14:41 -0000 1.11 *************** *** 13,32 **** function local_filter_get() { ! global $username, $FILTERDIR, $FILTERFILE, $VIRTUAL_DOMAINS, $SEPERATOR; ! ! $path = vd_replace($FILTERDIR); ! ! if (!file_exists($path)) { ! mkdirs($path,0700); ! } - $file = "$path/$FILTERFILE"; $localfile = "/tmp/$FILTERFILE.$username"; ! if (local_file_exists($file)) { ! $err_code = invoke_filtercmd("getrc $file", "", $localfile); ! if ($err_code != 0) exit("filtercmd returned $err_code"); ! } else ! touch($localfile); ! return $localfile; } --- 13,22 ---- function local_filter_get() { ! global $username, $FILTERDIR, $FILTERFILE, $VIRTUAL_DOMAINS; $localfile = "/tmp/$FILTERFILE.$username"; ! touch($localfile); ! $err_code = invoke_filtercmd("getrc filter", "", $localfile); ! if ($err_code != 0) exit("filtercmd returned $err_code"); return $localfile; } *************** *** 69,83 **** function local_filter_exists() { ! global $username, $FILTERDIR, $FILTERFILE, $VIRTUAL_DOMAINS, $SEPERATOR; ! ! $path = vd_replace($FILTERDIR); ! ! $file = "$path/$FILTERFILE"; ! return local_file_exists($file); ! ! } ! ! function local_file_exists($file) { ! $exists = invoke_filtercmd("rcexists $file", "", ""); if ($exists == 0) return true; --- 59,63 ---- function local_filter_exists() { ! $exists = invoke_filtercmd("rcexists filter", "", ""); if ($exists == 0) return true; *************** *** 89,108 **** function local_filter_put($file) { ! global $username, $FILTERDIR, $FILTERFILE, $VIRTUAL_DOMAINS, $SEPERATOR; ! ! $path = vd_replace($FILTERDIR); ! ! if (!file_exists($path)) { ! mkdirs($path,0700); ! } ! ! $newfile = "$path/$FILTERFILE"; ! ! if ($VIRTUAL_DOMAINS) ! $user = my_virtual_domain_user($vdomain); ! else ! $user = $username; ! ! $err_code = invoke_filtercmd("putrc $user $file", $localfile, ""); } --- 69,73 ---- function local_filter_put($file) { ! $err_code = invoke_filtercmd("putrc filter", $localfile, ""); } |