* As a special exception, you have permission to link this program with the JpGraph library and distribute executables, * as long as you follow the requirements of the GNU GPL in regard to all of the software in the executable aside from * JpGraph. * * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once __DIR__ . '/functions.php'; session_start(); require __DIR__ . '/login.function.php'; if ($_SESSION['user_type'] != 'A') { header("Location: index.php"); } else { html_start("Configuration"); audit_log('Viewed MailScanner configuration'); $conf_dir = get_conf_include_folder(); $MailScanner_conf_file = '' . MS_CONFIG_DIR . 'MailScanner.conf'; echo '<table border="0" cellpadding="1" cellspacing="1" class="maildetail" width="100%">'; echo '<tr><th colspan="2">MailScanner Configuration</th></tr>'; $array_output = array(); $array_output1 = parse_conf_file($MailScanner_conf_file); $array_output2 = parse_conf_dir($conf_dir); if (is_array($array_output2)) { $array_output = array_merge($array_output1, $array_output2); } else { $array_output = $array_output1; } // Display the information from the configuration files foreach ($array_output as $out_key => $value) { // expand %var% variables if (preg_match("/(%.+%)/", $value, $match)) {
/** * @param $name * @return bool */ function get_conf_truefalse($name) { if (DISTRIBUTED_SETUP) { return true; } $conf_dir = get_conf_include_folder(); $MailScanner_conf_file = MS_CONFIG_DIR . 'MailScanner.conf'; $array_output1 = parse_conf_file($MailScanner_conf_file); $array_output2 = parse_conf_dir($conf_dir); if (is_array($array_output2)) { $array_output = array_merge($array_output1, $array_output2); } else { $array_output = $array_output1; } foreach ($array_output as $parameter_name => $parameter_value) { $parameter_name = preg_replace('/ */', '', $parameter_name); if (strtolower($parameter_name) == strtolower($name)) { // Is it a ruleset? if (is_readable($parameter_value)) { $parameter_value = get_default_ruleset_value($parameter_value); } $parameter_value = strtolower($parameter_value); switch ($parameter_value) { case "yes": case "1": return true; case "no": case "0": return false; default: // if $parameter_value is a ruleset or a function call return true $parameter_value = trim($parameter_value); if (strlen($parameter_value) > 0) { return true; } return false; } } } return false; }