コード例 #1
0
ファイル: file_purge.php プロジェクト: sleepy909/cpassman
if (!defined("PHORUM_ADMIN")) {
    return;
}
include_once "./include/format_functions.php";
include_once "./include/api/file_storage.php";
// Execute file purging for real?
if (count($_POST)) {
    $deleted = phorum_api_file_purge_stale(TRUE);
    phorum_admin_okmsg("Purged " . count($deleted) . " files");
}
// Retrieve a list of stale files.
$purge_files = phorum_api_file_purge_stale(FALSE);
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", count($purge_files) ? "Purge stale files now" : "Refresh screen");
$frm->hidden("module", "file_purge");
$frm->addbreak("Purging stale files...");
$frm->addmessage("It's possible that there are files stored in the Phorum system,\n         which no longer are linked to anything. For example, if users\n         write messages with attachments, but do not post them in the end,\n         the attachment files will be left behind in the database.\n         Using this maintenance tool, you can purge those stale files\n         from the system.");
$prev_reason = '';
if (count($purge_files)) {
    $frm->addbreak("There are currently " . count($purge_files) . " stale files in the database");
    foreach ($purge_files as $id => $file) {
        if ($file['reason'] != $prev_reason) {
            $prev_reason = $file['reason'];
            $frm->addsubbreak("Reason: " . $file['reason']);
        }
        $frm->addrow(htmlspecialchars($file["filename"]), phorum_filesize($file["filesize"]));
    }
} else {
    $frm->addmessage("There are currently no stale files in the database");
}
$frm->show();
コード例 #2
0
ファイル: settings.php プロジェクト: mgs2/kw-forum
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_ADMIN")) {
    return;
}
$error = "";
if (count($_POST)) {
    // some sanity checking would be nice ;)
    $PHORUM["smtp_mail"] = array('host' => $_POST['host'], 'port' => empty($_POST['port']) ? "25" : $_POST['port'], 'auth' => $_POST['auth'], 'username' => $_POST['auth_username'], 'password' => $_POST['auth_password'], 'conn' => $_POST['conn'], 'log_successful' => $_POST['log_successful'], 'show_errors' => $_POST['show_errors']);
    if (empty($error)) {
        phorum_db_update_settings(array("smtp_mail" => $PHORUM["smtp_mail"]));
        phorum_admin_okmsg("Settings updated");
    }
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "smtp_mail");
$frm->addbreak("Settings for the SMTP Mail Module");
$frm->addrow("Hostname of mailserver", $frm->text_box("host", $PHORUM['smtp_mail']['host'], 50));
$frm->addrow("Port of mailserver", $frm->text_box("port", $PHORUM['smtp_mail']['port'], 5) . " (Default Port is 25, unencrypted. Encrypted Port is usually 465)");
$frm->addrow("Connection Type", $frm->select_tag("conn", array('plain' => 'Plain Connection', 'ssl' => 'SSL-Encryption', 'tls' => 'TLS-Encryption'), $PHORUM['smtp_mail']['conn']) . " (e.g. Google-Mail connection needs TLS)");
$frm->addrow("Use SMTP Auth", $frm->select_tag("auth", array(1 => 'Yes', 0 => 'No'), $PHORUM['smtp_mail']['auth']));
$frm->addrow("SMTP Auth Username", $frm->text_box("auth_username", $PHORUM['smtp_mail']['username'], 50));
$frm->addrow("SMTP Auth Password", $frm->text_box("auth_password", $PHORUM['smtp_mail']['password'], 50, 0, true));
$frm->addsubbreak("Logging / Errorhandling");
$row = $frm->addrow("Show errors on screen", $frm->select_tag("show_errors", array(1 => "Yes", 0 => "No"), $PHORUM['smtp_mail']['show_errors']));
$frm->addhelp($row, "Show errors on screen", "This option enables to show errors on screen (default). If disabled you should make sure that you have the Event Logging Module enabled which will log errors in email sending.");
$row = $frm->addrow("Log successful mails to the Event Logging Module", $frm->select_tag("log_successful", array(0 => "No", 1 => "Yes"), $PHORUM['smtp_mail']['log_successful']));
$frm->addhelp($row, "Logging of successful emails to the Event Logging Module", "This option logs successful email messages to the Event Logging Module if that is enabled too.\nErrors are logged there always (if the module is enabled).");
$frm->show();
コード例 #3
0
ファイル: settings.php プロジェクト: sheldon/dejavu
    $settings["max_log_entries"] = (int) $_POST["max_log_entries"];
    $settings["min_log_level"] = (int) $_POST["min_log_level"];
    foreach ($eventtypes as $type => $desc) {
        $settings["do_log_{$type}"] = isset($_POST["do_log_{$type}"]) ? 1 : 0;
    }
    phorum_db_update_settings(array("mod_event_logging" => $settings));
    phorum_admin_okmsg("The settings were successfully saved.");
}
// Create the settings form.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save settings");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "event_logging");
$frm->hidden("el_action", "settings");
$frm->addbreak("General Settings");
$row = $frm->addrow("Minimum log level", $frm->select_tag("min_log_level", $GLOBALS["PHORUM"]["DATA"]["MOD_EVENT_LOGGING"]["LOGLEVELS"], $settings["min_log_level"]));
$frm->addhelp($row, "Minimum log level", "This option configures the minimum log level for which log messages are written to the event log. Events with a lower log level will not be written.<br/><br/>\"Debug\" is the lowest log level and \"Alert\" the highest, so to log all events, set this option to \"Debug\".");
$row = $frm->addrow("Maximum amount of stored event logs (0 = unlimited)", $frm->text_box("max_log_entries", $settings["max_log_entries"], 5));
$frm->addhelp($row, "Maximum amount of stored event logs", "This option configures the maximum amount of event logs that can be stored in the database at a given time. If the amount of event logs grows larger than this configured maximum, then old entries will be automatically cleaned up.<br/><br/>If you do not want a limit on the number of event logs, then set this option to 0 (zero).");
$row = $frm->addrow("Resolve IP addresses to host names when writing the event log", $frm->checkbox("resolve_hostnames", "1", "", $settings["resolve_hostnames"]));
$frm->addhelp($row, "Resolve IP addresses", "If this option is enabled, the IP address of the visitor will immediately be resolved into its hostname. Enabling this option can result in delays for the user, in case hostname lookups are slow for some reason.<br/><br/><b>Because of the performance penalty, we do not recommend enabling this option, unless you really need it and know what you are doing.</b>");
$row = $frm->addbreak("Which events to log");
$frm->addhelp($row, "Which events to log", "Below, you see the events which the Event Logging module can log for you. Enable the checkbox for each event type that you wish to appear in the event log. You can use this to limit the amount of entries, in case you are not interested in some of them.<br/><br/>Note that other modules can also write entries to the event log. If you need to suppress logging for those, then please consult the settings and documentation of those modules.");
foreach ($eventtypes as $type => $desc) {
    if ($desc === NULL) {
        $frm->addsubbreak($type);
    } else {
        $frm->addrow($desc, $frm->checkbox("do_log_{$type}", "1", "", $settings["do_log_{$type}"]));
    }
}
$frm->show();