function phorum_moderator_data_get($key = null)
{
    $PHORUM = $GLOBALS['PHORUM'];
    
    $user_data =phorum_user_get($PHORUM['DATA']['USERINFO']['user_id'], false);
    if( $user_data['moderator_data'] ) {
        $moderator_data =unserialize($user_data['moderator_data']);
    } else {
        $moderator_data =array();
    }
    if (is_null($key)) {
        return $moderator_data;
    } else {
        return isset($moderator_data[$key]) ? $moderator_data[$key] : NULL;
    }
}
Example #2
0
                $PHORUM["DATA"]["MESSAGE"] = $PHORUM["DATA"]["LANG"]["RegVerifyEmail"];
                $template="message";

            // The user is active.
            } else {

                // Generate and store a new password for the user.
                include_once( "./include/profile_functions.php" );
                $newpass = phorum_gen_password();
                $tmp_user["user_id"] = $uid;
                $tmp_user["password_temp"] = $newpass;
                phorum_user_save($tmp_user);

                // Mail the new password.
                $user = phorum_user_get( $uid );
                $maildata = array();
                $maildata['mailmessage'] =
                   wordwrap($PHORUM["DATA"]["LANG"]["LostPassEmailBody1"],72).
                   "\n\n".
                   $PHORUM["DATA"]["LANG"]["Username"] .": $user[username]\n".
                   $PHORUM["DATA"]["LANG"]["Password"] .": $newpass".
                   "\n\n".
                   wordwrap($PHORUM["DATA"]["LANG"]["LostPassEmailBody2"],72);
                $maildata['mailsubject'] = $PHORUM["DATA"]["LANG"]["LostPassEmailSubject"];
                phorum_email_user(array( 0 => $user['email'] ), $maildata);

                $okmsg = $PHORUM["DATA"]["LANG"]["LostPassSent"];

            }
        }
Example #3
0
    $PHORUM["DATA"]["FILTER"][] = array("name" => $PHORUM["DATA"]["LANG"]["Suspended"], 
        "enable" => !(isset($PHORUM["args"]["filter"]) && $PHORUM["args"]["filter"] == PHORUM_USER_GROUP_SUSPENDED),
        "url" => phorum_get_url(PHORUM_CONTROLCENTER_ACTION_URL, "panel=" . PHORUM_CC_GROUP_MODERATION,  "group=" . $PHORUM["args"]["group"], "filter=" . PHORUM_USER_GROUP_SUSPENDED));
    $PHORUM["DATA"]["FILTER"][] = array("name" => $PHORUM["DATA"]["LANG"]["Unapproved"], 
        "enable" => !(isset($PHORUM["args"]["filter"]) && $PHORUM["args"]["filter"] == PHORUM_USER_GROUP_UNAPPROVED),
        "url" => phorum_get_url(PHORUM_CONTROLCENTER_ACTION_URL, "panel=" . PHORUM_CC_GROUP_MODERATION,  "group=" . $PHORUM["args"]["group"], "filter=" . PHORUM_USER_GROUP_UNAPPROVED));

    $PHORUM["DATA"]["STATUS_OPTIONS"] = array();
    $PHORUM["DATA"]["STATUS_OPTIONS"][] = array("value" => PHORUM_USER_GROUP_REMOVE, "name" => "< " . $PHORUM["DATA"]["LANG"]["RemoveFromGroup"] . " >");
    $PHORUM["DATA"]["STATUS_OPTIONS"][] = array("value" => PHORUM_USER_GROUP_APPROVED, "name" => $PHORUM["DATA"]["LANG"]["Approved"]);
    $PHORUM["DATA"]["STATUS_OPTIONS"][] = array("value" => PHORUM_USER_GROUP_UNAPPROVED, "name" => $PHORUM["DATA"]["LANG"]["Unapproved"]);
    $PHORUM["DATA"]["STATUS_OPTIONS"][] = array("value" => PHORUM_USER_GROUP_SUSPENDED, "name" => $PHORUM["DATA"]["LANG"]["Suspended"]);

    $groupmembers = phorum_db_get_group_members($PHORUM["args"]["group"]);
    $usersingroup = array_keys($groupmembers);
    $users = phorum_user_get($usersingroup);
    $memberlist = array();
    foreach ($groupmembers as $userid => $status){
        // if we have a filter, check that the user is in it
        if (isset($PHORUM["args"]["filter"])){
            if ($PHORUM["args"]["filter"] != $status){
                continue;
            }
        }

        $disabled = false;
        $statustext = "";
        // moderators can't edit other moderators
        if ($status == PHORUM_USER_GROUP_MODERATOR){
            $disabled = true;
            $statustext = $PHORUM["DATA"]["LANG"]["PermGroupModerator"];
Example #4
0
            // Setup data for replying privately to a forum post.
            } elseif (isset($PHORUM["args"]["message_id"])) {

                $message = phorum_db_get_message($PHORUM["args"]["message_id"], "message_id", true);

                if (phorum_user_access_allowed(PHORUM_USER_ALLOW_READ) && ($PHORUM["forum_id"]==$message["forum_id"] || $message["forum_id"] == 0)) {

                    // get url to the message board thread
                    $origurl = phorum_get_url(PHORUM_READ_URL, $message["thread"], $message["message_id"]);

                    // Find the real username, because some mods rewrite the
                    // username in the message table. There will be a better solution
                    // for selecting recipients, but for now this will fix some
                    // of the problems.
                    $user = phorum_user_get($message["user_id"], false);

                    $msg["subject"] = $message["subject"];
                    $msg["message"] = $message["body"];
                    $msg["recipients"][$message["user_id"]] = array(
                        'username' => $user["username"],
                        'user_id'  => $user["user_id"]
                    );
                    $msg = phorum_pm_quoteformat($user["username"], $msg, $origurl);
                }

                $hide_userselect = 1;
            }
        }

        // Setup data for previewing a message.
Example #5
0
function phorum_posting_merge_db2form($form, $db, $apply_readonly = false)
{
    $PHORUM = $GLOBALS['PHORUM'];

    // If we have a user linked to the current message, then get the
    // user data from the database, if it has to be applied as
    // read-only data.
    if ($PHORUM["post_fields"]["email"][pf_READONLY] || $PHORUM["post_fields"]["author"][pf_READONLY]) {
        if ($db["user_id"]) {
            $user_info = phorum_user_get($db["user_id"], false);
            $user_info["author"] = $user_info["username"];
        }
    }

    foreach ($PHORUM["post_fields"] as $key => $info)
    {
        // Skip writeable fields if we only have to apply read-only ones.
        if ($apply_readonly && ! $info[pf_READONLY]) continue;

        switch ($key) {
            case "show_signature": {
                $form[$key] = !empty($db["meta"]["show_signature"]);
                break;
            }

            case "allow_reply": {
                $form[$key] = ! $db["closed"];
                break;
            }

            case "email_notify": {
                $form[$key] = phorum_db_get_if_subscribed(
                    $db["forum_id"], $db["thread"], $db["user_id"]);
                break;
            }

            case "forum_id": {
                $form["forum_id"] = $db["forum_id"] ? $db["forum_id"] : $PHORUM["forum_id"];
                break;
            }

            case "attachments": {
                $form[$key] = array();
                if (isset($db["meta"]["attachments"])) {
                    foreach ($db["meta"]["attachments"] as $data) {
                        $data["keep"] = true;
                        $data["linked"] = true;
                        $form["attachments"][] = $data;
                    }
                }
                break;
            }

            case "author":
            case "email": {
                if ($db["user_id"]) {
                    $form[$key] = $user_info[$key];
                } else {
                    $form[$key] = $db[$key];
                }
                break;
            }

            case "special": {
                if ($db["sort"] == PHORUM_SORT_ANNOUNCEMENT) {
                    $form["special"] = "announcement";
                } elseif ($db["sort"] == PHORUM_SORT_STICKY) {
                    $form["special"] = "sticky";
                } else {
                    $form["special"] = "";
                }
                break;
            }

            case "mode": {
                // NOOP
                break;
            }

            default:
                $form[$key] = $db[$key];
        }
    }
    return $form;
}
Example #6
0
            </table>
            </form>
EOT;

        } else {

            echo "No Users Found.";

        }

    }

    // display edit form
    if(isset($_REQUEST["user_id"])){

        $user=phorum_user_get($_REQUEST["user_id"]);

        if(count($user)){

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

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

            $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");
Example #7
0
function phorum_user_set_current_user( $user_id )
{
    $ret = false;

    $user = phorum_user_get( $user_id );
    if ( $user["active"] == PHORUM_USER_ACTIVE ) {
        $GLOBALS["PHORUM"]["user"] = $user;
        $ret = true;
    }

    return $ret;
}
Example #8
0
            $PHORUM["DATA"]["URL"]["LASTPAGE"]=phorum_get_url(PHORUM_READ_URL, $thread, "page=$pages");
        }

        if($pages>$page){
            $nextpage=$page+1;
            $PHORUM["DATA"]["URL"]["NEXTPAGE"]=phorum_get_url(PHORUM_READ_URL, $thread, "page=$nextpage");
        }
        if($page>1){
            $prevpage=$page-1;
            $PHORUM["DATA"]["URL"]["PREVPAGE"]=phorum_get_url(PHORUM_READ_URL, $thread, "page=$prevpage");
        }
    }

    // fetch_user_ids filled from phorum_db_get_messages
    if(isset($fetch_user_ids) && count($fetch_user_ids)){
        $user_info=phorum_user_get($fetch_user_ids, false);
        // hook to modify user info
        $user_info = phorum_hook("read_user_info", $user_info);
    }

    // URLS which are common for the thread
    if($PHORUM["DATA"]["MODERATOR"]) {
        if($build_move_url) {
                $URLS["move_url"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_MOVE_THREAD, $thread);
        }
        $URLS["merge_url"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_MERGE_THREAD, $thread);
        $URLS["close_url"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_CLOSE_THREAD, $thread);
        $URLS["reopen_url"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_REOPEN_THREAD, $thread);
    }

Example #9
0
$template = "profile";
$error = "";

// redirect if no profile id passed
if(!empty($PHORUM["args"][1])){
    $profile_id = (int)$PHORUM["args"][1];
}

if(empty($PHORUM["args"][1]) || empty($profile_id)){
    phorum_redirect_by_url(phorum_get_url(PHORUM_INDEX_URL));
    exit();
}

include_once("./include/users.php");

$user = phorum_user_get($profile_id);

if(!is_array($user) || $user["active"]==0) {
    $PHORUM["DATA"]["ERROR"]=$PHORUM["DATA"]["LANG"]["UnknownUser"];
    $PHORUM['DATA']["URL"]["REDIRECT"]=phorum_get_url(PHORUM_LIST_URL);
    $PHORUM['DATA']["BACKMSG"]=$PHORUM["DATA"]["LANG"]["BackToList"];

    // have to include the header here for the Redirect
    include phorum_get_template("header");
    phorum_hook("after_header");
    include phorum_get_template("message");
    phorum_hook("before_footer");
    include phorum_get_template("footer");
    return;
}