projects
/
old-projects.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
to_string basis
[old-projects.git]
/
philter
/
philter
/
include
/
philter.inc.php
diff --git
a/philter/philter/include/philter.inc.php
b/philter/philter/include/philter.inc.php
index
d6ae075
..
463f772
100644
(file)
--- a/
philter/philter/include/philter.inc.php
+++ b/
philter/philter/include/philter.inc.php
@@
-11,6
+11,7
@@
require_once("include/core.inc.php");
function i18n($_index) { global $philter; echo $philter->i18n($_index); }
function _i18n($_index) { global $philter; return $philter->i18n($_index); }
function i18n($_index) { global $philter; echo $philter->i18n($_index); }
function _i18n($_index) { global $philter; return $philter->i18n($_index); }
+function bd() { global $philter; return ($philter->is_advanced() ? 'tmp_' : ''); }
/** Philter base configuration class
* This is the base class of Philter.
/** Philter base configuration class
* This is the base class of Philter.
@@
-36,6
+37,10
@@
class Philter {
$this->err = "";
}
$this->err = "";
}
+ function is_advanced() { return isset($_SESSION['philter_adv']); }
+ function set_advanced() { $_SESSION['philter_adv'] = true; }
+ function del_advanced() { unset($_SESSION['philter_adv']); }
+
/** returns the i18n string
* @param $_index the index of the string
* @returns the string or false
/** returns the i18n string
* @param $_index the index of the string
* @returns the string or false
@@
-78,10
+83,16
@@
class Philter {
}
/** function that writes the procmailrc.
}
/** function that writes the procmailrc.
+ * @param &$procmail the string containing the procmail filter
+ * @param $filename the base filename of the procmailrc filter
* @return true if all is ok
*/
* @return true if all is ok
*/
- function write_procmailrc() {
- // TODO
+ function write_procmailrc(&$procmail, $filename) {
+ $file = $this->config['path']['spool']."/".$filename;
+ $f = fopen($file.".tmp", "w");
+ fwrite($f, $procmail, strlen($procmail));
+ fclose($f);
+ rename($file.".tmp", $file);
return true;
}
return true;
}