[20/01/07] Admin Userlist

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
398
72%
Very Good
98
18%
Good
38
7%
Fair
11
2%
Poor
11
2%
 
Total votes: 556

schmidtedv
Registered User
Posts: 28
Joined: Wed Mar 09, 2005 8:12 pm

Post by schmidtedv »

...i agree, safety first, but, still, there might be moddings inside you could not use easymod. I will put my admin_user_overview.php here as an example :-)

this is my own version of the admin_userlist.php

Code: Select all

<?php

define('IN_PHPBB', true);

if (!empty($setmodules)) {
    $filename = basename(__FILE__);
    $module['Admin_user']['Overview'] = $filename;

    return;
}

$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

if (!function_exists('period')) {
    function period($date)
    {
        global $lang;

        $years = floor($date / 31536000);
        $date = $date - ($years * 31536000);
        $weeks = floor($date / 604800);
        $date = $date - ($weeks * 604800);
        $days = floor($date / 86400);
        $date = $date - ($days * 86400);
        $hours = floor($date / 3600);

        $result = (($years) ? $years . ' ' . (($years == '1') ? $lang['Year'] : $lang['Years']) . ', ' : '') .
        (($years || $weeks) ? $weeks . ' ' . (($weeks == '1') ? $lang['Week'] : $lang['Weeks']) . ', ' : '') .
        (($years || $weeks || $days) ? $days . ' ' . (($days == '1') ? $lang['Day'] : $lang['Days']) . ', ' : '') .
        (($years || $weeks || $days || $hours) ? $hours . ' ' . (($hours == '1') ? $lang['Hour'] : $lang['Hours']) : '');
        return $result;
    }
}

if (isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode'])) {
    $mode = (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
} else {
    $mode = '';
}

if (isset($HTTP_POST_VARS['confirm']) || isset($HTTP_GET_VARS['confirm'])) {
    $confirm = true;
} else {
    $confirm = false;
}

if (isset($HTTP_POST_VARS['cancel']) || isset($HTTP_GET_VARS['cancel'])) {
    $cancel = true;
    $mode = '';
} else {
    $cancel = false;
}

$start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : 0;

if (isset($HTTP_GET_VARS['show']) || isset($HTTP_POST_VARS['show'])) {
    $show = (isset($HTTP_POST_VARS['show'])) ? intval($HTTP_POST_VARS['show']) : intval($HTTP_GET_VARS['show']);
} else {
    $show = $board_config['members_per_page'];
}
if ($show < 1) {
    $show = $board_config['members_per_page'];
}

if (isset($HTTP_GET_VARS['sort']) || isset($HTTP_POST_VARS['sort'])) {
    $sort = (isset($HTTP_POST_VARS['sort'])) ? htmlspecialchars($HTTP_POST_VARS['sort']) : htmlspecialchars($HTTP_GET_VARS['sort']);
    $sort = str_replace("\'", "''", $sort);
} else {
    $sort = 'user_regdate';
}

if (isset($HTTP_POST_VARS['order'])) {
    $sort_order = ($HTTP_POST_VARS['order'] == 'DESC') ? 'DESC' : 'ASC';
} else if (isset($HTTP_GET_VARS['order'])) {
    $sort_order = ($HTTP_GET_VARS['order'] == 'DESC') ? 'DESC' : 'ASC';
} else {
    $sort_order = 'DESC';
}

if (isset($HTTP_GET_VARS['alphanum']) || isset($HTTP_POST_VARS['alphanum'])) {
    $alphanum = (isset($HTTP_POST_VARS['alphanum'])) ? htmlspecialchars($HTTP_POST_VARS['alphanum']) : htmlspecialchars($HTTP_GET_VARS['alphanum']);
    $alphanum = str_replace("\'", "''", $alphanum);
    $alpha_where = ($alphanum == 'num') ? "AND username NOT RLIKE '^[A-Z]'" : "AND username LIKE '$alphanum%'";
} else {
    $alpahnum = '';
    $alpha_where = '';
}

$filter = '';
$filter_where = '';
$find_by = 'find_username';
if (isset($HTTP_GET_VARS['filter']) || isset($HTTP_POST_VARS['filter'])) {
    $filter = (isset($HTTP_POST_VARS['filter'])) ? htmlspecialchars($HTTP_POST_VARS['filter']) : htmlspecialchars($HTTP_GET_VARS['filter']);
    if (!empty($filter)) { 
        $filter = preg_replace('/\*/', '%', phpbb_clean_username($filter));

        if (isset($HTTP_POST_VARS['find_by']))
            $find_by = htmlspecialchars($HTTP_POST_VARS['find_by']);
        elseif (isset($HTTP_GET_VARS['find_by']))
            $find_by = htmlspecialchars($HTTP_GET_VARS['find_by']);

        switch($find_by) {
            case 'find_user_email': $filter_where =" AND user_email LIKE '" . str_replace("\'", "''", $filter) . "'";
        break;
            case 'find_user_website': $filter_where =" AND user_website LIKE '" . str_replace("\'", "''", $filter) . "'";
        break;
            default: $filter_where =" AND username LIKE '" . str_replace("\'", "''", $filter) . "'";
        }
        $alpahnum = '';
        $alpha_where = '';
    }
}

$user_ids = array();

if (isset($HTTP_POST_VARS[POST_USERS_URL]) || isset($HTTP_GET_VARS[POST_USERS_URL])) {
    $user_ids = (isset($HTTP_POST_VARS[POST_USERS_URL])) ? $HTTP_POST_VARS[POST_USERS_URL] : $HTTP_GET_VARS[POST_USERS_URL];
} else {
    unset($user_ids);
}

switch ($mode) {
    case 'delete':

        if ($cancel) {
            redirect($phpbb_root_path . 'admin/admin_user_overview.' . $phpEx);
        }

        if (!$confirm) {
            $i = 0;
            $hidden_fields = '';
            while ($i < count($user_ids)) {
                $user_id = intval($user_ids[$i]);
                $hidden_fields .= '<input type="hidden" name="' . POST_USERS_URL . '[]" value="' . $user_id . '">';

                unset($user_id);
                $i++;
            }

            $template->set_filenames(array('body' => 'admin/confirm_body.tpl')
                );
            $template->assign_vars(array('MESSAGE_TITLE' => $lang['Delete'],
                    'MESSAGE_TEXT' => $lang['Confirm_user_deleted'],

                    'U_INDEX' => '',
                    'L_INDEX' => '',

                    'L_YES' => $lang['Yes'],
                    'L_NO' => $lang['No'],

                    'S_CONFIRM_ACTION' => append_sid('admin_user_overview.' . $phpEx . '?mode=delete'),
                    'S_HIDDEN_FIELDS' => $hidden_fields)
                );
        } else {
            include($phpbb_root_path . 'includes/emailer.' . $phpEx);

            $i = 0;
            while ($i < count($user_ids)) {
                $user_id = intval($user_ids[$i]);

                $sql = "SELECT u.username, g.group_id
					FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
					WHERE ug.user_id = $user_id
						AND u.user_id = $user_id
						AND g.group_id = ug.group_id
						AND g.group_single_user = 1";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not obtain group information for this user', '', __LINE__, __FILE__, $sql);
                }

                $row = $db->sql_fetchrow($result);

                $this_userdata = get_userdata($user_id);

                if (preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery']) {
                    $ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';

                    $board_config['smtp_delivery'] = 1;
                    $board_config['smtp_host'] = @$ini_val('SMTP');
                }

                $emailer = new emailer($board_config['smtp_delivery']);

                $script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path'])) . '/profile.' . $phpEx . '?mode=register';
                $server_name = trim($board_config['server_name']);
                $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
                $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';

                $server_url = $server_protocol . $server_name . $server_port . $script_name;

                $emailer->from($board_config['board_email']);
                $emailer->replyto($board_config['board_email']);

                $email_headers = 'X-AntiAbuse: phpBB Forum - ' . $board_config['server_name'] . "\n";
                $email_headers .= 'X-AntiAbuse: Benutzer ID - ' . $userdata['user_id'] . "\n";
                $email_headers .= 'X-AntiAbuse: Benutzername - ' . $userdata['username'] . "\n";
                $email_headers .= 'X-AntiAbuse: Benutzer IP - ' . decode_ip($user_ip) . "\n";

                $emailer->use_template('admin_delete_user', $this_userdata['user_lang']);
                $emailer->extra_headers($email_headers);
                $emailer->email_address($this_userdata['user_email']);
                $emailer->set_subject();

                $emailer->assign_vars(array('U_REGISTER' => $server_url,
                        'USERNAME' => $this_userdata['username'],
                        'ADMINISTRATOR' => $userdata['username'],
                        'SITENAME' => $board_config['sitename'],
                        'BOARD_EMAIL' => $board_config['board_email'],
                        'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '')
                    );
                $emailer->send();
                $emailer->reset();

                $sql = "UPDATE " . POSTS_TABLE . "
					SET poster_id = " . DELETED . ", post_username = '" . $row['username'] . "'
					WHERE poster_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not update posts for this user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "UPDATE " . TOPICS_TABLE . "
					SET topic_poster = " . DELETED . "
					WHERE topic_poster = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not update topics for this user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "UPDATE " . VOTE_USERS_TABLE . "
					SET vote_user_id = " . DELETED . "
					WHERE vote_user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not update votes for this user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "SELECT group_id
					FROM " . GROUPS_TABLE . "
					WHERE group_moderator = $user_id";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not select groups where user was moderator', '', __LINE__, __FILE__, $sql);
                }
                $group_moderator = array();
                while ($row_group = $db->sql_fetchrow($result)) {
                    $group_moderator[] = $row_group['group_id'];
                }

                if (count($group_moderator)) {
                    $update_moderator_id = implode(', ', $group_moderator);

                    $sql = "UPDATE " . GROUPS_TABLE . "
						SET group_moderator = " . $userdata['user_id'] . "
						WHERE group_id IN ($update_moderator_id)";
                    if (!$db->sql_query($sql)) {
                        message_die(GENERAL_ERROR, 'Could not update group moderators', '', __LINE__, __FILE__, $sql);
                    }
                }

                $sql = "DELETE FROM " . USERS_TABLE . "
					WHERE user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . USER_GROUP_TABLE . "
					WHERE user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete user from user_group table', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . GROUPS_TABLE . "
					WHERE group_id = " . $row['group_id'];
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete group for this user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
					WHERE group_id = " . $row['group_id'];
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete group for this user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . FORUMS_WATCH_TABLE . "
					WHERE user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete user from forum watch table', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
					WHERE user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete user from topic watch table', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . BANLIST_TABLE . "
					WHERE ban_userid = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . SESSIONS_TABLE . "
					WHERE session_user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete sessions for this user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . SESSIONS_KEYS_TABLE . "
					WHERE user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete auto-login keys for this user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "SELECT privmsgs_id
					FROM " . PRIVMSGS_TABLE . "
                    WHERE (privmsgs_from_userid = $user_id AND privmsgs_type IN (" . PRIVMSGS_NEW_MAIL . "," . PRIVMSGS_UNREAD_MAIL . "," . PRIVMSGS_SENT_MAIL . "," . PRIVMSGS_SAVED_OUT_MAIL . "))
                        OR (privmsgs_to_userid = $user_id AND privmsgs_type IN (" . PRIVMSGS_NEW_MAIL . "," . PRIVMSGS_UNREAD_MAIL . "," . PRIVMSGS_READ_MAIL . "," . PRIVMSGS_SAVED_IN_MAIL . "))";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not select all users private messages', '', __LINE__, __FILE__, $sql);
                }
                $mark_list = array();
                while ($row_privmsgs = $db->sql_fetchrow($result)) {
                    $mark_list[] = $row_privmsgs['privmsgs_id'];
                }

                if (count($mark_list)) {
                    $delete_sql_id = implode(', ', $mark_list);

                    $delete_text_sql = "DELETE FROM " . PRIVMSGS_TEXT_TABLE . "
						WHERE privmsgs_text_id IN ($delete_sql_id)";
                    $delete_sql = "DELETE FROM " . PRIVMSGS_TABLE . "
						WHERE privmsgs_id IN ($delete_sql_id)";

                    if (!$db->sql_query($delete_sql)) {
                        message_die(GENERAL_ERROR, 'Could not delete private message info', '', __LINE__, __FILE__, $delete_sql);
                    }

                    if (!$db->sql_query($delete_text_sql)) {
                        message_die(GENERAL_ERROR, 'Could not delete private message text', '', __LINE__, __FILE__, $delete_text_sql);
                    }
                }

                $sql = "UPDATE " . PRIVMSGS_TABLE . "
                    SET privmsgs_from_userid = " . DELETED . "
                    WHERE privmsgs_from_userid = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not update private message info', '', __LINE__, __FILE__, $sql);
                }
                $sql = "UPDATE " . PRIVMSGS_TABLE . "
                    SET privmsgs_to_userid = " . DELETED . "
                    WHERE privmsgs_to_userid = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not update private message info', '', __LINE__, __FILE__, $sql);
                }

                unset($user_id);
                $i++;
            }

            $message = $lang['User_deleted_successfully'] . "<br /><br />" . sprintf($lang['Click_return_userlist'], "<a href=\"" . append_sid("admin_user_overview.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

            message_die(GENERAL_MESSAGE, $message);
        }
        break;

    case 'ban':

        if ($cancel) {
            redirect($phpbb_root_path . 'admin/admin_user_overview.' . $phpEx);
        }

        if (!$confirm) {
            $i = 0;
            $hidden_fields = '';
            while ($i < count($user_ids)) {
                $user_id = intval($user_ids[$i]);
                $hidden_fields .= '<input type="hidden" name="' . POST_USERS_URL . '[]" value="' . $user_id . '">';

                unset($user_id);
                $i++;
            }

            $template->set_filenames(array('body' => 'admin/confirm_body.tpl')
                );
            $template->assign_vars(array('MESSAGE_TITLE' => $lang['Ban'],
                    'MESSAGE_TEXT' => $lang['Confirm_user_ban'],

                    'U_INDEX' => '',
                    'L_INDEX' => '',

                    'L_YES' => $lang['Yes'],
                    'L_NO' => $lang['No'],

                    'S_CONFIRM_ACTION' => append_sid('admin_user_overview.' . $phpEx . '?mode=ban'),
                    'S_HIDDEN_FIELDS' => $hidden_fields)
                );
        } else {
            $i = 0;
            while ($i < count($user_ids)) {
                $user_id = intval($user_ids[$i]);

                $sql = "INSERT INTO " . BANLIST_TABLE . " ( ban_userid )
					VALUES ( '$user_id' )";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not obtain ban user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . SESSIONS_TABLE . "
					WHERE session_user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete sessions for this user', '', __LINE__, __FILE__, $sql);
                }

                $sql = "DELETE FROM " . SESSIONS_KEYS_TABLE . "
					WHERE user_id = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete auto-login keys for this user', '', __LINE__, __FILE__, $sql);
                }

                unset($user_id);
                $i++;
            }

            $message = $lang['User_banned_successfully'] . "<br /><br />" . sprintf($lang['Click_return_userlist'], "<a href=\"" . append_sid("admin_user_overview.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

            message_die(GENERAL_MESSAGE, $message);
        }
        break;

    case 'unban':

        if ($cancel) {
            redirect($phpbb_root_path . 'admin/admin_user_overview.' . $phpEx);
        }

        if (!$confirm) {
            $i = 0;
            $hidden_fields = '';
            while ($i < count($user_ids)) {
                $user_id = intval($user_ids[$i]);
                $hidden_fields .= '<input type="hidden" name="' . POST_USERS_URL . '[]" value="' . $user_id . '">';

                unset($user_id);
                $i++;
            }

            $template->set_filenames(array('body' => 'admin/confirm_body.tpl')
                );
            $template->assign_vars(array('MESSAGE_TITLE' => $lang['Unban'],
                    'MESSAGE_TEXT' => $lang['Confirm_user_unban'],

                    'U_INDEX' => '',
                    'L_INDEX' => '',

                    'L_YES' => $lang['Yes'],
                    'L_NO' => $lang['No'],

                    'S_CONFIRM_ACTION' => append_sid('admin_user_overview.' . $phpEx . '?mode=unban'),
                    'S_HIDDEN_FIELDS' => $hidden_fields)
                );
        } else {
            $i = 0;
            while ($i < count($user_ids)) {
                $user_id = intval($user_ids[$i]);

                $sql = "DELETE FROM " . BANLIST_TABLE . "
               WHERE ban_userid = $user_id";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
                }

                unset($user_id);
                $i++;
            }

            $message = $lang['User_unbanned_successfully'] . "<br /><br />" . sprintf($lang['Click_return_userlist'], "<a href=\"" . append_sid("admin_user_overview.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

            message_die(GENERAL_MESSAGE, $message);
        }
        break;

    case 'activate':

        $i = 0;
        while ($i < count($user_ids)) {
            $user_id = intval($user_ids[$i]);
            $sql = "SELECT user_active FROM " . USERS_TABLE . "
				WHERE user_id = $user_id";
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql);
            }
            $row = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);

            $new_status = ($row['user_active']) ? 0 : 1;

            $sql = "UPDATE " . USERS_TABLE . "
				SET user_active = '$new_status'
				WHERE user_id = $user_id";
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Could not update user status', '', __LINE__, __FILE__, $sql);
            }

            unset($user_id);
            $i++;
        }

        $message = $lang['User_status_updated'] . "<br /><br />" . sprintf($lang['Click_return_userlist'], "<a href=\"" . append_sid("admin_user_overview.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

        message_die(GENERAL_MESSAGE, $message);
        break;

    case 'group':

        if (!$confirm) {
            $i = 0;
            $hidden_fields = '';
            while ($i < count($user_ids)) {
                $user_id = intval($user_ids[$i]);
                $hidden_fields .= '<input type="hidden" name="' . POST_USERS_URL . '[]" value="' . $user_id . '">';

                unset($user_id);
                $i++;
            }

            $template->set_filenames(array('body' => 'admin/user_overview_group.tpl')
                );

            $template->assign_vars(array('MESSAGE_TITLE' => $lang['Add_group'],
                    'MESSAGE_TEXT' => $lang['Add_group_explain'],

                    'L_USER_GROUPS' => $lang['User_groups'],

                    'S_GROUP_VARIABLE' => POST_GROUPS_URL,
                    'S_ACTION' => append_sid($phpbb_root_path . 'admin/admin_user_overview.' . $phpEx . '?mode=group'),
                    'L_SUBMIT' => $lang['Submit'],
                    'L_CANCEL' => $lang['Cancel'],
                    'L_SELECT_GROUP' => $lang['Select_group'],
                    'S_HIDDEN_FIELDS' => $hidden_fields)
                );

            $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . "
				WHERE group_single_user <> " . true . "
				ORDER BY group_name";

            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Could not query groups', '', __LINE__, __FILE__, $sql);
            } while ($row = $db->sql_fetchrow($result)) {
                $template->assign_block_vars('grouprow', array('GROUP_NAME' => $row['group_name'],
                        'GROUP_ID' => $row['group_id'])
                    );
            }
        } else {
            $group_id = intval($HTTP_POST_VARS[POST_GROUPS_URL]);

            include($phpbb_root_path . 'includes/emailer.' . $phpEx);
            $emailer = new emailer($board_config['smtp_delivery']);

            $i = 0;
            while ($i < count($user_ids)) {
                $user_id = intval($user_ids[$i]);

                $sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod
							FROM ( " . GROUPS_TABLE . " g
							LEFT JOIN " . AUTH_ACCESS_TABLE . " aa ON aa.group_id = g.group_id )
							WHERE g.group_id = $group_id";

                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not get moderator information', '', __LINE__, __FILE__, $sql);
                }

                $group_info = $db->sql_fetchrow($result);

                $sql = "SELECT user_id, user_email, user_lang, user_level
					FROM " . USERS_TABLE . "
					WHERE user_id = $user_id";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, "Could not get user information", $lang['Error'], __LINE__, __FILE__, $sql);
                }
                $row = $db->sql_fetchrow($result);

                $sql = "SELECT ug.user_id, u.user_level
					FROM " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u
					WHERE u.user_id = " . $row['user_id'] . "
						AND ug.user_id = u.user_id
						AND ug.group_id = $group_id";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not get user information', '', __LINE__, __FILE__, $sql);
                }

                if (!($db->sql_fetchrow($result))) {
                    $sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
						VALUES (" . $row['user_id'] . ", $group_id, 0)";
                    if (!$db->sql_query($sql)) {
                        message_die(GENERAL_ERROR, 'Could not add user to group', '', __LINE__, __FILE__, $sql);
                    }

                    if ($row['user_level'] != ADMIN && $row['user_level'] != MOD && $group_info['auth_mod']) {
                        $sql = "UPDATE " . USERS_TABLE . "
							SET user_level = " . MOD . "
							WHERE user_id = " . $row['user_id'];
                        if (!$db->sql_query($sql)) {
                            message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
                        }
                    }

                    $group_sql = "SELECT group_name
						FROM " . GROUPS_TABLE . "
						WHERE group_id = $group_id";
                    if (!($result = $db->sql_query($group_sql))) {
                        message_die(GENERAL_ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql);
                    }

                    $group_name_row = $db->sql_fetchrow($result);

                    $group_name = $group_name_row['group_name'];

                    $this_userdata = get_userdata($user_id);

                    if (preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery']) {
                        $ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';

                        $board_config['smtp_delivery'] = 1;
                        $board_config['smtp_host'] = @$ini_val('SMTP');
                    }

                    $emailer = new emailer($board_config['smtp_delivery']);

                    $script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
                    $script_name = ($script_name != '') ? $script_name . '/groupcp.' . $phpEx : 'groupcp.' . $phpEx;
                    $server_name = trim($board_config['server_name']);
                    $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
                    $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';

                    $server_url = $server_protocol . $server_name . $server_port . $script_name;

                    $emailer->from($board_config['board_email']);
                    $emailer->replyto($board_config['board_email']);

                    $email_headers = 'X-AntiAbuse: phpBB Forum - ' . $board_config['server_name'] . "\n";
                    $email_headers .= 'X-AntiAbuse: Benutzer ID - ' . $userdata['user_id'] . "\n";
                    $email_headers .= 'X-AntiAbuse: Benutzername - ' . $userdata['username'] . "\n";
                    $email_headers .= 'X-AntiAbuse: Benutzer IP - ' . decode_ip($user_ip) . "\n";

                    $emailer->use_template('admin_group_added', $row['user_lang']);
                    $emailer->email_address($row['user_email']);
                    $emailer->extra_headers($email_headers);
                    $emailer->set_subject($lang['Group_added']);

                    $emailer->assign_vars(array('USERNAME' => $this_userdata['username'],
                            'ADMINISTRATOR' => $userdata['username'],
                            'SITENAME' => $board_config['sitename'],
                            'GROUP_NAME' => $group_name,
                            'BOARD_EMAIL' => $board_config['board_email'],
                            'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '',

                            'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id")
                        );
                    $emailer->send();
                    $emailer->reset();
                }

                unset($user_id);
                $i++;
            }

            $message = $lang['User_add_group_successfully'] . "<br /><br />" . sprintf($lang['Click_return_userlist'], "<a href=\"" . append_sid("admin_user_overview.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

            message_die(GENERAL_MESSAGE, $message);
        }
        break;

    default:

        $template->set_filenames(array('body' => 'admin/user_overview_body.tpl')
            );

        $alpha_range = array();
        $alpha_letters = array();
        $alpha_letters = range('A', 'Z');
        $alpha_start = array($lang['All'], '#');
        $alpha_range = array_merge($alpha_start, $alpha_letters);

        $i = 0;
        while ($i < count($alpha_range)) {
            if ($alpha_range[$i] != $lang['All']) {
                if ($alpha_range[$i] != '#') {
                    $temp = strtolower($alpha_range[$i]);
                } else {
                    $temp = 'num';
                }
                $alphanum_search_url = append_sid($phpbb_root_path . "admin/admin_user_overview.$phpEx?sort=$sort&order=$sort_order&show=$show&alphanum=$temp");
            } else {
                $alphanum_search_url = append_sid($phpbb_root_path . "admin/admin_user_overview.$phpEx?sort=$sort&order=$sort_order&show=$show");
            }

            if (($alphanum == $temp) || ($alpha_range[$i] == $lang['All'] && empty($alphanum))) {
                $alpha_range[$i] = '' . $alpha_range[$i] . '';
            }

            $template->assign_block_vars('alphanumsearch', array('SEARCH_SIZE' => floor(100 / count($alpha_range)) . '%',
                    'SEARCH_TERM' => $alpha_range[$i],
                    'SEARCH_LINK' => $alphanum_search_url)
                );

            $i++;
        }

        $hidden_fields = '<input type="hidden" name="start" value="' . $start . '">';
        $hidden_fields .= '<input type="hidden" name="alphanum" value="' . $alphanum . '">';

        $select_find_by = array('find_username', 'find_user_email', 'find_user_website');
        $select_find_by_text = array( $lang['Username'], $lang['Email'], $lang['Website']);

        $select_find = '<select name="find_by" class="post">';
        for ($i = 0; $i < count($select_find_by); $i++) {
            $selected = ($find_by == $select_find_by[$i]) ? ' selected="selected"' : '';
            $select_find .= '<option value="' . $select_find_by[$i] . '"' . $selected . '>' . $select_find_by_text[$i] . '</option>';
        }
        $select_find .= '</select>';

        $template->assign_vars(array('L_TITLE' => $lang['Userlist'],
                'L_DESCRIPTION' => $lang['Userlist_description'],
                'L_OPEN_CLOSE_ALL' => $lang['Open_close_all'],
                'L_OPEN_CLOSE' => $lang['Open_close'],
                'L_ACTIVE' => $lang['Active'],
                'L_USERNAME' => $lang['Username'],
                'L_GROUP' => $lang['Group'],
                'L_RANK' => $lang['Rank'],
                'L_POSTS' => $lang['Posts'],
                'L_FIND_ALL_POSTS' => $lang['Find_all_posts'],
                'L_JOINED' => $lang['Joined'],
                'L_ACTIVTY' => $lang['Last_login'],
                'L_MANAGE' => $lang['User_manage'],
                'L_PERMISSIONS' => $lang['Permissions'],
                'L_EMAIL' => $lang['Email'],
                'L_PM' => $lang['Private_Message'],
                'L_WEBSITE' => $lang['Website'],
                'L_REGIP' => $lang['Registration_ip'],
                'L_REG_IP' => $lang['Reg_ip'],
                'L_SUBMIT' => $lang['Submit'],
                'L_SELECT_FUNCTION' => $lang['Select_function'],
                'L_DELETE' => $lang['Delete'],
                'L_BAN' => $lang['Ban'],
                'L_UNBAN' => $lang['Unban'],
                'L_ACTIVATE_DEACTIVATE' => $lang['Activate_deactivate'],
                'L_ADD_GROUP' => $lang['Add_group'],
                'L_SORT_LIST' => $lang['Sort_list'],
                'L_ORDER_SHOW' => $lang['Order_show'],
                'L_PER_PAGE' => $lang['Per_page'],
                'L_FILTER_LIST' => $lang['Filter_list'],
                'L_SHOW_ONLY' => $lang['Show_only'],
                'L_USER_ID' => $lang['User_id'],
                'L_USER_LEVEL' => $lang['User_level'],
                'L_ASCENDING' => $lang['Ascending'],
                'L_DESCENDING' => $lang['Descending'],
                'L_SHOW' => $lang['Show'],
                'L_GO' => $lang['Go'],
                'S_SHOW' => $show,
                'S_USER_VARIABLE' => POST_USERS_URL,
                'S_ACTION' => append_sid($phpbb_root_path . 'admin/admin_user_overview.' . $phpEx),
                'S_FILTER' => preg_replace('/%/', '*', $filter),
                'S_SELECT_FIND' => $select_find,
                'S_HIDDEN_FIELDS' => $hidden_fields,
                'SELECTED_ASCENDING' => ($sort_order == "ASC") ? " selected" : "",
                'SELECTED_DESCENDING' => ($sort_order == "DESC") ? " selected" : "",

                'SELECTED_USER_ID' => ($sort == "user_id") ? " selected" : "",
                'SELECTED_ACTIVE' => ($sort == "user_active") ? " selected" : "",
                'SELECTED_USERNAME' => ($sort == "username") ? " selected" : "",
                'SELECTED_JOINED' => ($sort == "user_regdate") ? " selected" : "",
                'SELECTED_REGIP' => ($sort == "user_regip") ? " selected" : "",
                'SELECTED_ACTIVTY' => ($sort == "user_session_time") ? " selected" : "",
                'SELECTED_USER_LEVEL' => ($sort == "user_level") ? " selected" : "",
                'SELECTED_POSTS' => ($sort == "user_posts") ? " selected" : "",
                'SELECTED_RANK' => ($sort == "user_rank") ? " selected" : "",
                'SELECTED_EMAIL' => ($sort == "user_email") ? " selected" : "",
                'SELECTED_WEBSITE' => ($sort == "user_website") ? " selected" : "")
            );

        $order_by = "ORDER BY $sort $sort_order ";

        $sql = 'SELECT ban_userid
			FROM ' . BANLIST_TABLE;

        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not obtain banlist information', '', __LINE__, __FILE__, $sql);
        } while ($row = $db->sql_fetchrow($result)) {
            $banned[$row['ban_userid']] = true;
        }
        $db->sql_freeresult($result);

        $rank_sql = "SELECT *
			FROM " . RANKS_TABLE . "
			ORDER BY rank_special, rank_min";

        if (!($rank_result = $db->sql_query($rank_sql))) {
            message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
        }
        $ranksrow = array();
        while ($rank_row = $db->sql_fetchrow($rank_result)) {
            $ranksrow[] = $rank_row;
        }
        $db->sql_freeresult($rank_result);

        $sql = "SELECT *
			FROM " . USERS_TABLE . "
			WHERE user_id <> " . ANONYMOUS . "
				$alpha_where
				$filter_where
			$order_by
			LIMIT $start, $show";

        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
        }

        $i = 1;
        while ($row = $db->sql_fetchrow($result)) {
            $avatar_img = '';
            if ($row['user_avatar_type'] && $row['user_allowavatar']) {
                switch ($row['user_avatar_type']) {
                    case USER_AVATAR_UPLOAD:
                        $avatar_img = ($board_config['allow_avatar_upload']) ? '<img src="' . $phpbb_root_path . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
                        break;
                    case USER_AVATAR_REMOTE:
                        $avatar_img = ($board_config['allow_avatar_remote']) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : '';
                        break;
                    case USER_AVATAR_GALLERY:
                        $avatar_img = ($board_config['allow_avatar_local']) ? '<img src="' . $phpbb_root_path . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
                        break;
                }
            }

            $poster_rank = '';
            $rank_image = '';
            if ($row['user_rank']) {
                for($ji = 0; $ji < count($ranksrow); $ji++) {
                    if ($row['user_rank'] == $ranksrow[$ji]['rank_id'] && $ranksrow[$ji]['rank_special']) {
                        $poster_rank = $ranksrow[$ji]['rank_title'];
                        $rank_image = ($ranksrow[$ji]['rank_image']) ? '<img src="' . $images['rank'] . $ranksrow[$ji]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
                    }
                }
            } else {
                for($ji = 0; $ji < count($ranksrow); $ji++) {
                    if ($row['user_posts'] >= $ranksrow[$ji]['rank_min'] && !$ranksrow[$ji]['rank_special']) {
                        $poster_rank = $ranksrow[$ji]['rank_title'];
                        $rank_image = ($ranksrow[$ji]['rank_image']) ? '<img src="' . $images['rank'] . $ranksrow[$ji]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
                    }
                }
            }

            $style_color = '';
            if ($row['user_level'] == ADMIN) {
                $row['username'] = '<b>' . $row['username'] . '</b>';
                $style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
            } else if ($row['user_level'] == MOD) {
                $row['username'] = '<b>' . $row['username'] . '</b>';
                $style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
            }

            $email_url = ($board_config['board_email_form']) ? append_sid($phpbb_root_path . 'profile.' . $phpEx . '?mode=email&' . POST_USERS_URL . '=' . $row['user_id']) : 'mailto:' . $row['user_email'];
            $email = '<a href="' . $email_url . '" class="genmed">' . $lang['Email'] . ' [ ' . $row['user_email'] . ' ]</a>';

            $regip = ($row['user_regip']) ? decode_ip($row['user_regip']) :'';
            $host = ($row['user_regip']) ? '[ ' . gethostbyaddr($regip) . ' ]' :'';

            $template->assign_block_vars('user_row', array('ROW_NUMBER' => $i + ($HTTP_GET_VARS['start'] + 1),
                    'ROW_CLASS' => (!($i % 2)) ? $theme['td_class1'] : $theme['td_class2'],

                    'USER_ID' => $row['user_id'],
                    'ACTIVE' => ($row['user_active'] == true) ? $lang['Yes_green'] : $lang['No_red'],
                    'STYLE_COLOR' => $style_color,
                    'USERNAME' => '<b>' . $row['username'] . '</b>' . (($banned[$row['user_id']]) ? '<br /><span class="gensmall">[ ' . $lang['Banned'] . ' ]</span>': ''),
                    'U_PROFILE' => append_sid($phpbb_root_path . 'profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $row['user_id']),

                    'RANK' => $poster_rank,
                    'I_RANK' => $rank_image,
                    'I_AVATAR' => $avatar_img,

                    'JOINED' => create_date($lang['DATE_FORMAT_LONG'], $row['user_regdate'], $board_config['board_timezone']),
                    'REGIP' => $regip,
                    'HOST' => $host,
                    'PERIOD' => period(time() - $row['user_regdate']),
                    'LAST_ACTIVITY' => (!empty($row['user_session_time'])) ? create_date($lang['DATE_FORMAT_LONG'], $row['user_session_time'], $board_config['board_timezone']) : $lang['Never_logged_in'],

                    'POSTS' => ($row['user_posts']) ? $row['user_posts'] : 0,
                    'U_SEARCH' => append_sid($phpbb_root_path . 'search.' . $phpEx . '?search_author=' . urlencode(strip_tags($row['username'])) . '&showresults=posts'),

                    'U_WEBSITE' => ($row['user_website']) ? $row['user_website'] : '',
                    'U_WHOIS_IP' => "http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=$regip",

                    'EMAIL' => $email ,
                    'U_PM' => append_sid($phpbb_root_path . 'privmsg.' . $phpEx . '?mode=post&' . POST_USERS_URL . '=' . $row['user_id']),
                    'U_MANAGE' => append_sid($phpbb_root_path . 'admin/admin_users.' . $phpEx . '?mode=edit&' . POST_USERS_URL . '=' . $row['user_id']),
                    'U_PERMISSIONS' => append_sid($phpbb_root_path . 'admin/admin_ug_auth.' . $phpEx . '?mode=user&' . POST_USERS_URL . '=' . $row['user_id']))
                );

            $group_sql = "SELECT * FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
				WHERE ug.user_id = " . $row['user_id'] . "
				 AND g.group_single_user <> 1
				 AND g.group_id = ug.group_id";

            if (!($group_result = $db->sql_query($group_sql))) {
                message_die(GENERAL_ERROR, 'Could not query groups', '', __LINE__, __FILE__, $group_sql);
            }
            $g = 0;
            while ($group_row = $db->sql_fetchrow($group_result)) {
                if ($group_row['group_moderator'] == $row['user_id']) {
                    $group_status = $lang['Moderator'];
                } else if ($group_row['user_pending'] == true) {
                    $group_status = $lang['Pending'];
                } else {
                    $group_status = $lang['Member'];
                }

                $template->assign_block_vars('user_row.group_row', array('GROUP_NAME' => $group_row['group_name'],
                        'GROUP_STATUS' => $group_status,
                        'U_GROUP' => $phpbb_root_path . 'groupcp.' . $phpEx . '?' . POST_GROUPS_URL . '=' . $group_row['group_id'])
                    );
                $g++;
            }

            if ($g == 0) {
                $template->assign_block_vars('user_row.no_group_row', array('L_NONE' => $lang['None'])
                    );
            }

            $i++;
        }
        $db->sql_freeresult($result);

        $count_sql = "SELECT count(user_id) AS total
			FROM " . USERS_TABLE . "
			WHERE user_id <> " . ANONYMOUS . " $alpha_where $filter_where";

        if (!($count_result = $db->sql_query($count_sql))) {
            message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
        }

        if ($total = $db->sql_fetchrow($count_result)) {
            $total_members = $total['total'];

            $pagination = generate_pagination($phpbb_root_path . "admin/admin_user_overview.$phpEx?sort=$sort&order=$sort_order&show=$show" . ((isset($alphanum)) ? "&alphanum=$alphanum" : ''), $total_members, $show, $start);
        }

        $board_activation = $lang['Acct_activation_board'] . ': <b>' . (($board_config['require_activation'] == USER_ACTIVATION_SELF) ? $lang['Acc_User'] : (($board_config['require_activation'] == USER_ACTIVATION_ADMIN) ? $lang['Acc_Admin'] : $lang['None'])) . '</b>';

        $template->assign_vars(array('TOTAL_MEMBERS' => $total_members,
                'L_USERS' => $lang['Users'],
                'L_BOARD_ACTIVATION' => $board_activation,
                'PAGINATION' => $pagination)
            );

        break;
}

$template->pparse('body');

include('./page_footer_admin.' . $phpEx);

?>
Bacchus1
Registered User
Posts: 45
Joined: Thu Dec 16, 2004 4:29 am

Post by Bacchus1 »

"a sellect all" check box in the user control panel would be really good for when you want to delete multiple users who aren't activated.

Any plans on adding this feature?
schmidtedv
Registered User
Posts: 28
Joined: Wed Mar 09, 2005 8:12 pm

Post by schmidtedv »

Bacchus1 wrote: "a sellect all" check box in the user control panel would be really good for when you want to delete multiple users who aren't activated.

Any plans on adding this feature?



...you can sort by this and then there is a check all already included...in mine (and I guess in the version submitted here, too)
User avatar
Freitag
Registered User
Posts: 143
Joined: Mon Jul 11, 2005 10:17 pm

Post by Freitag »

Bacchus1 wrote: "a sellect all" check box in the user control panel would be really good for when you want to delete multiple users who aren't activated.

Any plans on adding this feature?


You have the old version. This feature is already in the new version.

Download it here:
http://deathmonkeighs.com/files/Admin_Userlist_206.zip
No clever .sig here
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Any news on the validation? I've had several MODs validated since this was submitted it seems... :?
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
lckrause
Registered User
Posts: 6
Joined: Mon Nov 10, 2003 4:02 pm

Post by lckrause »

I just wanted to thank the author of this mod (version 206). I just installed it and it will make administrating my board 100 times more efficient! Thank you!!!
Bacchus1
Registered User
Posts: 45
Joined: Thu Dec 16, 2004 4:29 am

Post by Bacchus1 »

Freitag wrote:
Bacchus1 wrote:"a sellect all" check box in the user control panel would be really good for when you want to delete multiple users who aren't activated.

Any plans on adding this feature?


You have the old version. This feature is already in the new version.

Download it here:
http://deathmonkeighs.com/files/Admin_Userlist_206.zip



Thanks, I intend on updating. Just a quick question about this. When you update with EM do you have to de-install the old mod and then install the new mod; or can you just run the mod and EM will take care of everything for you?
meeciteewurkor
Registered User
Posts: 26
Joined: Fri Oct 08, 2004 1:12 am
Contact:

Post by meeciteewurkor »

question:
after downloading from this URL:
http://deathmonkeighs.com/files/Admin_Userlist_206.zip

I noticed most of the files in the download are rw-rw-rw on the permissions.

is this supposed to be like this?

update: after downloading the zip from phpbb.com, the permissions are primarily rw-r-r

The phpbb download appears to be the safer download?
User avatar
UseLess
Registered User
Posts: 521
Joined: Mon Jul 22, 2002 7:26 pm
Location: North East UK

Post by UseLess »

Greetings,

Not sure if this has been suggested before but the first post should be updated with a link to the latest version, this will then save people having to trawl through all the pages looking for it.

Also to add a little 'idiot' proofing...

Code: Select all

# 
#-----[ OPEN ]-------------------------------------------------------
#

admin/admin_userlist.php

# 
#-----[ FIND ]-------------------------------------------------------
#

else
{
	unset($user_ids);
}

# 
#-----[ AFTER, ADD ]-------------------------------------------------
# 

if( !empty($mode) && !count($user_ids) )
{
	$message = 'No users selected.' . "<br /><br />" . sprintf($lang['Click_return_userlist'], "<a href=\"" . append_sid("admin_userlist.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

	message_die(GENERAL_MESSAGE, $message);
}
Adds a check to see if an action has been selected, delete, ban etc and no users have been selected to perform the action on. Obviously if this is to be included in the mod at some point then the text will need replacing with lang vars.

And the 'confirmation' template used should also be changed to the 'admin' version... so this;

Code: Select all

'body' => 'confirm_body.tpl'
should be;

Code: Select all

'body' => 'admin/confirm_body.tpl'
which is used in 3 places.
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
guspasho
Registered User
Posts: 45
Joined: Thu Sep 15, 2005 9:25 pm
Location: Portland, OR
Contact:

Post by guspasho »

Excuse me for not wanting to read 104 pages. The version in the initial post doesn't appear to work for me. One of the drop-down boxes implies there should be 8 columns of information but I only see 4. Also, sorting won't work.

What version is the latest validated version and what is the link I can use to find it?

And what version is the latest working version that I can find, and link for that as well, please? Thanks so much.
Portland's Anime Convention, Labor Day weekend, http://www.kumoricon.com
schmidtedv
Registered User
Posts: 28
Joined: Wed Mar 09, 2005 8:12 pm

Post by schmidtedv »

rdgrimes
Registered User
Posts: 37
Joined: Sat Dec 24, 2005 5:43 pm

Post by rdgrimes »

I second the suggestion for pruning and updating this thread. I installed 2.0.2, then updated that to 2.0.6, still this thing will not sort user lists. Is there a fix for this?
rdgrimes
Registered User
Posts: 37
Joined: Sat Dec 24, 2005 5:43 pm

Post by rdgrimes »

I've tried uninstalling and re-installing, I tried upgrading 2.0.2 to 2.0.6, etc, etc, etc. and nothing I do will allow me to re-sort the userlist.

Is there no fix for this????????

Edit: OK, I went through again, restored backup from my original forum files, deleted all adminuserlist files from the server and re-installed 2.0.6. Now it's working nicely.
User avatar
Freitag
Registered User
Posts: 143
Joined: Mon Jul 11, 2005 10:17 pm

Post by Freitag »

guspasho wrote: Excuse me for not wanting to read 104 pages. The version in the initial post doesn't appear to work for me. One of the drop-down boxes implies there should be 8 columns of information but I only see 4. Also, sorting won't work.

What version is the latest validated version and what is the link I can use to find it?

And what version is the latest working version that I can find, and link for that as well, please? Thanks so much.


Use the built-in Search function.

Use Google Site Search.

Read any of the last 3 pages.

All will give you that information on almost any forum thread here.
No clever .sig here
rreptile
Registered User
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Post by rreptile »

Freitag wrote:
guspasho wrote:Excuse me for not wanting to read 104 pages. [...] What version is the latest validated version and what is the link I can use to find it?

And what version is the latest working version that I can find, and link for that as well, please? Thanks so much.


Use the built-in Search function.

Use Google Site Search.

Read any of the last 3 pages.

All will give you that information on almost any forum thread here.


This is probably good advice, Freitag. However, wouldn't it be much more helpful to simply place a link to the latest version on the end of every post until it is validated and becomes the official link to the mod on the first post of this ridiculously large thread?

(As far as I know, the latest validated version is the one linked in the first post of this thread and it is only valid for phpbb2.0.11 - which makes it invalid....)

The latest version (not yet validated) of Admin Userlist is here:
http://deathmonkeighs.com/files/Admin_Userlist_206.zip
Post Reply

Return to “[2.0.x] MOD Database Releases”