Ejemplo n.º 1
0
if (isset($_REQUEST["user_id"])) {
    print "<a href=\"" . htmlspecialchars($referrer) . "\">Back to the user overview</a><br/>";
    $user = phorum_api_user_get($_REQUEST["user_id"], TRUE);
    if (count($user)) {
        $frm = new PhorumInputForm("", "post", "Update");
        $frm->hidden("module", "users");
        $frm->hidden("section", "main");
        $frm->hidden("referrer", $referrer);
        $frm->hidden("user_id", $_REQUEST["user_id"]);
        $frm->addbreak("Edit User");
        $frm->addrow("User Name", htmlspecialchars($user["username"]) . "&nbsp;&nbsp;<a href=\"#forums\">Edit Forum Permissions</a>&nbsp;&nbsp;<a href=\"#groups\">Edit Groups</a>");
        $frm->addrow("Real Name", $frm->text_box("real_name", $user["real_name"], 50));
        $frm->addrow("Email", $frm->text_box("email", $user["email"], 50));
        $frm->addrow("Password (Enter to change)", $frm->text_box("password1", ""));
        $frm->addrow("Password (Confirmation)", $frm->text_box("password2", ""));
        $frm->addrow("Signature", $frm->textarea("signature", $user["signature"]));
        $frm->addrow("Active", $frm->select_tag("active", array("No", "Yes"), $user["active"]));
        $frm->addrow("Forum posts", $user["posts"]);
        $frm->addrow("Registration Date", phorum_date($PHORUM['short_date_time'], $user['date_added']));
        $row = $frm->addrow("Date last active", phorum_date($PHORUM['short_date_time'], $user['date_last_active']));
        $frm->addrow("Administrator", $frm->select_tag("admin", array("No", "Yes"), $user["admin"]));
        $frm->addhelp($row, "Date last active", "This shows the date, when the user was last seen in the forum. Check your setting on \"Track user usage\" in the \"General Settings\". As long as this setting is not enabled, the activity will not be tracked.");
        $cf_header_shown = 0;
        foreach ($PHORUM["PROFILE_FIELDS"] as $key => $item) {
            if ($key === 'num_rows' || !empty($item['deleted'])) {
                continue;
            }
            if (!empty($item['show_in_admin'])) {
                if (!$cf_header_shown) {
                    $frm->addbreak('Custom Profile Fields');
                    $cf_header_shown = 1;
Ejemplo n.º 2
0
if ($error) {
    phorum_admin_error($error);
} elseif (isset($_GET['message']) && $_GET['message'] == 'success') {
    $okmsg = "Settings updated";
    phorum_admin_okmsg($okmsg);
}
// create the time zone drop down array
for ($x = -23; $x <= 23; $x++) {
    $tz_range[$x] = $x;
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post");
$frm->addbreak("Phorum General Settings");
$frm->hidden("module", "settings");
$row = $frm->addrow("Phorum Title", $frm->text_box("title", $PHORUM["title"], 50));
$row = $frm->addrow("Phorum Description", $frm->textarea("description", $PHORUM["description"], 30, 5, "style='width: 100%'"));
$row = $frm->addrow("DNS Lookups", $frm->select_tag("dns_lookup", array("No", "Yes"), $PHORUM["dns_lookup"]));
$frm->addhelp($row, "DNS Lookups", "DNS is the system that (amongsts other things) is responsible for\n     translating host names into IP addresses and vice versa.\n     If DNS lookups are enabled, phorum will use DNS lookups for:\n     <ul>\n     <li>logging the hostname from which a message was posted, instead of\n         the plain IP address;</li>\n     <li>being able to create IP ban items based on host and domain names;</li>\n     <li>checking the email address that is for user registrations.</li>\n     </ul>\n     If Phorum keeps reporting illegal email addresses during signup or\n     if you are suffering from massive delays during posting messages,\n     then there might be DNS problems on your server. In that case, disable\n     DNS lookups as a work around.");
$row = $frm->addrow("Hide inaccessible Forums on the Index Page", $frm->select_tag("hide_forums", array("No", "Yes"), $PHORUM["hide_forums"]));
$frm->addhelp($row, "Hide inaccessible Forums on the Index Page", "By setting this to Yes, forums that users are not allowed to read will be hidden from them in the forums list.");
$row = $frm->addrow("Show New Counts for Forums on the Index Page", $frm->select_tag("show_new_on_index", array(PHORUM_NEWFLAGS_NOCOUNT => "No", PHORUM_NEWFLAGS_COUNT => "Yes", PHORUM_NEWFLAGS_CHECK => "No count, just indicator"), $PHORUM["show_new_on_index"]));
$frm->addhelp($row, "Show New Counts for Forums on the Index Page", "This feature will show registered users how many new messages and threads there are in each forum on the forum index page.  If you have a large number of posts, a large number of forums, a large number of users or some combination of the three, this setting could cause some performance issues.  If you see performance issues, try setting it to \"No count, just indicator\" or \"No\"");
$row = $frm->addrow("How to Display Forums and Folders on the Index Page", $frm->select_tag("index_style", array(PHORUM_INDEX_DIRECTORY => 'Directory Structure', PHORUM_INDEX_FLAT => 'Flat Structure'), $PHORUM["index_style"]));
$frm->addhelp($row, "How to Display Forums and Folders on the Index Page", "Forum has multiple displaying styles available for the index page:\n     <ul>\n     <li><b>Directory Structure:</b><br/>\n         <br/>\n         <em>This style resembles the way in which you normally would browse a\n         filesystem directory structure, hence the name.</em><br/>\n         <br/>\n         When using this style, the index page will show a list of folders\n         and a list of forums that are available in the folder for which the\n         index page is shown. The user can either go to a forum or traverse\n         the folder tree by going to one of the deeper folders.<br/><br/></li>\n     <li><b>Flat Structure</b><br/>\n         <br/>\n         <em>This style will present the user a flat list of category sections\n         with forums (and possibly folders) in them. This is the style\n         that most forums use nowadays.</em><br/>\n         <br/>\n         When using this style, the root index page will show category\n         sections with forums and folders in them. Each section is a folder\n         that is directly below the root. The folders and forums that are\n         in those folders are shown in the corresponding sections.<br/>\n         Forums that are placed directly in the root folder, will be\n         shown in a generic \"Forums\" section.<br/>\n         <br/>\n         When visiting a subfolder, then the folders and forums inside that\n         subfolder are shown. For a subfolder, No sections are displayed.\n         This means that browsing subfolders in the flat structure works\n         a bit like browsing them in the directory structure.</li>\n     </ul>");
$row = $frm->addrow("Go To Forum if only One Forum is Visible on the Index", $frm->select_tag("jump_on_single_forum", array("No", "Yes"), $PHORUM['jump_on_single_forum']));
$frm->addhelp($row, "Go To Forum if only One Forum is Visible on the Index", "By setting this to Yes, Phorum will automatically jump to a forum if that is the only forum visible on the index page. This can be useful in case you are running a forum site with only one forum (or where visitors see only one forum due to permission settings), so visitors do not have to do an additional click to get from the index to the forum.");
$row = $frm->addrow("Enable Moderator Notifications", $frm->select_tag("enable_moderator_notifications", array("No", "Yes"), $PHORUM["enable_moderator_notifications"]));
$frm->addhelp($row, "Enable Moderator Notifications", "By setting this to Yes, Phorum will display notice to the various kinds of moderators when they have a new item that requires their attention. For example, message moderators will see a notice whenever there is an unapproved message.");
$row = $frm->addrow("User Post Edit Time Limit (minutes)", $frm->text_box("user_edit_timelimit", $PHORUM["user_edit_timelimit"], 10));
$frm->addhelp($row, "User Post Edit Time Limit (minutes)", "If set to a value larger then 0, this acts as a time limit for post editing. Users will only be able to edit their own posts within this time limit. This only applies if a user has the necessary permissions to edit their post, and does not affect moderators.");
$row = $frm->addrow("Track Edit Changes", $frm->select_tag("track_edits", array("No", "Yes", "Yes, Moderator Only"), $PHORUM["track_edits"]));
Ejemplo n.º 3
0
        }
    }
    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();
Ejemplo n.º 4
0
} else {
    // load bad-words-list
    $banlists = phorum_db_get_banlists();
    $bad_words = $banlists[PHORUM_BAD_WORDS];
    include_once "./include/admin/PhorumInputForm.php";
    $frm = new PhorumInputForm("", "post", $submit);
    $frm->hidden("module", "badwords");
    $frm->hidden("curr", "{$curr}");
    $row = $frm->addbreak($title);
    if ($curr == 'NEW') {
        $frm->addmessage("This feature can be used to mask bad words in forum messages\n             with \"" . PHORUM_BADWORD_REPLACE . "\". All bad words will\n             automatically be replaced by that string. If you want to use\n             a different string (e.g. \"CENSORED\" or \"*****\"), then you\n             can change the definition of the constant\n             \"PHORUM_BADWORD_REPLACE\" in the Phorum file\n             include/constants.php.");
    }
    $row = $frm->addrow("Bad Word", $frm->text_box("string", $string, 50));
    $frm->addhelp($row, "Bad Word", "The word that you want to mask in forum messages.\n             Rules that apply to the matching are:\n             <ul>\n               <li><b>Only the full word</b> is matched, so \"foo\" would\n                   not mask (part of) \"foobar\";</li>\n               <li>The match is <b>case insensitive</b>, so \"foo\" would also\n                   mask \"FoO\".</li>\n             </ul>");
    $frm->addrow("Valid for Forum", $frm->select_tag("forum_id", $forum_list, $forum_id));
    $row = $frm->addrow('Comments', $frm->textarea('comments', $comments, 50, 7));
    $frm->addhelp($row, "Comments", "This field can be used to add some comments to the ban (why you\n             created it, when you did this, when the ban can be deleted, etc.)\n             These comments will only be shown on this page and are meant as\n             a means for the administrator to do some bookkeeping.");
    $frm->show();
    echo "<hr class=\"PhorumAdminHR\" />";
    if (count($bad_words)) {
        echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"PhorumAdminTable\" width=\"100%\">\n";
        echo "<tr>\n";
        echo "    <td class=\"PhorumAdminTableHead\">Word</td>\n";
        echo "    <td class=\"PhorumAdminTableHead\">Valid for Forum</td>\n";
        echo "    <td class=\"PhorumAdminTableHead\">&nbsp;</td>\n";
        echo "</tr>\n";
        foreach ($bad_words as $key => $item) {
            $edit_url = phorum_admin_build_url(array('module=badwords', 'edit=1', "curr={$key}"));
            $delete_url = phorum_admin_build_url(array('module=badwords', 'delete=1', "curr={$key}"));
            $ta_class = "PhorumAdminTableRow" . ($ta_class == "PhorumAdminTableRow" ? "Alt" : "");
            echo "<tr>\n";
Ejemplo n.º 5
0
            $frm->hidden("section", "main");

            $frm->hidden("user_id", $_REQUEST["user_id"]);

            $frm->hidden("fk_campsite_user_id", $user["fk_campsite_user_id"]);

            $frm->addbreak("Edit User");

            $frm->addrow("User Name", htmlspecialchars($user["username"])."&nbsp;&nbsp;<a href=\"#forums\">Edit Forum Permissions</a>&nbsp;&nbsp;<a href=\"#groups\">Edit Groups</a>");

            $frm->addrow("Email", $frm->text_box("email", $user["email"], 50));
            $frm->addrow("Password (Enter to change)", $frm->text_box("password1",""));
            $frm->addrow("Password (Confirmation)", $frm->text_box("password2",""));


            $frm->addrow("Signature", $frm->textarea("signature", htmlspecialchars($user["signature"])));

            $frm->addrow("Active", $frm->select_tag("active", array("No", "Yes"), $user["active"]));

            $frm->addrow("Administrator", $frm->select_tag("admin", array("No", "Yes"), $user["admin"]));

            $frm->addrow("Registration Date", phorum_date("%m/%d/%Y %I:%M%p",$user['date_added']));

            $row=$frm->addrow("Date last active", phorum_date("%m/%d/%Y %I:%M%p",$user['date_last_active']));

            $frm->addhelp($row, "Date last active", "This shows the date, when the user was last seen in the forum. Check your setting on \"Track user usage\" in the \"General Settings\". As long as this setting is not enabled, the activity will not be tracked.");


            $frm->show();

            echo "<br /><hr class=\"PhorumAdminHR\" /><br /><a name=\"forums\"></a>";
Ejemplo n.º 6
0
} else {
    require_once './include/admin/PhorumInputForm.php';
    $frm = new PhorumInputForm("", "post", $submit);
    $frm->hidden("module", "banlist");
    $frm->hidden("curr", "{$curr}");
    $frm->addbreak($title);
    if ($curr == "NEW") {
        $frm->addmessage("Ban items can be used to deny new user registrations and\n         posting of (private) messages, based on various criteria.\n         If a ban item applies to a user action, then this action\n         will be fully blocked by Phorum. This can for example be used\n         to block user registrations and postings from certain IP\n         addresses or to prevent certain words from being used in\n         forum messages.<br />\n         <br />\n         If you want to fully ban a user, then it's best to\n         set \"Active\" to \"No\" for the user in the\n         \"Edit Users\" interface.");
    }
    $frm->addrow("String To Match", $frm->text_box("string", $string, 50));
    $row = $frm->addrow("Field To Match", $frm->select_tag("type", $ban_types, $type));
    $frm->addhelp($row, "Field To Match", "\n        Below, you will find an overview of what\n        ban items are used by what Phorum actions:<br/>\n        <br/>\n        <b>User registration</b>:<br/>\n        \"Name/User Name\" checks the new username<br/>\n        \"Email Address\" checks the new email address<br/>\n        \"IP Address/Hostname\" checks the visitor's IP<br/>\n        <br/>\n        <b>Posting forum messages by anonymous users</b><br/>\n        \"Name/User Name\" checks the author's name<br/>\n        \"Email Address\" checks the author's email address<br/>\n        \"Illegal Words (SPAM)\" checks the subject and body<br/>\n        \"IP Address/Hostname\" checks the author's IP<br/>\n        <br/>\n        <b>Posting forum messages by registered users</b><br/>\n        \"Name/User Name\" checks the author's username<br/>\n        \"User-Id (registered User)\" checks the author's user id<br/>\n        \"Email Address\" checks the author's email address<br/>\n        \"IP Address/Hostname\" checks the author's IP<br/>\n        \"Illegal Words (SPAM)\" checks the subject and body<br/>\n        <br/>\n        <b>Posting private messages</b><br/>\n        \"Name/User Name\" checks the sender's username<br/>\n        \"User-Id (registered User)\" checks the sender's user id<br/>\n        \"Email Address\" checks the sender's email address<br/>\n        \"IP Address/Hostname\" checks the sender's IP\n    ");
    $row = $frm->addrow("Compare As", $frm->select_tag("pcre", $match_types, $pcre) . "<div style=\"font-size:x-small\">If using PCRE for comparison, \"String To Match\" should be a valid PCRE expression.<br/>See <a href=\"http://php.net/pcre\" target=\"_blank\">the PHP manual</a> for more information about PCRE.</div>");
    $frm->addhelp($row, "Compare As", "\n        This setting can be used to specify the matching method\n        that has to be used for the ban item. There are two options:<br/>\n        <br/>\n        <ul>\n          <li><b>String</b><br/>\n              The exact string from the \"String To Match\" field\n              will be used for matching. Wildcards are not available\n              for the String field type.<br/><br/></li>\n\n          <li><b>PCRE</b><br/>\n              The \"String To Match\" field will be treated as\n              a <a href=\"http://www.php.net/pcre\">Perl Compatible\n              Regular Expression</a>.</li>\n        </ul>\n    ");
    $frm->addrow("Valid for Forum", $frm->select_tag("forum_id", $forum_list, $forum_id));
    $row = $frm->addrow('Comments', $frm->textarea('comments', htmlspecialchars($comments), 50, 7));
    $frm->addhelp($row, "Comments", "This field can be used to add some comments to the ban (why you\n         created it, when you did this, when the ban can be deleted, etc.)\n         These comments will only be shown on this page and are meant as\n         a means for the administrator to do some bookkeeping.");
    $frm->show();
    if ($curr == "NEW") {
        $PHORUM['banlists'] = $PHORUM['DB']->get_banlists(true);
        unset($PHORUM['banlists'][PHORUM_BAD_WORDS]);
        echo "<hr class=\"PhorumAdminHR\" />";
        if (count($PHORUM['banlists'])) {
            echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"PhorumAdminTable\" width=\"100%\">\n";
            echo "<tr>\n";
            echo "    <td class=\"PhorumAdminTableHead\">String</td>\n";
            echo "    <td class=\"PhorumAdminTableHead\">Field</td>\n";
            echo "    <td class=\"PhorumAdminTableHead\">Compare Method</td>\n";
            echo "    <td class=\"PhorumAdminTableHead\">Valid for Forum</td>\n";
            echo "    <td class=\"PhorumAdminTableHead\">&nbsp;</td>\n";
            echo "</tr>\n";