コード例 #1
0
ファイル: form.php プロジェクト: sebbie42/casebox
function phorum_htmlpurifier_show_form()
{
    if (phorum_htmlpurifier_config_file_exists()) {
        phorum_htmlpurifier_show_config_info();
        return;
    }
    global $PHORUM;
    $config = phorum_htmlpurifier_get_config();
    $frm = new PhorumInputForm("", "post", "Save");
    $frm->hidden("module", "modsettings");
    $frm->hidden("mod", "htmlpurifier");
    // this is the directory name that the Settings file lives in
    if (!empty($error)) {
        echo "{$error}<br />";
    }
    $frm->addbreak("Edit settings for the HTML Purifier module");
    $frm->addMessage('<p>The box below sets <code>$PHORUM[\'mod_htmlpurifier\'][\'wysiwyg\']</code>.
    When checked, contents sent for edit are now purified and the
    informative message is disabled. If your WYSIWYG editor is disabled for
    admin edits, you can safely keep this unchecked.</p>');
    $frm->addRow('Use WYSIWYG?', $frm->checkbox('wysiwyg', '1', '', $PHORUM['mod_htmlpurifier']['wysiwyg']));
    $frm->addMessage('<p>The box below sets <code>$PHORUM[\'mod_htmlpurifier\'][\'suppress_message\']</code>,
    which removes the big how-to use
    HTML Purifier message.</p>');
    $frm->addRow('Suppress information?', $frm->checkbox('suppress_message', '1', '', $PHORUM['mod_htmlpurifier']['suppress_message']));
    $frm->addMessage('<p>Click on directive links to read what each option does
    (links do not open in new windows).</p>
    <p>For more flexibility (for instance, you want to edit the full
    range of configuration directives), you can create a <tt>config.php</tt>
    file in your <tt>mods/htmlpurifier/</tt> directory. Doing so will,
    however, make the web configuration interface unavailable.</p>');
    require_once 'HTMLPurifier/Printer/ConfigForm.php';
    $htmlpurifier_form = new HTMLPurifier_Printer_ConfigForm('config', 'http://htmlpurifier.org/live/configdoc/plain.html#%s');
    $htmlpurifier_form->setTextareaDimensions(23, 7);
    // widen a little, since we have space
    $frm->addMessage($htmlpurifier_form->render($config, $PHORUM['mod_htmlpurifier']['directives'], false));
    $frm->addMessage("<strong>Warning: Changing HTML Purifier's configuration will invalidate\r\n      the cache. Expect to see a flurry of database activity after you change\r\n      any of these settings.</strong>");
    $frm->addrow('Reset to defaults:', $frm->checkbox("reset", "1", "", false));
    // hack to include extra styling
    echo '<style type="text/css">' . $htmlpurifier_form->getCSS() . '
    .hp-config {margin-left:auto;margin-right:auto;}
    </style>';
    $js = $htmlpurifier_form->getJavaScript();
    echo '<script type="text/javascript">' . "<!--\n{$js}\n//-->" . '</script>';
    $frm->show();
}
コード例 #2
0
ファイル: newforum.php プロジェクト: netovs/Core
            foreach ($slaves as $id => $data) {
                array_shift($data['forum_path']);
                $edit_url = phorum_admin_build_url(array('module=edit' . ($data['folder_flag'] ? 'folder' : 'forum'), "forum_id={$id}"));
                $add_inherit_text .= "<li><a href=\"{$edit_url}\">" . implode(" / ", $data['forum_path']) . "</li>\n";
            }
            $add_inherit_text .= "</ul>\n";
        }
    }
    $inherit_id_options = phorum_api_forums_get_inherit_id_options($forum_id);
    $row = $frm->addrow("Inherit the settings below this option from", $frm->select_tag("inherit_id", $inherit_id_options, $inherit_id, $disabled_form_input_inherit) . $add_inherit_text);
}
$frm->addbreak("Moderation / Permissions");
$row = $frm->addrow("Moderate Messages", $frm->select_tag("moderation", array(PHORUM_MODERATE_OFF => "Disabled", PHORUM_MODERATE_ON => "Enabled"), $moderation, $disabled_form_input));
$frm->addhelp($row, "Moderate Messages", "This setting determines whether messages are visible to users immediately after they are posted.  If enabled, all messages will remain hidden until approved by a moderator.");
$frm->addrow("Email Messages To Moderators", $frm->select_tag("email_moderators", array(PHORUM_EMAIL_MODERATOR_OFF => "Disabled", PHORUM_EMAIL_MODERATOR_ON => "Enabled"), $email_moderators, $disabled_form_input));
$pub_perm_frm = $frm->checkbox("pub_perms[" . PHORUM_USER_ALLOW_READ . "]", 1, "Read", $pub_perms & PHORUM_USER_ALLOW_READ, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("pub_perms[" . PHORUM_USER_ALLOW_REPLY . "]", 1, "Reply", $pub_perms & PHORUM_USER_ALLOW_REPLY, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("pub_perms[" . PHORUM_USER_ALLOW_NEW_TOPIC . "]", 1, "Create&nbsp;New&nbsp;Topics", $pub_perms & PHORUM_USER_ALLOW_NEW_TOPIC, $disabled_form_input) . "<br />" . $frm->checkbox("pub_perms[" . PHORUM_USER_ALLOW_ATTACH . "]", 1, "Attach&nbsp;Files", $pub_perms & PHORUM_USER_ALLOW_ATTACH, $disabled_form_input);
$frm->addrow("Public Anonymous Users", $pub_perm_frm);
$reg_perm_frm = $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_READ . "]", 1, "Read", $reg_perms & PHORUM_USER_ALLOW_READ, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_REPLY . "]", 1, "Reply", $reg_perms & PHORUM_USER_ALLOW_REPLY, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_NEW_TOPIC . "]", 1, "Create&nbsp;New&nbsp;Topics", $reg_perms & PHORUM_USER_ALLOW_NEW_TOPIC, $disabled_form_input) . "<br />" . $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_EDIT . "]", 1, "Edit&nbsp;Their&nbsp;Posts", $reg_perms & PHORUM_USER_ALLOW_EDIT, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_ATTACH . "]", 1, "Attach&nbsp;Files", $reg_perms & PHORUM_USER_ALLOW_ATTACH, $disabled_form_input) . "<br/>" . $frm->checkbox('allow_email_notify', 1, 'Allow email notification for following topics', $allow_email_notify, $disabled_form_input);
$row = $frm->addrow("Registered Users", $reg_perm_frm);
$frm->addhelp($row, "Registered Users", "These are the permissions that apply to registered users. Note that these permissions can be overridden by permissions that were granted directly to the user or to a group to which a user belongs.");
$frm->addbreak("Display Settings");
$frm->addrow("Fixed Display-Settings (user can't override them)", $frm->select_tag("display_fixed", array("No", "Yes"), $display_fixed, $disabled_form_input));
$frm->addrow("Template", $frm->select_tag("template", phorum_api_template_list(TRUE), $template, $disabled_form_input));
$frm->addrow("Language", $frm->select_tag("language", phorum_api_lang_list(TRUE), $language, $disabled_form_input));
$frm->addrow("List View", $frm->select_tag("threaded_list", array("Flat", "Threaded"), $threaded_list, $disabled_form_input));
$frm->addrow("Read View", $frm->select_tag("threaded_read", array("Flat", "Threaded", "Hybrid"), $threaded_read, $disabled_form_input));
$frm->addrow("Reverse Threading", $frm->select_tag("reverse_threading", array("No", "Yes"), $reverse_threading, $disabled_form_input));
$frm->addrow("Move Threads On Reply", $frm->select_tag("float_to_top", array("No", "Yes"), $float_to_top, $disabled_form_input));
$frm->addrow("Message List Length (Flat Mode)", $frm->text_box("list_length_flat", $list_length_flat, 10, false, false, $disabled_form_input));
$frm->addrow("Message List Length (Threaded Mode, Nr. of Threads)", $frm->text_box("list_length_threaded", $list_length_threaded, 10, false, false, $disabled_form_input));
$frm->addrow("Read Page Length", $frm->text_box("read_length", $read_length, 10, false, false, $disabled_form_input));
コード例 #3
0
ファイル: customprofile.php プロジェクト: sleepy909/cpassman
    $length = $field['length'];
    $html_disabled = $field['html_disabled'];
    $show_in_admin = isset($field['show_in_admin']) ? $field['show_in_admin'] : 0;
    $title = "Edit Profile Field";
    $submit = "Update";
}
// Display the custom profile field editor.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", $submit);
$frm->hidden("module", "customprofile");
$frm->hidden("curr", "{$curr}");
$frm->addbreak($title);
$row = $frm->addrow("Field Name", $frm->text_box('name', $name, 50));
$frm->addhelp($row, "Field Name", "This is the name to assign to the custom profile field. Because it must be possible to use this name as the name property for an input element in an HTML form, there are a few restrictions to it:<br/><ul><li>it can only contain letters, numbers<br/> and underscores (_);</li><li>it must start with a letter.</li></ul>");
$frm->addrow("Field Length (Max. " . PHORUM_MAX_CPLENGTH . ")", $frm->text_box("length", $length, 50));
$row = $frm->addrow("Disable HTML", $frm->checkbox("html_disabled", 1, "Yes", $html_disabled));
$frm->addhelp($row, "Disable HTML", "\n    If this option is enabled, then HTML code will not be usable\n    in this field. When displaying the custom field's data,\n    Phorum will automatically replace special HTML characters\n    with their safe HTML counter parts.<br/>\n    <br/>\n    There are two possible reasons for disabling it:<br/>\n    <ol>\n      <li>You need HTML in this field and run a module which formats\n          the field data into safe html (before storing it to the database\n          or before displaying it on screen).\n      <li>You run a module that needs to store an array in the field.\n    </ol>\n    So in practice, you only disable this option if module documentation tells\n    you to do so or if you are writing a module which needs this. If you don't\n    understand what's going on here, then don't disable the option.<br/>\n    <br/>\n    To learn about the security risks involved, search for \"XSS\" and\n    \"cross site scripting\" on the internet.");
$row = $frm->addrow("Show in user admin", $frm->checkbox("show_in_admin", 1, "Yes", $show_in_admin));
$frm->addhelp($row, "Show in user admin", "If this option is enabled, then the contents of the field will be displayed on the user details page in the Phorum admin interface (section \"Edit Users\").");
$frm->show();
// If we are not in edit mode, we show the list of available profile fields.
if ($curr == "NEW") {
    print "Creating a custom profile field here merely allows for the use\n           of the field. If you want to use it as an extra info field for\n           your users, you will need to edit the register, control center\n           and profile templates to actually allow users to enter data in\n           the fields and have it stored. You will have to use the name\n           you enter here as the name property of the HTML form element.\n           <hr class=\"PhorumAdminHR\" />";
    if (isset($PHORUM['PROFILE_FIELDS']["num_fields"])) {
        unset($PHORUM['PROFILE_FIELDS']["num_fields"]);
    }
    $active_fields = 0;
    foreach ($PHORUM["PROFILE_FIELDS"] as $f) {
        if (empty($f['deleted'])) {
            $active_fields++;
        }
コード例 #4
0
ファイル: settings.php プロジェクト: mgs2/kw-forum
    $settings["min_length"] = (int) $_POST["min_length"];
    $settings["only_lowercase"] = isset($_POST["only_lowercase"]) ? 1 : 0;
    // Valid chars is a bit special.
    $settings["valid_chars"] = isset($_POST["valid_chars"]) ? implode("", array_keys($_POST["valid_chars"])) : "";
    // Take care of applying sane settings.
    if ($settings["min_length"] < 0) {
        $settings["min_length"] = 0;
    }
    if ($settings["max_length"] < $settings["min_length"] && $settings["max_length"] != 0) {
        $settings["max_length"] = $settings["min_length"];
    }
    // Save settings array.
    $PHORUM["mod_username_restrictions"] = $settings;
    phorum_db_update_settings(array("mod_username_restrictions" => $settings));
    phorum_admin_okmsg("The module settings were successfully saved.");
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "username_restrictions");
$frm->addbreak("Edit settings for the username restrictions module");
$frm->addrow("Minimum username length (0 = no restriction)", $frm->text_box('min_length', $PHORUM["mod_username_restrictions"]["min_length"], 6));
$frm->addrow("Maximum username length (0 = no restriction)", $frm->text_box('max_length', $PHORUM["mod_username_restrictions"]["max_length"], 6));
$checkboxes = '';
foreach ($valid_chars_options as $k => $v) {
    $enabled = strpos($PHORUM["mod_username_restrictions"]["valid_chars"], $k) === FALSE ? 0 : 1;
    $checkboxes .= $frm->checkbox("valid_chars[{$k}]", "1", "", $enabled) . " {$v}<br/>";
}
$frm->addrow("Valid username characters (check none for no restrictions)", $checkboxes);
$frm->addrow("Allow only lower case characters", $frm->checkbox("only_lowercase", "1", "", $PHORUM["mod_username_restrictions"]["only_lowercase"]) . ' Yes');
$frm->show();
コード例 #5
0
ファイル: settings.php プロジェクト: nistormihai/Newscoop
        if(!phorum_db_update_settings(array("mod_bb_code"=>$PHORUM["mod_bb_code"]))){
            $error="Database error while updating settings.";
        }
        else {
            echo "Settings Updated<br />";
        }
    }

    include_once "./include/admin/PhorumInputForm.php";
    $frm = new PhorumInputForm ("", "post", "Save");
    $frm->hidden("module", "modsettings");
    $frm->hidden("mod", "bbcode"); // this is the directory name that the Settings file lives in

    if (!empty($error)){
        echo "$error<br />";
    }
    $frm->addbreak("Edit settings for the BBCode module");
    $frm->addmessage("When users post links on your forum, you can choose whether they open in a new window.");
    $frm->addrow("Open links in new window: ", $frm->checkbox("links_in_new_window", "1", "", $PHORUM["mod_bb_code"]["links_in_new_window"]));
    $frm->addmessage("Enable <a href=\"http://en.wikipedia.org/wiki/Blog_spam\" target=\"_blank\">
        Google's new anti-spam protocol</a> for links posted on your forums.
        <br/>
        Note, this doesn't stop spam links being posted, but it does mean that
        spammers don't get credit from Google from that link.");
    $frm->addrow("Use 'rel=nofollow' anti-spam tag: ", $frm->checkbox("rel_no_follow", "1", "", $PHORUM["mod_bb_code"]["rel_no_follow"]));
    $frm->addmessage("As of Phorum 5.1, there is the option to have quoted text altered by modules.  Since it only makes sense to have one module modifying the quoted text, you can disable this one part of this module.");

    $frm->addrow("Enable quote hook", $frm->checkbox("quote_hook", "1", "", $PHORUM["mod_bb_code"]["quote_hook"]));
    $frm->show();
?>
コード例 #6
0
        phorum_admin_error($error);
    }

    include_once "./include/admin/PhorumInputForm.php";

    $frm = new PhorumInputForm ("", "post", $submit);

    $frm->hidden("module", "customprofile");

    $frm->hidden("curr", "$curr");

    $frm->addbreak($title);

    $frm->addrow("Field Name", $frm->text_box("string", $string, 50));
    $frm->addrow("Field Length (Max. 65000)", $frm->text_box("length", $length, 50));
    $frm->addrow("Disable HTML", $frm->checkbox("html_disabled",1,"Yes",$html_disabled));

    $frm->show();

    echo "This will only add the field to the list of allowed fields.  You will need to edit the register and profile templates to actually allow users to use the fields.  Use the name you enter here as the name property of the HTML form element.";

    if($curr=="NEW"){

        echo "<hr class=\"PhorumAdminHR\" />";
        if(isset($PHORUM['PROFILE_FIELDS']["num_fields"]))
            unset($PHORUM['PROFILE_FIELDS']["num_fields"]);

        if(count($PHORUM["PROFILE_FIELDS"])){

            echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"PhorumAdminTable\" width=\"100%\">\n";
            echo "<tr>\n";
コード例 #7
0
ファイル: mods.php プロジェクト: samuell/Core
// Display status information about possible module problems
// ----------------------------------------------------------------------
// Show module problems to the admin.
if (count($list['problems'])) {
    foreach ($list['problems'] as $problem) {
        phorum_admin_error($problem);
    }
}
// ----------------------------------------------------------------------
// Build the form
// ----------------------------------------------------------------------
// Just used for building form elements.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "");
$frm_url = phorum_admin_build_url();
$html = "<form id=\"modules_form\" " . "action=\"{$frm_url}\" method=\"post\">" . "<input type=\"hidden\" name=\"phorum_admin_token\"\n                value=\"{$PHORUM['admin_token']}\" />" . "<input style=\"display:none\" type=\"submit\" " . "value=\"catch [enter] key\" onclick=\"return false\"/>" . "<input type=\"hidden\" name=\"module\" value=\"mods\" />" . "<input type=\"hidden\" name=\"do_module_updates\" value=\"1\" />" . "<div class=\"PhorumAdminTitle\">Phorum module settings</div>" . "<div class=\"modules_filter\">" . "<strong>Filter:</strong> " . "show " . $frm->select_tag('filter_status', array(0 => 'all', 1 => 'enabled', 2 => 'disabled'), isset($_POST['filter_status']) ? $_POST['filter_status'] : 0, 'onchange="filter_modules(this.form)"') . " modules, matching " . $frm->text_box('filter_text', isset($_POST['filter_text']) ? $_POST['filter_text'] : '', 30, NULL, FALSE, 'onkeyup="filter_modules(this.form)" id="filter_text"') . $frm->checkbox('hide_description', 1, 'hide descriptions', isset($_POST['hide_description']) ? 1 : 0, 'style="margin-left:1em" ' . 'onchange="filter_modules(this.form)" ' . 'id="hide_descriptions"') . "</div>";
foreach ($list['modules'] as $name => $info) {
    // Disable a module if it's enabled, but should be disabled based
    // on the Phorum version.
    if ($info['version_disabled'] && $info['enabled']) {
        phorum_admin_error("Minimum Phorum-Version requirement not met for " . "module \"" . htmlspecialchars($name) . "\"<br/>" . "It requires at least version " . "\"" . htmlspecialchars($info['required_version']) . "\", " . "but the current version is \"" . PHORUM . "\".<br />" . "The module was disabled to avoid malfunction of " . "your Phorum because of that requirement.<br/>");
        phorum_api_modules_disable($name);
        phorum_api_modules_save();
        $info['version_disabled'] = TRUE;
    }
    $id = base64_encode("mods_{$name}");
    $title = $info["title"];
    if (isset($info["version"])) {
        $title .= " (version " . $info["version"] . ")";
    }
    // Compatibility modules are handles in a special way. These are
コード例 #8
0
ファイル: newfolder.php プロジェクト: mgs2/kw-forum
        }
    }
    if ($vroot == $forum_id) {
        $vroot = 1;
    } else {
        $foreign_vroot = $vroot;
        $vroot = 0;
    }
} else {
    $frm->hidden("module", "newfolder");
    $title = "Add A Folder";
    $folders = $folder_data;
    $vroot = 0;
    $active = 1;
    $template = $PHORUM["default_forum_options"]["template"];
}
$frm->hidden("folder_flag", "1");
$frm->addbreak($title);
$frm->addrow("Folder Title", $frm->text_box("name", $name, 30));
$frm->addrow("Folder Description", $frm->textarea("description", $description, $cols = 60, $rows = 10, "style=\"width: 100%;\""), "top");
$frm->addrow("Folder", $frm->select_tag("parent_id", $folders, $parent_id));
$frm->addrow("Visible", $frm->select_tag("active", array("No", "Yes"), $active));
$frm->addbreak("Display Settings");
$frm->addrow("Template", $frm->select_tag("template", phorum_get_template_info(), $template));
$frm->addrow("Language", $frm->select_tag("language", phorum_get_language_info(), $language));
$frm->addrow("Virtual Root for descending forums/folders", $frm->checkbox("vroot", "1", "enabled", $vroot ? 1 : 0));
if ($foreign_vroot > 0) {
    $frm->addrow("This folder is in the Virtual Root of:", $folders[$foreign_vroot]);
}
phorum_hook("admin_editfolder_form", $frm, $forum_settings);
$frm->show();
コード例 #9
0
ファイル: settings.php プロジェクト: samuell/Core
<?php

if (!defined("PHORUM_ADMIN")) {
    return;
}
// Apply default settings.
require_once './mods/editor_tools/defaults.php';
// Save the settings to the database.
if (count($_POST)) {
    $PHORUM["mod_editor_tools"] = array("enable_help" => $_POST["enable_help"] ? 1 : 0);
    $PHORUM['DB']->update_settings(array("mod_editor_tools" => $PHORUM["mod_editor_tools"]));
    phorum_admin_okmsg("The settings were successfully saved.");
}
// Build the settings form.
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "editor_tools");
$frm->addbreak("Edit settings for the Editor Tools module");
$row = $frm->addrow("Enable Help tool", $frm->checkbox("enable_help", "1", "", $PHORUM["mod_editor_tools"]["enable_help"]) . ' Yes');
$frm->addhelp($row, "Enable Help tool", "If you enable this option, then a help button will be added to\n     the tool bar. This help button can be used to open help pages\n     that are registered by other modules (e.g. to show a list of\n     smileys or available BBcode tags).");
$frm->show();
コード例 #10
0
ファイル: newforum.php プロジェクト: sleepy909/cpassman
        $add_inherit_text .= "</ul>\n";
    }
    $row = $frm->addrow("Inherit Settings from Forum", $frm->select_tag("inherit_id", $forum_list, $inherit_id, $disabled_form_input_inherit) . $add_inherit_text);
    // Set Settings from inherit forum
    if ($forum_settings_inherit) {
        $forum_settings = $forum_settings_inherit;
        extract($forum_settings[$inherit_id]);
    }
}
$frm->addbreak("Moderation / Permissions");
$row = $frm->addrow("Moderate Messages", $frm->select_tag("moderation", array(PHORUM_MODERATE_OFF => "Disabled", PHORUM_MODERATE_ON => "Enabled"), $moderation, $disabled_form_input));
$frm->addhelp($row, "Moderate Messages", "This setting determines whether messages are visible to users immediately after they are posted.  If enabled, all messages will remain hidden until approved by a moderator.");
$frm->addrow("Email Messages To Moderators", $frm->select_tag("email_moderators", array(PHORUM_EMAIL_MODERATOR_OFF => "Disabled", PHORUM_EMAIL_MODERATOR_ON => "Enabled"), $email_moderators, $disabled_form_input));
$row = $frm->addrow("Allow Email Notification for following topics", $frm->select_tag("allow_email_notify", array("No", "Yes"), $allow_email_notify, $disabled_form_input));
$frm->addhelp($row, "Allow Email Notification", "This option determines if it is possible for users to use email notification when following topics within this forum.<br/><br/>This does not only apply to enabling email notification at post time, but it also applies to clicking on \"" . $PHORUM["DATA"]["LANG"]["FollowThread"] . "\" from the message read page and to managing subscriptions from the user control center.");
$pub_perm_frm = $frm->checkbox("pub_perms[" . PHORUM_USER_ALLOW_READ . "]", 1, "Read", $pub_perms & PHORUM_USER_ALLOW_READ, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("pub_perms[" . PHORUM_USER_ALLOW_REPLY . "]", 1, "Reply", $pub_perms & PHORUM_USER_ALLOW_REPLY, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("pub_perms[" . PHORUM_USER_ALLOW_NEW_TOPIC . "]", 1, "Create&nbsp;New&nbsp;Topics", $pub_perms & PHORUM_USER_ALLOW_NEW_TOPIC, $disabled_form_input) . "<br />" . $frm->checkbox("pub_perms[" . PHORUM_USER_ALLOW_ATTACH . "]", 1, "Attach&nbsp;Files", $pub_perms & PHORUM_USER_ALLOW_ATTACH, $disabled_form_input);
$frm->addrow("Public Users", $pub_perm_frm);
$reg_perm_frm = $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_READ . "]", 1, "Read", $reg_perms & PHORUM_USER_ALLOW_READ, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_REPLY . "]", 1, "Reply", $reg_perms & PHORUM_USER_ALLOW_REPLY, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_NEW_TOPIC . "]", 1, "Create&nbsp;New&nbsp;Topics", $reg_perms & PHORUM_USER_ALLOW_NEW_TOPIC, $disabled_form_input) . "<br />" . $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_EDIT . "]", 1, "Edit&nbsp;Their&nbsp;Posts", $reg_perms & PHORUM_USER_ALLOW_EDIT, $disabled_form_input) . "&nbsp;&nbsp;" . $frm->checkbox("reg_perms[" . PHORUM_USER_ALLOW_ATTACH . "]", 1, "Attach&nbsp;Files", $reg_perms & PHORUM_USER_ALLOW_ATTACH, $disabled_form_input);
$row = $frm->addrow("Registered Users", $reg_perm_frm);
$frm->addhelp($row, "Registered Users", "These settings do not apply to users that are granted permissions directly via the user admin or via a group permissions.");
$frm->addbreak("Display Settings");
$frm->addrow("Fixed Display-Settings (user can't override them)", $frm->select_tag("display_fixed", array("No", "Yes"), $display_fixed, $disabled_form_input));
$frm->addrow("Template", $frm->select_tag("template", phorum_get_template_info(), $template, $disabled_form_input));
$frm->addrow("Language", $frm->select_tag("language", phorum_get_language_info(), $language, $disabled_form_input));
$frm->addrow("List View", $frm->select_tag("threaded_list", array("Flat", "Threaded"), $threaded_list, $disabled_form_input));
$frm->addrow("Read View", $frm->select_tag("threaded_read", array("Flat", "Threaded", "Hybrid"), $threaded_read, $disabled_form_input));
$frm->addrow("Reverse Threading", $frm->select_tag("reverse_threading", array("No", "Yes"), $reverse_threading, $disabled_form_input));
$frm->addrow("Move Threads On Reply", $frm->select_tag("float_to_top", array("No", "Yes"), $float_to_top, $disabled_form_input));
$frm->addrow("Message List Length (Flat Mode)", $frm->text_box("list_length_flat", $list_length_flat, 10, false, false, $disabled_form_input));
$frm->addrow("Message List Length (Threaded Mode, Nr. of Threads)", $frm->text_box("list_length_threaded", $list_length_threaded, 10, false, false, $disabled_form_input));
$frm->addrow("Read Page Length", $frm->text_box("read_length", $read_length, 10, false, false, $disabled_form_input, $disabled_form_input));
コード例 #11
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();
コード例 #12
0
ファイル: settings.php プロジェクト: netovs/Core
    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.
require_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", "Yes", $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->addrow("Hide passwords in log messages", $frm->checkbox("hide_passwords", "1", "Yes", $settings["hide_passwords"]));
$frm->addhelp($row, "Hide passwords in log messages", "If this option is enabled, then passwords and user registration codes in logged messages are replaced with \"XXXXXXXX\". In general, it is good practice to not log these because of security implications (the passwords are stored in plain text format in the database), but if you need access to the passwords, then you can disable this option.<br/><br/>Note: this option only affects new messages that are logged.");
$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", "Yes", $settings["do_log_{$type}"]));
    }
}
$frm->show();
コード例 #13
0
ファイル: settings.php プロジェクト: netovs/Core
// ----------------------------------------------------------------------
$frm->addbreak("Log settings");
if (!file_exists('./mods/event_logging')) {
    $check = '<span style="color:red">The Event Logging module ' . 'is currently not installed; logging cannot ' . 'be enabled</span>';
    $disabled = 'disabled="disabled"';
    $PHORUM["mod_spamhurdles"]["log_events"] = 0;
} elseif (empty($PHORUM['mods']['event_logging'])) {
    $check = '<span style="color:red">The Event Logging module ' . 'is currently not activated; logging cannot ' . 'be enabled</span>';
    $disabled = 'disabled="disabled"';
    $PHORUM["mod_spamhurdles"]["log_events"] = 0;
} else {
    $check = '<span style="color:darkgreen">The Event Logging module ' . 'is activated; events can be logged by enabling the ' . 'feature below</span>';
    $disabled = '';
}
$frm->addrow($check, '');
$row = $frm->addrow('Log blocked form posts to the Event Logging module?', $frm->checkbox("log_events", 1, "Yes", $PHORUM["mod_spamhurdles"]["log_events"], $disabled));
$url = phorum_admin_build_url(array('module=modsettings', 'mod=event_logging', 'el_action=logviewer'));
$frm->addhelp($row, "Log blocked form posts to the Event Logging module?", "When both this feature and the Event Logging module are enabled,\n     then the Spam Hurdles module will log information about blocked\n     form posts to the Phorum Event Log. To view this log, go to\n     <a href=\"{$url}\">the Event Log viewer</a>");
// ----------------------------------------------------------------------
// Configure spam hurdles for posting messages
// ----------------------------------------------------------------------
$frm->addbreak("Spam Hurdles for posting new messages");
$row = $frm->addrow('What action has to be taken when a spam message is suspected?', $frm->select_tag('posting_block_action', array('blockerror' => 'Fully block and show an error', 'unapprove' => 'Accept, but make unapproved'), $PHORUM['mod_spamhurdles']['posting']['block_action']));
$frm->addhelp($row, "Action when a spam message is suspected", "You can choose whether you want to fully block suspected spam messages\n     or that you want to have them posted in a moderated state, so they\n     will need approval by a moderator.<br/>\n     <br/>\n     A message is suspicious if it fails one of the spam hurdles:<br/>\n     <ul>\n       <li>Block forms that are submitted multiple times</li>\n       <li>Check if an HTML commented form field is submitted</li>\n       <li>Let the browser sign the form using JavaScript</li>\n     </ul>\n     For the remaining hurdles, an error state might be resolved by\n     the user (e.g. by filling in the correct CAPTCHA code or by\n     resubmitting a too quickly posted form). For those errors,\n     there will always be an error message and a chance for the\n     user to fix the issue to make posting possible.");
create_spamhurdle_options($frm, 'posting', array('posting.tpl', 'posting_messageform.tpl'), 'tpl_editor_before_textarea', array("none" => "Disable hurdle", "anonymous" => "Enable for anonymous users", "all" => "Enable for all users"));
// ----------------------------------------------------------------------
// Configure spam hurdles for user registration
// ----------------------------------------------------------------------
$frm->addbreak("Spam Hurdles for user registration");
create_spamhurdle_options($frm, 'register', array('register.tpl'), 'tpl_register_form', array("none" => "Disable hurdle", "all" => "Enable hurdle"));
// ----------------------------------------------------------------------
コード例 #14
0
ファイル: settings.php プロジェクト: samuell/Core
            }
        }
    }
    // Store the new settings array.
    $PHORUM['DB']->update_settings(array('mod_bbcode' => $PHORUM['mod_bbcode']));
    phorum_admin_okmsg("The settings were successfully saved.");
    if ($nr_of_enabled_tags > 0 && empty($PHORUM['mods']['editor_tools'])) {
        phorum_admin_error("<b>Notice:</b> You have configured one or more BBcode tags to add a button to the editor tool bar. However, you have not enabled the Editor Tools module. If you want to use the tool buttons, then remember to activate the Editor Tools module.");
    }
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save settings");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "bbcode");
$frm->addbreak("General settings for the BBcode module");
$row = $frm->addrow("Open links in new window", $frm->checkbox("links_in_new_window", "1", "Yes", $PHORUM["mod_bbcode"]["links_in_new_window"]));
$frm->addhelp($row, "Open links in new window", "When users post links on your forum, you can choose whether to open these in a new window or not.");
$row = $frm->addrow("Turn bare URLs into clickable links", $frm->checkbox("process_bare_urls", "1", "Yes", $PHORUM["mod_bbcode"]["process_bare_urls"]));
$frm->addhelp($row, "Turn bare URLs into clickable links", "If you enable this option, then the BBcode module will try to detect bare URLs in the message (URLs that are not surrounded by [url]...[/url] BBcode tags) and turn those into clickable links (as if they were surrounded by [url]...[/url]).");
$row = $frm->addrow("Turn bare email addresses into clickable links", $frm->checkbox("process_bare_email", "1", "Yes", $PHORUM["mod_bbcode"]["process_bare_email"]));
$frm->addhelp($row, "Turn bare email addresses into clickable links", "If you enable this option, then the BBcode module will try to detect bare email addresses in the message (addresses that are not surrounded by [email]...[/email] BBcode tags) and turn those into clickable links (as if they were surrounded by [email]...[/email]).");
$row = $frm->addrow("Show full URLs", $frm->checkbox("show_full_urls", "1", "Yes", $PHORUM["mod_bbcode"]["show_full_urls"]));
$frm->addhelp($row, "Show full URLs", "By default, URLs are truncated by phorum to show only [www.example.com]. This is done to prevent very long URLs from cluttering and distrurbing the web site layout. By enabling this feature, you can suppress the truncation, so full URLs are shown.");
$row = $frm->addrow("Add 'rel=nofollow' to links that are posted in your forum", $frm->checkbox("rel_no_follow", "1", "Yes", $PHORUM["mod_bbcode"]["rel_no_follow"]));
$frm->addhelp($row, "Add 'rel=nofollow' to links", 'You can enable Google\'s rel="nofollow" tag for links that are posted in your forums. This tag is used to discourage spamming links to web sites in forums (which can be done to influence search engines by implying that the site is a popular one, because of all the links).<br/><br/>Note that this does not stop spam links from being posted, but it does mean that spammers do not get any credit from Google for that link.');
$row = $frm->addrow("Enable BBcode quoting using the [quote] tag", $frm->checkbox("quote_hook", "1", "Yes", $PHORUM["mod_bbcode"]["quote_hook"]));
$frm->addhelp($row, "Enable BBcode [quote]", "If this feature is enabled, then quoting of messages is not done using the standard Phorum method (which resembles email message quoting), but using the BBcode module's quoting method instead. This means that the quoted text is placed within a [quote Author]...[/quote] bbcode block.<br/><br/>Two of the advantages of using this quote method is that the quoted message can be styles though CSS code and that no word wrapping is applied to the text.");
$row = $frm->addrow("Enable posting option \"disable BBcode\"", $frm->checkbox("allow_disable_per_post", "1", "Yes", $PHORUM["mod_bbcode"]["allow_disable_per_post"]));
$frm->addhelp($row, "Enable posting option \"disable BBcode\"", "If this feature is enabled, then your users can get an extra option in the posting editor for disabling the BBcode handling for the posted message. This can be useful if the user wants to post a text about BBcode tags or a text that contains strings that unintentionally match BBcode tags.<br/><br/>To make this option visible, you will have to add the code <b>{HOOK \"tpl_editor_disable_bbcode\"}</b> to the posting.tpl template file at an appropriate spot.");
$row = $frm->addrow("Enable BBcode escape sequence \\[...]", $frm->checkbox("enable_bbcode_escape", "1", "Yes", $PHORUM["mod_bbcode"]["enable_bbcode_escape"]));
$frm->addhelp($row, "Enable BBcode escape sequence", "If this feature is enabled, then your users can prepend BBcode tags with a backslash character in order to let the BBcode module ignore the tag. This is mostly useful for posting BBcode examples in a forum message. In the final rendered message, the backslash character will be hidden. For example, the following code could be added to a message:<br/><pre>\\[b]example for bold text\\[/b]<br/>\\[url=http://www.phorum.org]URL example\\[/url]<br/><br/>These would be showed in the final message as:<br/><pre>[b]example for bold text[/b]<br/>[url=http://www.phorum.org]URL example[/url]");
コード例 #15
0
ファイル: settings.php プロジェクト: mgs2/kw-forum
    }
    $PHORUM["mod_announcements"]["forum_id"] = (int) $_POST["forum_id"];
    $PHORUM["mod_announcements"]["pages"] = $_POST["pages"];
    $PHORUM["mod_announcements"]["disable_autodisplay"] = isset($_POST["disable_autodisplay"]) ? 1 : 0;
    $PHORUM["mod_announcements"]["only_show_unread"] = isset($_POST["only_show_unread"]) ? 1 : 0;
    $PHORUM["mod_announcements"]["number_to_show"] = (int) $_POST["number_to_show"];
    $PHORUM["mod_announcements"]["days_to_show"] = (int) $_POST["days_to_show"];
    phorum_db_update_settings(array("mod_announcements" => $PHORUM["mod_announcements"]));
    phorum_admin_okmsg("Announcement settings updated");
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "announcements");
$frm->addbreak("Announcement Settings");
$page_list = $frm->checkbox("pages[home]", 1, "Home page, root level forum list (index.php)", $PHORUM["mod_announcements"]["pages"]["home"]) . "<br/>" . $frm->checkbox("pages[index]", 1, "Any forum List (index.php)", $PHORUM["mod_announcements"]["pages"]["index"]) . "<br/>" . $frm->checkbox("pages[list]", 1, "Message List (list.php)", $PHORUM["mod_announcements"]["pages"]["list"]) . "<br/>" . $frm->checkbox("pages[read]", 1, "Read Message (read.php)", $PHORUM["mod_announcements"]["pages"]["read"]);
$frm->addrow("Announcements Appear On", $page_list);
$row = $frm->addrow("Disable automatic displaying of announcements?", $frm->checkbox("disable_autodisplay", 1, "Disable automatic displaying", $PHORUM["mod_announcements"]["disable_autodisplay"]));
$frm->addhelp($row, "Disable automatic displaying", "By default, the announcements will be displayed after the page header automatically. If you need more control over the exact placement, then enable this option. Then you can specify where you want the announcements to appear yourself by placing the code {MOD_ANNOUNCEMENTS} in your templates.");
$frm->addrow("Show only unread messages to the user?", $frm->checkbox("only_show_unread", 1, "Show only unread", $PHORUM["mod_announcements"]["only_show_unread"]));
$frm->addrow("Number To Show", $frm->text_box("number_to_show", $PHORUM["mod_announcements"]["number_to_show"], 10));
$frm->addrow("Maximum Days To Show", $frm->text_box("days_to_show", $PHORUM["mod_announcements"]["days_to_show"], 10) . " (0 = forever)");
$forum_list_global = phorum_get_forum_info(1, 0);
$frm->addrow("Announcement Forum", $frm->select_tag("forum_id", $forum_list_global, $PHORUM["mod_announcements"]["forum_id"]));
//$vroot_folders = phorum_db_get_forums(0, NULL, '\'forum_id\'');
$vroot_folders = phorum_get_forum_info(3, -1);
if (count($vroot_folders)) {
    $frm->addbreak("Announcement Forums for Virtual Root Folders");
    foreach ($vroot_folders as $vroot_folder_id => $vroot_path) {
        $forum_list_vroot = phorum_get_forum_info(1, $vroot_folder_id);
        $forum_list_vroot[0] = 'No Announcements for this Virtual Root';
コード例 #16
0
ファイル: logviewer.php プロジェクト: samuell/Core
$logs = event_logging_getlogs($page, $pagelength, $filter);
// ----------------------------------------------------------------------
// Display header form for paging and filtering.
// ----------------------------------------------------------------------
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", $filter_mode ? "Apply filter" : "Refresh page");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "event_logging");
$frm->hidden("curpage", $page);
$frm->hidden("el_action", $filter_mode ? "filter" : "logviewer");
$frm->addrow("<span style=\"float:right;margin-right:10px\">" . $frm->select_tag("pagelength", $pagelengths, $pagelength, 'onchange="this.form.submit()"') . "&nbsp;&nbsp;&nbsp\n         <input type=\"submit\" name=\"prevpage\" value=\"&lt;&lt;\"/>\n         page " . $frm->select_tag("page", $pagelist, $page, 'onchange="this.form.submit()"') . " of {$pages}\n         <input type=\"submit\" name=\"nextpage\" value=\"&gt;&gt;\"/>\n     </span>Number of entries: {$logcount}");
if ($filter_mode) {
    $frm->hidden("filter_mode", 1);
    $loglevel_checkboxes = '';
    foreach ($strings["LOGLEVELS"] as $l => $s) {
        $loglevel_checkboxes .= '<span style="white-space: nowrap">' . $frm->checkbox("show_loglevel[{$l}]", "1", "", isset($show_loglevel[$l]) ? 1 : 0, "id=\"llcb_{$l}\"") . ' <label for="llcb_' . $l . '"><img align="absmiddle" src="' . $PHORUM["http_path"] . '/mods/event_logging/images/loglevels/' . $l . '.png"/> ' . $s . '</label></span> ';
    }
    $row = $frm->addrow("Log levels to display", $loglevel_checkboxes);
    $frm->addhelp($row, "Log levels to display", "By using these checkboxes, you can limit the log levels that are displayed. If you do not check any of them, then no filtering will be applied and all log levels will be displayed.");
    $category_checkboxes = '';
    foreach ($strings["CATEGORIES"] as $l => $s) {
        $category_checkboxes .= '<span style="white-space: nowrap">' . $frm->checkbox("show_category[{$l}]", "1", "", isset($show_category[$l]) ? 1 : 0, "id=\"cacb_{$l}\"") . ' <label for="cacb_' . $l . '">' . $s . '</label></span> ';
    }
    $row = $frm->addrow("Categories to display", $category_checkboxes);
    $frm->addhelp($row, "Categories to display", "By using these checkboxes, you can limit the log categories that are displayed. If you do not check any of them, then no filtering will be applied and all log categories will be displayed.");
    $sources = array("" => "");
    $sources = array_merge($sources, event_logging_getsources());
    $row = $frm->addrow("Source to display", $frm->select_tag("source", $sources, isset($_POST["source"]) ? $_POST["source"] : ""));
    $row = $frm->addrow("Filter by user", "User ID " . $frm->text_box("user_id", isset($_POST["user_id"]) ? $_POST["user_id"] : "", 10) . " Username " . $frm->text_box("username", isset($_POST["username"]) ? $_POST["username"] : "", 20));
    $frm->addhelp($row, "Filter by user", "Using these fields, you can specify for what user you want to display the event logs.<br/><br/>The User ID must be the exact numeric id for the user.<br/><br/>In the username field, you can use the \"*\" wildcard (e.g. searching for \"john*\" would find both the users \"johndoe\" and \"johnny\").");
    $row = $frm->addrow("Filter by IP address", $frm->text_box("ip", isset($_POST["ip"]) ? $_POST["ip"] : "", 20));
コード例 #17
0
ファイル: settings.php プロジェクト: sleepy909/cpassman
// Display a warning in case there are no smiley images available.
if (!count($available_smileys)) {
    phorum_admin_error("<strong>Warning:</strong><br/>" . "No smiley images were found in your current smiley prefix " . "path. Please place some smileys in the directory " . htmlspecialchars($PHORUM["mod_smileys"]["prefix"]) . " or change your prefix path to point to a directory " . "containing smiley images.");
} elseif ($inactive_smileys) {
    phorum_admin_error("<strong>Warning:</strong><br/>" . "You have {$inactive_smileys} smiley(s) configured for which the " . "image file was not found (marked as \"UNAVAILBLE\" in the list " . "below). Delete the smiley(s) from the list or place the missing " . "images in the directory \"" . htmlspecialchars($PHORUM["mod_smileys"]["prefix"]) . "\". After " . "placing new smiley images, click \"Save settings\" to update " . "the smiley settings.");
}
// Create the smiley settings form.
if ($smiley_id == "NEW") {
    $frm = new PhorumInputForm("", "post", 'Save settings');
    $frm->hidden("module", "modsettings");
    $frm->hidden("mod", "smileys");
    $frm->hidden("action", "edit_settings");
    $frm->addbreak("Smiley Settings");
    $row = $frm->addrow("Smiley Prefix Path", $frm->text_box("prefix", $PHORUM["mod_smileys"]["prefix"], 30));
    $frm->addhelp($row, "Set the smiley image prefix path", "This option can be used to set the path to the directory where\n         you have stored your smileys. This path must be relative to the\n         directory in which you installed the Phorum software. Absolute\n         paths cannot be used here.");
    $row = $frm->addrow("Enable body smiley button in the editor tools", $frm->checkbox("smileys_tool_enabled", "1", "", $PHORUM["mod_smileys"]["smileys_tool_enabled"]) . ' Yes');
    $frm->addhelp($row, "Body smiley tool button", "If you enable this option, then a smiley button will be added to\n         the editor tools tool bar, which can be used to easily add smileys\n         to the message body. You also have to enable the Editor Tools\n         module to make use of this feature.");
    if (!empty($PHORUM["mod_smileys"]["smileys_tool_enabled"])) {
        $frm->addrow("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The width to use for the smileys popup", $frm->text_box("smiley_popup_width", $PHORUM["mod_smileys"]["smiley_popup_width"], 5) . ' pixels');
        $frm->addrow("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;How far to shift the smileys popup to the left", $frm->text_box("smiley_popup_offset", $PHORUM["mod_smileys"]["smiley_popup_offset"], 5) . ' pixels');
    }
    $row = $frm->addrow("Enable subject smiley button in the editor tools", $frm->checkbox("subjectsmileys_tool_enabled", "1", "", $PHORUM["mod_smileys"]["subjectsmileys_tool_enabled"]) . ' Yes');
    $frm->addhelp($row, "Subject smiley tool button", "If you enable this option, then a smiley button will be added\n         next to the subject text input, which can be used to easily add\n         smileys to the message subject. You also have to enable the\n         Editor Tools module to make use of this feature.");
    if (!empty($PHORUM["mod_smileys"]["subjectsmileys_tool_enabled"])) {
        $frm->addrow("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The width to use for the subject smileys popup", $frm->text_box("subjectsmiley_popup_width", $PHORUM["mod_smileys"]["subjectsmiley_popup_width"], 5) . ' pixels');
        $frm->addrow("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;How far to shift the subject smileys popup to the left", $frm->text_box("subjectsmiley_popup_offset", $PHORUM["mod_smileys"]["subjectsmiley_popup_offset"], 5) . ' pixels');
    }
    $row = $frm->addrow("Enable posting option \"disable smileys\"", $frm->checkbox("allow_disable_per_post", "1", "Yes", $PHORUM["mod_smileys"]["allow_disable_per_post"]));
    $frm->addhelp($row, "Enable posting option \"disable smileys\"", "If this feature is enabled, then your users can get an extra option in the posting editor for disabling the smileys handling for the posted message. This can be useful if the user wants to post a text that contains strings that unintentionally match smileys.<br/><br/>To make this option visible, you will have to add the code <b>{HOOK \"tpl_editor_disable_smileys\"}</b> to the posting.tpl template file at an appropriate spot.");
    $frm->show();
}
コード例 #18
0
ファイル: users.php プロジェクト: sleepy909/cpassman
         $frm->addrow($item['name'], $itemval);
     }
 }
 phorum_hook("admin_users_form", $frm, $user);
 $frm->show();
 echo "<br /><hr class=\"PhorumAdminHR\" /><br /><a name=\"forums\"></a>";
 $frm = new PhorumInputForm("", "post", "Update");
 $frm->hidden("user_id", $_REQUEST["user_id"]);
 $frm->hidden("module", "users");
 $frm->hidden("section", "forums");
 $frm->hidden("referrer", $referrer);
 $row = $frm->addbreak("Edit Forum Permissions");
 $frm->addhelp($row, "Forum Permissions", "These are permissions set exclusively for this user.  You need to grant all permisssions you want the user to have for a forum here.  No permissions from groups or a forum's properties will be used once the user has specific permissions for a forum.");
 $forums = phorum_db_get_forums();
 $forumpaths = phorum_get_forum_info(1);
 $perm_frm = $frm->checkbox("new_forum_permissions[" . PHORUM_USER_ALLOW_READ . "]", 1, "Read") . "&nbsp;&nbsp;" . $frm->checkbox("new_forum_permissions[" . PHORUM_USER_ALLOW_REPLY . "]", 1, "Reply") . "&nbsp;&nbsp;" . $frm->checkbox("new_forum_permissions[" . PHORUM_USER_ALLOW_NEW_TOPIC . "]", 1, "Create&nbsp;New&nbsp;Topics") . "&nbsp;&nbsp;" . $frm->checkbox("new_forum_permissions[" . PHORUM_USER_ALLOW_EDIT . "]", 1, "Edit&nbsp;Their&nbsp;Posts") . "<br />" . $frm->checkbox("new_forum_permissions[" . PHORUM_USER_ALLOW_ATTACH . "]", 1, "Attach&nbsp;Files") . "<br />" . $frm->checkbox("new_forum_permissions[" . PHORUM_USER_ALLOW_MODERATE_MESSAGES . "]", 1, "Moderate Messages") . "&nbsp;&nbsp;" . $frm->checkbox("new_forum_permissions[" . PHORUM_USER_ALLOW_MODERATE_USERS . "]", 1, "Moderate Users") . "&nbsp;&nbsp;";
 $arr[] = "Add A Forum...";
 foreach ($forumpaths as $forum_id => $forumname) {
     if (!isset($user["forum_permissions"][$forum_id]) && $forums[$forum_id]['folder_flag'] == 0) {
         $arr[$forum_id] = $forumname;
     }
 }
 if (count($arr) > 1) {
     $frm->addrow($frm->select_tag("new_forum", $arr), $perm_frm);
 }
 if (is_array($user["forum_permissions"])) {
     foreach ($user["forum_permissions"] as $forum_id => $perms) {
         $perm_frm = $frm->checkbox("forum_permissions[{$forum_id}][" . PHORUM_USER_ALLOW_READ . "]", 1, "Read", $perms & PHORUM_USER_ALLOW_READ) . "&nbsp;&nbsp;" . $frm->checkbox("forum_permissions[{$forum_id}][" . PHORUM_USER_ALLOW_REPLY . "]", 1, "Reply", $perms & PHORUM_USER_ALLOW_REPLY) . "&nbsp;&nbsp;" . $frm->checkbox("forum_permissions[{$forum_id}][" . PHORUM_USER_ALLOW_NEW_TOPIC . "]", 1, "Create&nbsp;New&nbsp;Topics", $perms & PHORUM_USER_ALLOW_NEW_TOPIC) . "&nbsp;&nbsp;" . $frm->checkbox("forum_permissions[{$forum_id}][" . PHORUM_USER_ALLOW_EDIT . "]", 1, "Edit&nbsp;Their&nbsp;Posts", $perms & PHORUM_USER_ALLOW_EDIT) . "<br />" . $frm->checkbox("forum_permissions[{$forum_id}][" . PHORUM_USER_ALLOW_ATTACH . "]", 1, "Attach&nbsp;Files", $perms & PHORUM_USER_ALLOW_ATTACH) . "<br />" . $frm->checkbox("forum_permissions[{$forum_id}][" . PHORUM_USER_ALLOW_MODERATE_MESSAGES . "]", 1, "Moderate Messages", $perms & PHORUM_USER_ALLOW_MODERATE_MESSAGES) . "&nbsp;&nbsp;" . $frm->checkbox("forum_permissions[{$forum_id}][" . PHORUM_USER_ALLOW_MODERATE_USERS . "]", 1, "Moderate Users", $perms & PHORUM_USER_ALLOW_MODERATE_USERS) . "&nbsp;&nbsp;" . $frm->hidden("forums[{$forum_id}]", $forum_id);
         $row = $frm->addrow($forumpaths[$forum_id] . "<br />" . $frm->checkbox("delforum[{$forum_id}]", 1, "Delete"), $perm_frm);
     }
 }
コード例 #19
0
ファイル: settings.php プロジェクト: sleepy909/cpassman
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "spamhurdles");
$frm->addbreak("Non interactive spam blocking methods for posting messages");
$userspec = array("none" => "Disable hurdle", "anonymous" => "Enable for anonymous users", "all" => "Enable for all users");
$blockspec = array("blockerror" => "Fully block and show an error", "unapprove" => "Accept, but make unapproved");
$row = $frm->addrow("What action has to be taken when blocking a message?", $frm->select_tag("blockaction", $blockspec, $PHORUM["mod_spamhurdles"]["blockaction"]));
$row = $frm->addrow("Block message forms that are submitted multiple times", $frm->select_tag("blockmultipost", $userspec, $PHORUM["mod_spamhurdles"]["blockmultipost"]));
$frm->addhelp($row, "Block multiple submits", "If this option is enabled, then a unique key will be generated for each new message. As soon as the message is posted, this key will be invalidated for posting. This effectively prevents people from going back in the browser and resubmitting a (slightly changed) message (flooding) as well as spammers who directly submit posting forms to Phorum's post.php, without fetching a fresh unique key first.<br/><br/><b>User impact:</b><br/>This does not affect the way in which people can use Phorum, so the recommended value for this option is \"Enable for all users\".");
$row = $frm->addrow("Block message forms that are submitted too quickly", $frm->select_tag("blockquickpost", $userspec, $PHORUM["mod_spamhurdles"]["blockquickpost"]));
$frm->addhelp($row, "Block quick message submits", "If this option is enabled, Phorum will check how much time there is between starting a new message and actually posting it. If a message is posted too quickly, then it's considered to come from a posting robot. To prevent users from accidentally posting the message too quickly themselves (For example by typing only \"yes\" in the body and hitting the submit button), the posting button is disabled as long as the server would block the message. On the button, a countdown is shown to display how many seconds the user has to wait before posting.<br/><br/><b>User impact:</b><br/>This option does work for all browsers, only for the posting button to be disabled, JavaScript support is required.");
$row = $frm->addrow("Check if an HTML commented form field is submitted", $frm->select_tag("commentfieldcheck", $userspec, $PHORUM["mod_spamhurdles"]["commentfieldcheck"]));
$frm->addhelp($row, "Comment form field check", "If this option is enabled, then an extra form field is added to the posting form. However, this form field is embedded within an HTML comment block. Because of that, normal web browsers will fully ignore this extra field. On the other hand, some badly written spam bots will recognize the code as a form field. If such a spam bot posts a message including this extra form field, the message will be blocked.<br/><br/><b>User impact:</b><br/>This does not affect the way in which people can use Phorum, so the recommended value for this option is \"Enable for all users\".");
$row = $frm->addrow("Let the browser sign the message using JavaScript", $frm->select_tag("jsmd5check", $userspec, $PHORUM["mod_spamhurdles"]["jsmd5check"]));
$frm->addhelp($row, "Let the browser sign the message", "If this option is enabled, then the browser will retrieve two pieces of data from the server. The browser will have to create a signature for this data (using MD5) and does so by running some JavaScript. The signing JavaScript code is put in the message editor in a scrambled way (using iScramble) and the browser will have to descramble it using JavaScript to be able to run the signing code.<br/><br/>Functionally, this is all done to force the use of JavaScript when posting a message. This can block those spambots that do not interpret JavaScript, but only try to post the unmodified form information that is found on the message posting page.<br/><br/><b>User impact:</b><br/>This option requires JavaScript support in the browser. If a user does not have JavaScript (enabled), then posting is not possible.");
$frm->addbreak("Interactive CAPTCHA");
$row = $frm->addrow("Let visitors solve a CAPTCHA when registering a new account?", $frm->checkbox("register_captcha", 1, "Yes", $PHORUM["mod_spamhurdles"]["register_captcha"]));
$frm->addhelp($row, "Registering CAPTCHA", "If this option is enabled, a CAPTCHA (Completely Automated Public Turing-test to tell Computers and Humans Apart) will be used when visitors are registering a new user account. A check is added to the registering process, where the user has to prove that he/she is a human, by solving a simple puzzle. Below you can specify which type of CAPTCHA to use for this.<br/><br/><b>User impact:</b><br/>The user will have to solve the CAPTCHA before a new account can be registered. So this will require an extra action by the user. The exact user impact depends on the type of CAPTCHA that is used.");
$row = $frm->addrow("Let visitors solve a CAPTCHA when posting a new message", $frm->select_tag("posting_captcha", $userspec, $PHORUM["mod_spamhurdles"]["posting_captcha"]));
$frm->addhelp($row, "Posting CAPTCHA", "If this option is enabled, a CAPTCHA (Completely Automated Public Turing-test to tell Computers and Humans Apart) will be used when posting a new message. A check is added to the posting process, where the user has to prove that he/she is a human, by solving a simple puzzle. Below you can specify which type of CAPTCHA to use for this.<br/><br/><b>User impact:</b><br/>The user will have to solve the CAPTCHA before a message can be posted. So this will require an extra action by the user. The exact user impact depends on the type of CAPTCHA that is used.");
$captchaspec = array('javascript' => 'Code, drawn using JavaScript', 'image' => 'Code, drawn using a GIF image', 'asciiart' => 'Code, drawn using ASCII art', 'plaintext' => 'Code, plain text format', 'maptcha' => 'Solve a simple math question', 'recaptcha' => 'Code, using the reCAPTCHA service');
$row = $frm->addrow("Which type of CAPTCHA?", $frm->select_tag("captcha_type", $captchaspec, $PHORUM["mod_spamhurdles"]["captcha_type"], "id=\"captcha_select\" onchange=\"handle_captcha_select()\""));
$frm->addhelp($row, "Type of CAPTCHA", "This module supports a wide range of CAPTCHA types. See the README that was bundled with this module for detailed information on these types and for deciding which one you want to use for your site.");
$row = $frm->addrow("Enable spoken CAPTCHA? You will need the program \"Flite\" for this.", $frm->checkbox("spoken_captcha", 1, "Yes", $PHORUM["mod_spamhurdles"]["spoken_captcha"]));
$frm->addhelp($row, "Enable spoken CAPTCHA", 'Vision impaired people can have trouble reading and thus solving a CAPTCHA. For those people, you can supply a spoken CAPTCHA code. To be able to use this option, the program "Flite" (Festival-Lite) has to be installed on the webserver. For information on this, see http://www.speech.cs.cmu.edu/flite/');
$warn = '';
if (!empty($PHORUM["mod_spamhurdles"]["flite_location"]) && !file_exists($PHORUM["mod_spamhurdles"]["flite_location"])) {
    $warn = '<div style="color:red">The flite program does not exist at the specified location</div>';
}
$row = $frm->addrow("What is full path of the \"flite\" executable? (e.g. /usr/bin/flite){$warn}", $frm->text_box("flite_location", $PHORUM["mod_spamhurdles"]["flite_location"], 30));
$frm->addmessage("<div id=\"settings_recaptcha\" class=\"input-form-td\"\n           style=\"margin:0; padding:10px; border: 1px solid navy\">\n      For using reCAPTCHA, you need a (free) public and private key.\n      Please signup at <a href=\"http://recaptcha.net\" target=\"_new\">the\n      reCAPTCHA</a> web site and enter the public and private key for your\n      web site's domain in the fields below.<br/><br/>\n      <table><tr><td>public key</td><td>" . $frm->text_box("recaptcha_pubkey", $PHORUM["mod_spamhurdles"]["recaptcha_pubkey"], 40) . "</td></tr>" . "<tr><td>private key</td><td>" . $frm->text_box("recaptcha_prvkey", $PHORUM["mod_spamhurdles"]["recaptcha_prvkey"], 40) . "</td></tr></table>\n      </div>");
$frm->show();