Exemplo n.º 1
0
    $errors = array();
    if (isset($_POST['savechanges'])) {
        $userInput = new UserFieldsInput();
        $userInput->userData = $user_data;
        $userInput->adminActivation = 0;
        $userInput->emailVerification = 0;
        $userInput->isAdminPanel = TRUE;
        $userInput->skipCurrentPass = TRUE;
        $userInput->saveUpdate();
        $userInput->displayMessages();
        $errors = $userInput->getErrorsArray();
        $user_data = dbarray(dbquery("SELECT * FROM " . DB_USERS . " WHERE user_id='" . $user_id . "'"));
        unset($userInput);
    }
    opentable($locale['430']);
    member_nav(member_url("edit", $user_id) . "| " . $locale['430']);
    $userFields = new UserFields();
    $userFields->postName = "savechanges";
    $userFields->postValue = $locale['430'];
    $userFields->formaction = FUSION_SELF . $aidlink . "&step=edit&user_id=" . $user_id;
    $userFields->isAdminPanel = TRUE;
    $userFields->showAdminPass = FALSE;
    $userFields->skipCurrentPass = TRUE;
    $userFields->userData = $user_data;
    $userFields->errorsArray = $errors;
    $userFields->displayInput();
    closetable();
    // Delete User
} elseif (isset($_GET['step']) && $_GET['step'] == "delete" && $user_id && (!$isAdmin || iSUPERADMIN)) {
    if (isset($_POST['delete_user'])) {
        $result = dbquery("SELECT user_id, user_avatar FROM " . DB_USERS . " WHERE user_id='" . $user_id . "' AND user_level<'103'");
Exemplo n.º 2
0
function display_suspend_log($user_id, $type = "all", $rowstart = 0, $limit = 0)
{
    global $locale;
    $db_type = $type != "all" && isnum($type) ? " AND suspend_type='{$type}'" : "";
    $rows = dbcount("(suspend_id)", DB_SUSPENDS, "suspended_user='******'{$db_type}");
    $result = dbquery("SELECT sp.suspend_id, sp.suspend_ip, sp.suspend_ip_type, sp.suspend_date, sp.suspend_reason,\n\t\tsp.suspend_type, sp.reinstate_date, sp.reinstate_reason, sp.reinstate_ip, sp.reinstate_ip_type,\n\t\ta.user_name AS admin_name, b.user_name AS admin_name_b \n\t\tFROM " . DB_SUSPENDS . " sp \n\t\tLEFT JOIN " . DB_USERS . " a ON sp.suspending_admin=a.user_id \n\t\tLEFT JOIN " . DB_USERS . " b ON sp.reinstating_admin=b.user_id \n\t\tWHERE suspended_user='******'{$db_type}\n\t\tORDER BY suspend_date DESC" . ($limit > 0 ? " LIMIT {$limit}" : ""));
    $rows = dbrows($result);
    $udata = dbarray(dbquery("SELECT user_name FROM " . DB_USERS . " WHERE user_id='{$user_id}' LIMIT 1"));
    if ($type == "all") {
        opentable(sprintf($locale['susp100'], $udata['user_name']));
        member_nav(member_url("view", $user_id) . "|" . $udata['user_name'], member_url("log", $user_id) . "|" . $locale['susp114']);
    } else {
        opentable(sprintf($locale['susp100b'], getsuspension($type, true), $udata['user_name']));
    }
    if ($rows) {
        echo "<table width='80%' cellpadding='1' cellspacing='0' class='tbl-border center'>\n<tr>\n";
        if ($type == "all") {
            $description = sprintf($locale['susp101'], $udata['user_name']);
        } else {
            $description = sprintf($locale['susp102'], getsuspension($type), $udata['user_name']);
        }
        echo "<td class='tbl2' width='30'>" . $locale['susp103'] . "</td>\n";
        echo "<td class='tbl2' width='120'>" . $locale['susp104'] . "</td>\n";
        echo "<td class='tbl2' width='250'>" . $locale['susp105'] . "</td>\n";
        echo "<td class='tbl2' width='150'>" . $locale['susp106'] . "</td>\n";
        echo "</tr>\n";
        $i = 1;
        while ($data = dbarray($result)) {
            $class = "tbl{$i}";
            $suspension = $data['suspend_type'] != 2 ? getsuspension($data['suspend_type']) : $locale['susp111'];
            $reason = $data['suspend_reason'] ? ": " . $data['suspend_reason'] : "";
            $admin = $data['admin_name'] ? $data['admin_name'] . " (" . $locale['susp108'] . ": " . $data['suspend_ip'] . ")" : $locale['susp109'];
            echo "<tr><td class='{$class}' valign='top'>#" . $data['suspend_id'] . "</td>\n";
            echo "<td class='{$class}' valign='top'>" . showdate('forumdate', $data['suspend_date']) . "</td>\n";
            echo "<td class='{$class}' valign='top'><strong>{$suspension}</strong>{$reason}</td>\n";
            echo "<td class='{$class}' valign='top'>{$admin}</td>\n";
            echo "</tr>\n<tr>\n";
            if ($data['reinstate_date']) {
                $r_reason = $data['reinstate_reason'] ? ": " . $data['reinstate_reason'] : "";
                $admin = $data['admin_name_b'] ? $data['admin_name_b'] . " (" . $locale['susp112'] . $data['reinstate_ip'] . ")" : $locale['susp109'];
                echo "<td class='{$class}' valign='top' align='right'>&nbsp;</td>\n";
                echo "<td class='{$class}' valign='top'>" . showdate('forumdate', $data['reinstate_date']) . "</td>\n";
                echo "<td class='{$class}' valign='top'>" . $locale['susp113'] . $r_reason . "</td>\n";
                echo "<td class='{$class}' valign='top'>{$admin}</td>\n";
                echo "</tr>\n<tr>\n";
            } elseif ($data['suspend_type'] != 2) {
                echo "<td class='{$class}' valign='top' align='right'>&nbsp;</td>\n";
                echo "<td class='{$class}' valign='top'>&nbsp;</td>\n";
                echo "<td class='{$class}' valign='top'>&nbsp;</td>\n";
                echo "<td class='{$class}' valign='top'>&nbsp;</td>\n";
                echo "</tr>\n<tr>\n";
            }
            echo "<td class='tbl1' colspan='4'><hr /></td>\n";
            echo "</tr>\n";
            if ($i == 2 ? $i = 1 : $i++) {
            }
        }
        echo "</table>\n";
    } else {
        echo "<div id='close-message'><div class='admin-message'>" . $locale['susp110'] . "</div></div>\n";
    }
    closetable();
}
Exemplo n.º 3
0
        $userFields->registration = TRUE;
        $userFields->method = 'input';
        $info = $userFields->get_profile_input();
        render_userform($info);
        closetable();
    }
    // View User Profile
} elseif (isset($_GET['step']) && $_GET['step'] == "view" && $user_id && (!$isAdmin || iSUPERADMIN)) {
    $result = dbquery("SELECT u.*, s.suspend_reason\n\t\tFROM " . DB_USERS . " u\n\t\tLEFT JOIN " . DB_SUSPENDS . " s ON u.user_id=s.suspended_user\n\t\tWHERE user_id='" . $user_id . "'\n\t\tORDER BY suspend_date DESC\n\t\tLIMIT 1");
    if (dbrows($result)) {
        $user_data = dbarray($result);
    } else {
        redirect(FUSION_SELF . $aidlink);
    }
    opentable($locale['u104'] . " " . $user_data['user_name']);
    member_nav(member_url("view", $user_id) . "|" . $user_data['user_name']);
    $userFields = new \PHPFusion\UserFields();
    $userFields->postName = "register";
    $userFields->postValue = $locale['u101'];
    $userFields->displayValidation = $settings['display_validation'];
    $userFields->displayTerms = $settings['enable_terms'];
    $userFields->plugin_folder = INCLUDES . "user_fields/";
    $userFields->plugin_locale_folder = LOCALE . LOCALESET . "user_fields/";
    $userFields->showAdminPass = FALSE;
    $userFields->skipCurrentPass = TRUE;
    $userFields->registration = FALSE;
    $userFields->userData = $user_data;
    $userFields->method = 'display';
    $info = $userFields->get_profile_output();
    render_userprofile($info);
    closetable();