예제 #1
0
파일: msconfig.php 프로젝트: thctlo/1.2.0
 *
 * 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
예제 #2
0
                gzclose($zp_ipv6_gz);
                fclose($targetFileipv6);
            } elseif (!in_array('exec', array_map('trim', explode(',', ini_get('disable_functions'))))) {
                exec('gunzip -f ' . $ipv4_file, $output_gunzip_ipv4, $retval_gunzip_ipv4);
                exec('gunzip -f ' . $ipv6_file, $output_gunzip_ipv6, $retval_gunzip_ipv6);
                //TODO: add error handling
                if ($retval_gunzip_ipv4 > 0) {
                    die("Unable to extract GeoIP ipv4 data file.\n");
                }
                if ($retval_gunzip_ipv6 > 0) {
                    die("Unable to extract GeoIP ipv6 data file.\n");
                }
            } else {
                // unable to extract the file correctly
                die("Unable to extract GeoIP data file.\n");
            }
            echo 'Process completed!' . "\n";
            ob_flush();
            audit_log('Ran GeoIP update');
        } else {
            // unable to read or write to the directory
            die("Unable to read or write to the " . $extract_dir . " directory.\n");
        }
    } else {
        die("Files still exist for some reason\n");
    }
}
// Add the footer
html_end();
// close the connection to the Database
dbclose();
예제 #3
0
            if (!isset($_GET['quarantine_report'])) {
                $n_quarantine_report = '0';
            } else {
                $n_quarantine_report = '1';
            }
            if (!isset($_GET['noscan'])) {
                $noscan = '1';
            } else {
                $noscan = '0';
            }
            $quarantine_rcpt = mysql_real_escape_string($_GET['quarantine_rcpt']);
            if ($_GET['password'] !== 'XXXXXXXX') {
                // Password reset required
                $password = password_hash($n_password, PASSWORD_DEFAULT);
                $sql = "UPDATE users SET password='******', quarantine_report='{$n_quarantine_report}', spamscore='{$spamscore}', highspamscore='{$highspamscore}', noscan='{$noscan}', quarantine_rcpt='{$quarantine_rcpt}' WHERE username='******'";
                dbquery($sql);
            } else {
                $sql = "UPDATE users SET quarantine_report='{$n_quarantine_report}', spamscore='{$spamscore}', highspamscore='{$highspamscore}', noscan='{$noscan}', quarantine_rcpt='{$quarantine_rcpt}' WHERE username='******'";
                dbquery($sql);
            }
            // Audit
            audit_log("User [{$username}] updated their own account");
            echo '<h1 style="text-align: center; color: green;">Update Completed</h1>';
            echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"3;user_manager.php\">";
        }
    }
}
// Add footer
html_end();
// Close any open db connections
dbclose();
예제 #4
0
  </td>
 </tr>
 <tr>' . "\n";
    echo '  <td align="center"><br><input type="submit" value="Run Now"><br><br></td>' . "\n";
    echo ' </tr>' . "\n";
    if (isset($_POST['run'])) {
        echo '<tr><td align="CENTER"><table class="mail" border="0" cellpadding="1" cellspacing="1"><tr><th>Rule</th><th>Description</th></tr>' . "\n";
        $mcp_prefs_file = get_conf_var('MCPSpamAssassinPrefsFile');
        $mcp_local_rules_dir = get_conf_var('MCPSpamAssassinLocalRulesDir');
        $mcp_default_rules_dir = get_conf_var('MCPSpamAssassinDefaultRulesDir');
        if ($mcp_local_rules_dir != $mcp_default_rules_dir) {
            $fh = popen("ls {$mcp_prefs_file} {$mcp_local_rules_dir}/*.cf {$mcp_default_rules_dir}/*.cf | xargs grep -h '^describe'", 'r');
        } else {
            $fh = popen("ls {$mcp_prefs_file} {$mcp_default_rules_dir}/*.cf | xargs grep -h '^describe'", 'r');
        }
        audit_log('Ran MCP Rules Description Update');
        while (!feof($fh)) {
            $line = rtrim(fgets($fh, 4096));
            debug("line: " . $line . "\n");
            preg_match("/^describe\\s+(\\S+)\\s+(.+)\$/", $line, $regs);
            if (isset($regs[1]) && isset($regs[2])) {
                $regs[1] = mysql_real_escape_string(ltrim(rtrim($regs[1])));
                $regs[2] = mysql_real_escape_string(ltrim(rtrim($regs[2])));
                echo '<tr><td>' . htmlentities($regs[1]) . '</td><td>' . htmlentities($regs[2]) . '</td></tr>' . "\n";
                dbquery("REPLACE INTO mcp_rules VALUES ('{$regs['1']}','{$regs['2']}')");
                //debug("\t\tinsert: ".$regs[1].", ".$regs[2]);
            } else {
                debug("{$line} - did not match regexp, not inserting into database");
            }
        }
        pclose($fh);
예제 #5
0
    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
*/
// Include of necessary functions
require_once "./functions.php";
include "msre_table_functions.php";
// Authentication checking
session_start();
require 'login.function.php';
// Check to see if the user is an administrator
if ($_SESSION['user_type'] != 'A') {
    // If the user isn't an administrator send them back to the index page.
    header("Location: index.php");
    audit_log('Non-admin user attempted to view MailScanner Rule Editor Page');
} else {
    html_start('Ruleset Editor', "0", false, false);
    // ############
    // ### Main ###
    // ############
    // start a table
    echo "<table border=\"0\" class=\"mailwatch\" align=\"center\">\n";
    TRH(array("Choose a ruleset to edit:"));
    $ruleset_file = array();
    // open directory and read its contents
    if (is_dir(MSRE_RULESET_DIR)) {
        if ($dh = opendir(MSRE_RULESET_DIR)) {
            while ($file = readdir($dh)) {
                // if it's a ruleset (*.rules), add it to the array
                if (preg_match("/.+\\.rules\$/", $file)) {
예제 #6
0
 echo "<tr>";
 echo "  <td>";
 echo "   This utility is used to update the SQL database with up-to-date descriptions of the SpamAssassin rules which are displayed on the Message Detail screen.<br>";
 echo "   <br>";
 echo "   This utility should generally be run after a SpamAssassin update, however it is safe to run at any time as it only replaces the existing values and inserts only new values in the table (therefore preserving descriptions from potentially deprecated or removed rules).<br>";
 echo "  </td>";
 echo "</tr>";
 echo " <tr>";
 echo "  <td align=\"center\">\n    <form method=\"post\" action=\"" . sanitizeInput($_SERVER['PHP_SELF']) . "\">\n    <div style=\"margin: 5px\">\n    <input type=\"submit\" value=\"run now\">\n    <input type=\"hidden\" name=\"run\" value=\"true\">\n    </div>\n    </form>\n    </td>";
 echo "</tr>";
 echo "</table>\n";
 if (isset($_POST['run'])) {
     echo "<table width=\"100%\">";
     echo "<tr><td align=\"center\"><table class=\"mail\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"><tr><th>Rule</th><th>Description</th></tr>\n";
     $fh = popen("grep -hr '^describe' " . SA_RULES_DIR . " /usr/share/spamassassin /usr/local/share/spamassassin /etc/MailScanner/spam.assassin.prefs.conf /opt/MailScanner/etc/spam.assassin.prefs.conf /usr/local/etc/mail/spamassassin /etc/mail/spamassassin /var/lib/spamassassin 2>/dev/null | sort | uniq", 'r');
     audit_log('Ran SpamAssassin Rules Description Update');
     while (!feof($fh)) {
         $line = rtrim(fgets($fh, 4096));
         // debug("line: ".$line."\n");
         preg_match("/^describe\\s+(\\S+)\\s+(.+)\$/", $line, $regs);
         if (isset($regs[1]) && isset($regs[2])) {
             $regs[1] = trim($regs[1]);
             $regs[2] = trim($regs[2]);
             echo "<tr><td>" . htmlentities($regs[1]) . "</td><td>" . htmlentities($regs[2]) . "</td></tr>\n";
             $regs[1] = mysql_real_escape_string($regs[1]);
             $regs[2] = mysql_real_escape_string($regs[2]);
             dbquery("REPLACE INTO sa_rules VALUES ('{$regs['1']}','{$regs['2']}')");
             //debug("\t\tinsert: ".$regs[1].", ".$regs[2]);
         } else {
             debug("{$line} - did not match regexp, not inserting into database");
         }
예제 #7
0
파일: functions.php 프로젝트: thctlo/1.2.0
/**
 * @param $user
 * @param $hash
 */
function updateUserPasswordHash($user, $hash)
{
    $sqlCheckLenght = "SELECT CHARACTER_MAXIMUM_LENGTH AS passwordfieldlength FROM information_schema.columns WHERE column_name = 'password' AND table_name = 'users'";
    $passwordFiledLengthResult = dbquery($sqlCheckLenght);
    $passwordFiledLength = intval(mysql_result($passwordFiledLengthResult, 0, 'passwordfieldlength'));
    if ($passwordFiledLength < 255) {
        $sqlUpdateFieldLength = "ALTER TABLE `users` CHANGE `password` `password` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
        dbquery($sqlUpdateFieldLength);
        audit_log('Updated password field length from ' . $passwordFiledLength . ' to 255');
    }
    $sqlUpdateHash = "UPDATE `users` SET `password` = '{$hash}' WHERE `users`.`username` = '{$user}'";
    dbquery($sqlUpdateHash);
    audit_log('Updated password for user ' . $user);
}
예제 #8
0
파일: lists.php 프로젝트: rafaelbsd/1.2.0
        case 'b':
            $list = 'blacklist';
            break;
    }
    switch ($_SESSION['user_type']) {
        case 'U':
            $sql = "DELETE FROM {$list} WHERE id='{$id}' AND to_address='{$to_address}'";
            audit_log("Removed entry {$id} from {$list}");
            break;
        case 'D':
            $sql = "DELETE FROM {$list} WHERE id='{$id}' AND to_domain='{$to_domain}'";
            audit_log("Removed entry {$id} from {$list}");
            break;
        case 'A':
            $sql = "DELETE FROM {$list} WHERE id='{$id}'";
            audit_log("Removed entry {$id} from {$list}");
            break;
    }
    $id = mysql_real_escape_string($url_id);
    dbquery($sql);
}
function build_table($sql, $list)
{
    global $bg_colors;
    $sth = dbquery($sql);
    $rows = mysql_num_rows($sth);
    if ($rows > 0) {
        echo '<table class="blackwhitelist">' . "\n";
        echo ' <tr>' . "\n";
        echo '  <th>' . __('from07') . '</th>' . "\n";
        echo '  <th>' . __('to07') . '</th>' . "\n";
예제 #9
0
 * 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 the functions page
require_once __DIR__ . '/functions.php';
// Start the session
session_start();
// Require the login function code
require __DIR__ . '/login.function.php';
// Check to see if the user is an administrater
if ($_SESSION['user_type'] != 'A') {
    // If the user isn't an administrater send them back to the index page.
    header("Location: index.php");
    audit_log('Non-admin user attemped to view ClamAV Status page');
} else {
    // Start the header code and Title
    html_start("ClamAV Status", 0, false, false);
    // Create the table
    echo '<table class="boxtable" width="100%">';
    echo '<tr>';
    echo '<td align="center">';
    // Output the information from the conf file
    passthru(get_virus_conf('clamav') . " -V | awk -f " . __DIR__ . "/clamav.awk");
    echo '</td>';
    echo '</tr>';
    echo '</table>';
    // Add footer
    html_end();
    // Close any open db connections
예제 #10
0
function quarantine_delete($list, $num, $rpc_only = false)
{
    if (!is_array($list) || !isset($list[0]['msgid'])) {
        return "Invalid argument";
    } else {
        $new = quarantine_list_items($list[0]['msgid']);
        $list =& $new;
    }
    if (!$rpc_only && is_local($list[0]['host'])) {
        foreach ($num as $key => $val) {
            if (@unlink($list[$val]['path'])) {
                $status[] = "Delete: deleted file " . $list[$val]['path'];
                dbquery("UPDATE maillog SET quarantined=NULL WHERE id='" . $list[$val]['msgid'] . "'");
                audit_log('Delete file from quarantine: ' . $list[$val]['path']);
            } else {
                $status[] = "Delete: error deleting file " . $list[$val]['path'];
                global $error;
                $error = true;
            }
        }
        return join("\n", $status);
    } else {
        // Call by RPC
        debug("Calling quarantine_delete on " . $list[0]['host'] . " by XML-RPC");
        //$client = new xmlrpc_client(constant('RPC_RELATIVE_PATH').'/rpcserver.php',$list[0]['host'],80);
        // Convert input parameters
        foreach ($list as $list_array) {
            foreach ($list_array as $key => $val) {
                $list_struct[$key] = new xmlrpcval($val);
            }
            $list_output[] = new xmlrpcval($list_struct, 'struct');
        }
        foreach ($num as $key => $val) {
            $num_output[$key] = new xmlrpcval($val);
        }
        // Build input parameters
        $param1 = new xmlrpcval($list_output, 'array');
        $param2 = new xmlrpcval($num_output, 'array');
        $parameters = array($param1, $param2);
        $msg = new xmlrpcmsg('quarantine_delete', $parameters);
        $rsp = xmlrpc_wrapper($list[0]['host'], $msg);
        //$client->send($msg);
        if ($rsp->faultcode() == 0) {
            $response = php_xmlrpc_decode($rsp->value());
        } else {
            $response = "XML-RPC Error: " . $rsp->faultstring();
        }
        return $response . " (RPC)";
    }
}
예제 #11
0
            if ($new_private != $private) {
                if ($new_private == 0) {
                    $new_private_name = "public";
                } elseif ($new_private == 1) {
                    $new_private_name = "legacy Dream MP";
                } elseif ($new_private == 2) {
                    $new_private_name = "provisional";
                }
                dream_post_forum_action($db, $dreamid, "Policy is now [b]" . $new_private_name . "[/b]");
            }
            $ret = $db->query_errcheck("update pw_dyn_dreammp set name='{$name}', description='" . mysql_real_escape_string($description) . "', private='" . $new_private . "' where dream_id='{$dreamid}'");
            notify_dream_mp_updated($db, intval($dreamid));
            if ($ret) {
                $ok = true;
                $feedback = "Successfully edited policy '" . html_scrub($name) . "'.  \n                     To see the changes, go to <a href=\"../policy.php?id={$dreamid}\">the\n                     policy's page</a>.";
                audit_log("Edited definition policy '" . $name . "'");
            } else {
                $feedback = "Failed to edit policy. " . mysql_error();
            }
        }
    } elseif ($submiteditpolicy) {
        $feedback = "Cancelled";
        $ok = true;
        # redirect on cancel
    }
    if ($ok) {
        header("Location: /policy.php?id={$dreamid}\n");
        exit;
    }
}
# make list of links to other display modes
예제 #12
0
     if ($submit == "Save") {
         if ($type == 'motion') {
             $newtext = add_motion_missing_wrappers($newdescription, $newtitle);
             $curr_name = extract_title_from_wiki_text($newtext);
             $curr_description = extract_motion_text_from_wiki_text($newtext);
             $name_diff = format_linediff(trim($prev_name), trim($curr_name), false);
             # always have link
             $description_diff = format_linediff(trim($prev_description), trim($curr_description), true);
             # forum escapes <, > and the like already
             $description_diff = html_entity_decode(html_entity_decode($description_diff, ENT_QUOTES), ENT_QUOTES);
             $name_diff = html_entity_decode(html_entity_decode($name_diff, ENT_QUOTES), ENT_QUOTES);
             global $domain_name;
             divisionvote_post_forum_action($db, $params[0], $params[1], $params[2], "Changed title and/or description of division.\n\n[b]Title:[/b] " . "[url=http://{$domain_name}/division.php?date=" . $division_details['division_date'] . "&number=" . $division_details['division_number'] . "&house=" . $division_details['house'] . "]" . $name_diff . "[/url]\n[b]Description:[/b] " . $description_diff);
         }
         $db->query_errcheck("insert into pw_dyn_wiki_motion\n                (division_date, division_number, house, text_body, user_id, edit_date) values\n                ('{$params['0']}', '{$params['1']}', '{$params['2']}', '" . mysql_real_escape_string($newtext) . "', '" . user_getid() . "', now())");
         audit_log("Edited {$type} wiki text {$params['0']} {$params['1']} {$params['2']}");
         if ($type == 'motion') {
             notify_motion_updated($db, $params[0], $params[1], $params[2]);
         }
     }
     header("Location: " . $rr);
     exit;
 } else {
     pw_header();
     $values = get_wiki_current_value($db, $type, $params);
     if ($type == 'motion') {
         ?>
     <p>Describe the <i>result</i> of this division.  This will require you
     to check through the debate leading up to the vote.
     The raw, and frequently
     wrong, motion text is there by default.  Feel free to remove it when
예제 #13
0
파일: sa_lint.php 프로젝트: thctlo/1.2.0
 *
 * 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';
html_start("SpamAssassin Lint", 0, false, true);
if (!($fp = popen(SA_DIR . 'spamassassin -x -D -p ' . SA_PREFS . ' --lint 2>&1', 'r'))) {
    die("Cannot open pipe");
} else {
    audit_log('Run SpamAssassin lint');
}
echo "<TABLE CLASS=\"mail\" BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"1\" WIDTH=\"100%\">\n";
echo " <TR>\n";
echo "  <TH COLSPAN=\"2\">SpamAssassin Lint</TH>\n";
echo " </TR>\n";
// Start timer
$start = get_microtime();
$last = false;
while ($line = fgets($fp, 2096)) {
    $line = preg_replace("/\n/i", "", $line);
    $line = preg_replace("/</", "&lt;", $line);
    if ($line !== "" && $line !== " ") {
        $timer = get_microtime();
        $linet = $timer - $start;
        if (!$last) {
예제 #14
0
    exit;
}
if (isset($_GET["restore-process-array"])) {
    restore_process_array();
    exit;
}
if (isset($_GET["webapp-version"])) {
    webapp_version();
    exit;
}
if (isset($_GET["webaccess-version"])) {
    webaccess_version();
    exit;
}
if (isset($_GET["audit-log"])) {
    audit_log();
    exit;
}
if (isset($_GET["locales"])) {
    locales();
    exit;
}
if (isset($_GET["foldersnames"])) {
    foldersnames();
    exit;
}
if (isset($_GET["zarafa-user-create-store"])) {
    zarafa_user_create_store();
    exit;
}
if (isset($_GET["DbAttachConverter"])) {
예제 #15
0
 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
*/
// Include of necessary functions
require_once "./functions.php";
// Authentication checking
session_start();
require 'login.function.php';
if ($_SESSION['user_type'] != 'A') {
    header("Location: index.php");
    audit_log('Non-admin user attemped to view Software Version Page');
} else {
    html_start('MailWatch and MailScanner Version information', '0', false, false);
    $mailwatch_version = mailwatch_version();
    $mailscanner_version = get_conf_var('MailScannerVersionNumber');
    $php_version = phpversion();
    $mysql_version = mysql_result(dbquery("SELECT VERSION()"), 0);
    $geoipv4_version = FALSE;
    $geoipv6_version = FALSE;
    if (file_exists('./temp/GeoIP.dat')) {
        $geoipv4_version = date('r', filemtime('./temp/GeoIP.dat')) . ' (download date)';
    }
    if (file_exists('./temp/GeoIPv6.dat')) {
        $geoipv6_version = date('r', filemtime('./temp/GeoIPv6.dat')) . ' (download date)';
    }
    echo '<table width="100%" class="boxtable">' . "\n";
예제 #16
0
파일: ms_lint.php 프로젝트: rafaelbsd/1.2.0
session_start();
require 'login.function.php';
html_start("MailScanner Lint", 0, false, false);
echo '<table class="mail" cellspacing="1" width="100%">' . "\n";
echo ' <tr>' . "\n";
echo '  <th colspan="2">MailScanner Lint</th>' . "\n";
echo ' </tr>' . "\n";
if (!defined('MS_EXECUTABLE_PATH')) {
    echo '<tr>
    <td colspan="2">Please set MS_EXECUTABLE_PATH in conf.php to enable this feature</td>
    </tr>';
} else {
    if (!($fp = popen('sudo ' . MS_EXECUTABLE_PATH . ' --lint 2>&1', 'r'))) {
        die("Cannot open pipe");
    } else {
        audit_log('Run MailScanner lint');
    }
    // Start timer
    $start = get_microtime();
    $last = false;
    while ($line = fgets($fp, 2096)) {
        $line = preg_replace("/\n/i", "", $line);
        if ($line !== "" && $line !== " ") {
            $timer = get_microtime();
            $linet = $timer - $start;
            if (!$last) {
                $last = $linet;
            }
            echo '<!-- Timer: ' . $timer . ', Line Start: ' . $linet . ' -->' . "\n";
            echo '    <tr>' . "\n";
            echo '     <td>' . $line . '</td>' . "\n";
예제 #17
0
파일: detail.php 프로젝트: thctlo/1.2.0
// Set the Memory usage
ini_set("memory_limit", MEMORY_LIMIT);
// Setting the yes and no variable
$yes = '<span class="yes">&nbsp;Y&nbsp;</span>';
$no = '<span class="no">&nbsp;N&nbsp;</span>';
// Setting what Mail Transfer Agent is being used
$mta = get_conf_var('mta');
// The sql command to pull the data
$sql = "\n SELECT\n  DATE_FORMAT(timestamp, '" . DATE_FORMAT . " " . TIME_FORMAT . "') AS '" . __('receivedon04') . "',\n  hostname AS '" . __('receivedby04') . "',\n  clientip AS '" . __('receivedfrom04') . "',\n  headers '" . __('receivedvia04') . "',\n  id AS 'ID:',\n  headers AS '" . __('msgheaders04') . "',\n  from_address AS '" . __('from04') . "',\n  to_address AS '" . __('to04') . "',\n  subject AS '" . __('subject04') . "',\n  size AS '" . __('size04') . "',\n  archive AS 'Archive',\n  '" . __('hdrantivirus04') . "' AS 'HEADER',\n  CASE WHEN virusinfected>0 THEN '{$yes}' ELSE '{$no}' END AS 'Virus:',\n  CASE WHEN nameinfected>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('blkfile04') . "',\n  CASE WHEN otherinfected>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('otherinfec04') . "',\n  report AS 'Report:',\n  'SpamAssassin' AS 'HEADER',\n  CASE WHEN isspam>0 THEN '{$yes}' ELSE '{$no}' END AS 'Spam:',\n  CASE WHEN ishighspam>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('hscospam04') . "',\n  CASE WHEN issaspam>0 THEN '{$yes}' ELSE '{$no}' END AS 'SpamAssassin Spam:',\n  CASE WHEN isrblspam>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('listedrbl04') . "',\n  CASE WHEN spamwhitelisted>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('spamwl04') . "',\n  CASE WHEN spamblacklisted>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('spambl04') . "',\n  spamreport AS '" . __('saautolearn04') . "',\n  sascore AS '" . __('sascore04') . "',\n  spamreport AS '" . __('spamrep04') . "',\n  '" . __('hdrmcp04') . "' AS 'HEADER',\n  CASE WHEN ismcp>0 THEN '{$yes}' ELSE '{$no}' END AS 'MCP:',\n  CASE WHEN ishighmcp>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('highscomcp04') . "',\n  CASE WHEN issamcp>0 THEN '{$yes}' ELSE '{$no}' END AS 'SpamAssassin MCP:',\n  CASE WHEN mcpwhitelisted>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('mcpwl04') . "',\n  CASE WHEN mcpblacklisted>0 THEN '{$yes}' ELSE '{$no}' END AS '" . __('mcpbl04') . "',\n  mcpsascore AS '" . __('mcpscore04') . "',\n  mcpreport AS '" . __('mcprep04') . "'\n FROM\n  maillog\n WHERE\n  " . $_SESSION['global_filter'] . "\n AND\n  id = '" . $url_id . "'\n";
// Pull the data back and put it in the the $result variable
$result = dbquery($sql);
// Check to make sure something was returned
if (mysql_num_rows($result) == 0) {
    die("Message ID '" . $url_id . "' not found!\n </TABLE>");
} else {
    audit_log('Viewed message detail (id=' . $url_id . ')');
}
// Check if MCP is enabled
$is_MCP_enabled = get_conf_truefalse('mcpchecks');
echo '<table class="maildetail" border="0" cellspacing="1" cellpadding="1" width="100%">' . "\n";
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
    $listurl = "lists.php?host=" . $row[__('receivedfrom04')] . "&amp;from=" . $row[__('from04')] . "&amp;to=" . $row[__('to04')];
    for ($f = 0; $f < mysql_num_fields($result); $f++) {
        $fieldn = mysql_field_name($result, $f);
        if ($fieldn == __('receivedfrom04')) {
            $output = "<table class=\"sa_rules_report\" width=\"100%\" cellspacing=0 cellpadding=0><tr><td>" . $row[$f] . "</td>";
            if (LISTS) {
                $output .= "<td align=\"right\">[<a href=\"{$listurl}&amp;type=h&amp;list=w\">" . __('addwl04') . "</a>&nbsp;|&nbsp;<a href=\"{$listurl}&amp;type=h&amp;list=b\">" . __('addbl04') . "</a>]</td>";
            }
            $output .= "</tr></table>\n";
            $row[$f] = $output;
예제 #18
0
 You must obey the GNU General Public License in all respects for all of the code used other than those files in the
 PEAR library that are licensed under the PHP License. If you modify this program, you may extend this exception to
 your version of the program, but you are not obligated to do so.
 If you do not wish to do so, delete this exception statement from your version.

 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 './functions.php';
session_start();
include 'login.function.php';
html_start("MySQL Status", 0, false, true);
if ($_SESSION['user_type'] != 'A') {
    echo "Not Authorized";
} else {
    audit_log('Viewed MySQL Status');
    dbtable("SHOW TABLE STATUS");
    echo "<BR>\n";
    dbtable("SHOW FULL PROCESSLIST");
    echo "<BR>\n";
    dbtable("SHOW VARIABLES");
    // Add footer
    html_end();
    // Close any open db connections
    dbclose();
}
예제 #19
0
파일: viewmail.php 프로젝트: thctlo/1.2.0
        }
        -->
    </SCRIPT>
<?php 
dbconn();
if (!isset($_GET['id'])) {
    die("No input Message ID");
} else {
    $message_id = sanitizeInput($_GET['id']);
    $sql = "SELECT * FROM maillog WHERE id='" . mysql_real_escape_string($message_id) . "' AND " . $_SESSION["global_filter"];
    $message = @mysql_fetch_object(dbquery($sql));
    // See if message is local
    if (empty($message)) {
        die("Message '" . $message_id . "' not found\n");
    } else {
        audit_log('Quarantined message (' . $message_id . ') body viewed');
    }
    $using_rpc = false;
    if (!is_local($message->hostname) || RPC_ONLY) {
        // Host is remote - use XML-RPC
        $using_rpc = true;
        //$client = new xmlrpc_client(constant('RPC_RELATIVE_PATH').'/rpcserver.php',$row->hostname,80);
        $input = new xmlrpcval($message_id);
        $parameters = array($input);
        $msg = new xmlrpcmsg('return_quarantined_file', $parameters);
        //$rsp = $client->send($msg);
        $rsp = xmlrpc_wrapper($message->hostname, $msg);
        if ($rsp->faultcode() == 0) {
            $response = php_xmlrpc_decode($rsp->value());
        } else {
            die("Error: " . $rsp->faultstring());
예제 #20
0
 $submit = db_scrub($_POST["submit"]);
 $ok = false;
 if ($submit && !$just_logged_in) {
     if ($name == "" or $description == "") {
         $feedback = "Please name your policy, and give a definition.";
     } else {
         $db = new DB();
         $ret = $db->query_errcheck("insert into pw_dyn_dreammp (name, user_id, description, private) values\n                ('{$name}', '" . user_getid() . "', '{$description}', 2)");
         if ($ret) {
             $new_dreamid = mysql_insert_id();
             $ok = true;
             $feedback = "Successfully made new policy <a href=\"/policy.php?id={$new_dreamid}\">" . html_scrub($name) . "</a>.  To \n                    select votes for your new policy, <a href=\"../search.php\">search</a> or\n                    <a href=\"../divisions.php\">browse</a> for divisions.  On the page for\n                    each division you can choose how somebody supporting your policy would have voted.";
             if (user_getid()) {
                 $db->query("update pw_dyn_user set active_policy_id = {$new_dreamid} where user_id = " . user_getid());
             }
             audit_log("Added new policy '" . $name . "'");
             dream_post_forum_action($db, $new_dreamid, "Created brand new policy.\n\n[b]New Policy:[/b] [url=http://www.publicwhip.org.uk/policy.php?id=" . $new_dreamid . "]" . stripslashes($name) . "[/url]\n[b]Definition:[/b] " . stripslashes($description));
         } else {
             $feedback = "Failed to add new policy. " . mysql_error();
         }
     }
 }
 $title = "Make a new policy";
 pw_header();
 if ($feedback && !$just_logged_in) {
     if ($ok) {
         echo "<p>{$feedback}</p>";
     } else {
         echo "<div class=\"error\"><h2>Creating a new policy not complete, please try again\n                </h2><p>{$feedback}</div>";
     }
 } else {
예제 #21
0
 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 the functions page
require_once "./functions.php";
// Start the session
session_start();
// Require the login function code
require './login.function.php';
// Start the header code and Title
html_start("SpamAssassin Bayes Database Info", 0, false, false);
// Enter the Action in the Audit log
audit_log('Viewed SpamAssassin Bayes Database Info');
// Create the table
echo '<table align="center" class="boxtable" border="0" cellspacing="1" cellpadding="1" width="600">';
// Add a Header to the table
echo '<tr><th colspan="2">Bayes Database Information</th></tr>';
// Open the spamassassin file
$fh = popen(SA_DIR . 'sa-learn -p ' . SA_PREFS . ' --dump magic', 'r');
while (!feof($fh)) {
    $line = rtrim(fgets($fh, 4096));
    debug("line: " . $line . "\n");
    if (preg_match('/(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+non-token data: (.+)/', $line, $regs)) {
        switch ($regs[5]) {
            case 'nspam':
                echo '<tr><td class="heading">Number of Spam Messages:</td><td align="right">' . number_format($regs[3]) . '</td></tr>';
                break;
            case 'nham':