当前位置: 首页>>代码示例>>PHP>>正文


PHP audit_log函数代码示例

本文整理汇总了PHP中audit_log函数的典型用法代码示例。如果您正苦于以下问题:PHP audit_log函数的具体用法?PHP audit_log怎么用?PHP audit_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了audit_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: session_start

 *
 * 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
开发者ID:thctlo,项目名称:1.2.0,代码行数:31,代码来源:msconfig.php

示例2: gzclose

                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();
开发者ID:rafaelbsd,项目名称:1.2.0,代码行数:31,代码来源:geoip_update.php

示例3: mysql_real_escape_string

            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='" . $password . "', quarantine_report='{$n_quarantine_report}', spamscore='{$spamscore}', highspamscore='{$highspamscore}', noscan='{$noscan}', quarantine_rcpt='{$quarantine_rcpt}' WHERE username='{$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='{$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();
开发者ID:thctlo,项目名称:1.2.0,代码行数:31,代码来源:user_manager.php

示例4: get_conf_var

  </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);
开发者ID:thctlo,项目名称:1.2.0,代码行数:31,代码来源:mcp_rules_update.php

示例5: session_start

    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)) {
开发者ID:rafaelbsd,项目名称:1.2.0,代码行数:30,代码来源:msre_index.php

示例6: table

 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");
         }
开发者ID:rafaelbsd,项目名称:1.2.0,代码行数:31,代码来源:sa_rules_update.php

示例7: updateUserPasswordHash

/**
 * @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);
}
开发者ID:thctlo,项目名称:1.2.0,代码行数:18,代码来源:functions.php

示例8: switch

        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";
开发者ID:rafaelbsd,项目名称:1.2.0,代码行数:31,代码来源:lists.php

示例9: session_start

 * 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
开发者ID:thctlo,项目名称:1.2.0,代码行数:31,代码来源:clamav_status.php

示例10: quarantine_delete

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)";
    }
}
开发者ID:rafaelbsd,项目名称:1.2.0,代码行数:50,代码来源:functions.php

示例11: elseif

            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
开发者ID:damncabbage,项目名称:publicwhip,代码行数:31,代码来源:policy.php

示例12: add_motion_missing_wrappers

     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
开发者ID:damncabbage,项目名称:publicwhip,代码行数:31,代码来源:wiki.php

示例13: session_start

 *
 * 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) {
开发者ID:thctlo,项目名称:1.2.0,代码行数:31,代码来源:sa_lint.php

示例14: restore_process_array

    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"])) {
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:31,代码来源:zarafa.php

示例15: session_start

 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";
开发者ID:rafaelbsd,项目名称:1.2.0,代码行数:31,代码来源:sf_version.php


注:本文中的audit_log函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。