ComusThumbz 文档
管理员登录

User Management

User Management

File: ct/admin/users.php
Menu Location: Admin Panel → Users → All Users
Access Level: Administrator
Last Updated: 2025-01-02

Overview

The User Management page provides a comprehensive interface for browsing and managing all registered users on the platform. It offers both card and list view modes, advanced filtering options, and quick access to user details. This page serves as the main entry point for user administration.

Key capabilities include:

  • View all registered users with real-time statistics
  • Filter by account status, type, and email verification
  • Search by username or email
  • Switch between card view and list view
  • Quick access to user details page
  • Track online users, new registrations, and creators
  • View pending identity verifications

 


System Requirements

PHP Requirements

Requirement Minimum Recommended
PHP Version 7.4+ 8.0+
Memory Limit 64M 128M

PHP Extensions Required

  • mysqli - Database connectivity
  • session - Session management
  • json - JSON encoding for data

PHP Settings

session.autostart = Off
date.timezone = Your/Timezone

Installation Requirements

Database Tables

-- CMS Users Table (main user table)
CREATE TABLE IF NOT EXISTS tblCMSUsers (
    id INT(11) NOT NULL AUTOINCREMENT,
    username VARCHAR(100) NOT NULL,
    email VARCHAR(255) NOT NULL,
    password VARCHAR(255) NOT NULL COMMENT 'Bcrypt hashed',
    accountstatus ENUM('active', 'suspended', 'banned', 'pending') DEFAULT 'pending',
    accounttype ENUM('free', 'premium', 'vip', 'creator', 'moderator', 'admin') DEFAULT 'free',
    emailverified TINYINT(1) DEFAULT 0,
    iscreator TINYINT(1) DEFAULT 0,
    uploadapproved TINYINT(1) DEFAULT 0,
    tokenbalance DECIMAL(10,2) DEFAULT 0,
    registrationdate DATETIME DEFAULT CURRENTTIMESTAMP,
    lastlogin DATETIME DEFAULT NULL,
    lastactivity DATETIME DEFAULT NULL,
    PRIMARY KEY (id),
    UNIQUE KEY idxusername (username),
    UNIQUE KEY idxemail (email),
    KEY idxaccountstatus (accountstatus),
    KEY idxaccounttype (accounttype),
    KEY idxemailverified (emailverified),
    KEY idxiscreator (iscreator),
    KEY idxlastactivity (lastactivity)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4unicodeci;

-- User Verification Table (for identity verification)
CREATE TABLE IF NOT EXISTS tblUserVerification (
verification
id INT(11) NOT NULL AUTOINCREMENT,
user
id INT(11) NOT NULL,
verificationstatus ENUM('none', 'pending', 'verified', 'rejected') DEFAULT 'none',
stage
name VARCHAR(100) DEFAULT NULL,
iddocumenturl VARCHAR(500) DEFAULT NULL,
selfieurl VARCHAR(500) DEFAULT NULL,
submitted
at DATETIME DEFAULT NULL,
reviewedat DATETIME DEFAULT NULL,
reviewed
by INT(11) DEFAULT NULL,
rejectionreason TEXT DEFAULT NULL,
created
at DATETIME DEFAULT CURRENTTIMESTAMP,
updated
at DATETIME DEFAULT CURRENTTIMESTAMP ON UPDATE CURRENTTIMESTAMP,
PRIMARY KEY (verificationid),
UNIQUE KEY idx
userid (userid),
KEY idxverificationstatus (verificationstatus),
CONSTRAINT fk
verificationuser FOREIGN KEY (userid)
REFERENCES tblCMSUsers (id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4unicodeci;

 

Account Status Reference

Status Description Badge Color
active Active user account Green
suspended Temporarily suspended Orange
banned Permanently banned Red
pending Awaiting email verification Blue

Account Type Reference

Type Description Badge Color
free Standard free account Gray
premium Paid premium member Yellow
vip VIP subscription member Purple
creator Content creator Purple
moderator Site moderator Blue
admin Administrator Red

Config Variables

From ct/dat/config.inc.php:

  • $dbhost, $dbuser, $dbpasswd, $db - Database connection

 

File Dependencies

  • ct/admin/adminauth.php - Admin authentication
  • ct/dat/config.inc.php - Configuration
  • ct/includes/header.php - Admin header
  • ct/includes/annotateftr.php - Admin footer
  • ct/admin/css/adminvariables.css - Admin CSS variables
  • Font Awesome 6+ - Icon library (CDN)
  • ct/admin/userdetails.php - Individual user management
  • ct/admin/creatorsadmin.php - Creator management
  • ct/admin/featuretoggles.php - Feature toggle settings

Features & UI Elements

Page Header

[Screenshot: users-header]

The page header displays:

  • Title: "User Management"
  • Icon: fa-users
  • Breadcrumb: Dashboard / User Management
  • Action Buttons:
  • "Manage Creators" - Links to creatorsadmin.php
  • "Feature Toggles" - Links to featuretoggles.php

 

Statistics Dashboard

[Screenshot: users-stats]

Seven statistics cards showing user counts:

Card Color Description
Total Users Dark Green Total registered users
Active Green Users with active status
Email Verified Blue Users who verified email
New Today Orange Registrations today
Online Now Teal Users active in last 15 minutes
Pending Verification Orange Identity verifications pending
Creators Purple Users with iscreator = 1
Note: "Online Now" counts users with lastactivity within the past 15 minutes.

Filter Panel

[Screenshot: users-filters]

A filter form with the following options:

Filter Type Options
Search Text Username or email
Account Status Dropdown All, Active, Suspended, Banned, Pending
Account Type Dropdown All, Free, Premium, VIP, Creator, Moderator, Admin
Email Verified Dropdown All, Verified, Not Verified

Action Buttons:

  • Search (Green) - Apply filters
  • Clear (Gray) - Reset all filters

View Toggle Toolbar

[Screenshot: users-view-toolbar]

Element Description
Card View Button Switch to card/grid layout
List View Button Switch to table layout (default)
Results Count "Showing X of Y users"
Per Page Selector 10, 25, 50, 100
Tip: View preference is saved to localStorage and persists across sessions.

User Cards (Card View)

[Screenshot: users-card-view]

User cards displayed in a responsive grid (5 columns on large screens):

Card Elements:

  • User avatar (initial letter with gradient)
  • Username with verified badge (if email verified)
  • Email address
  • Account status badge
  • Account type badge
  • Creator badge (if iscreator)
  • Registration date
  • Last login date
  • "View Details" button

 

Avatar Colors:

User Type Avatar Color
Regular User Green gradient
Creator Purple gradient
Admin Red gradient


Card Border Colors:

Status Border Color
Active Green top border
Suspended Orange top border
Banned Red top border
Pending Blue top border

User Table (List View)

 

[Screenshot: users-list-view]

Default view showing users in a table:

Column Description
ID User ID number
User Avatar, username, email
Type Account type badge + Creator badge
Status Account status badge
Email Verified/Not Verified badge
Verification Identity verification status
Registered Registration date
Last Login Last login date or "Never"
Actions View details button

Verification Status Badges:

Status Badge Color Text
none Gray None
pending Blue Pending
verified Green Verified
rejected Red Rejected

Pagination

[Screenshot: users-pagination]

  • First/Last page arrows
  • Previous/Next page arrows
  • Page number links (5 pages visible)
  • Current page highlighted
  • Maintains all filter parameters

Empty State

[Screenshot: users-empty]

When no users match filters:

  • Large user-slash icon
  • "No Users Found" heading
  • Suggestion to adjust search criteria

 


Step-by-Step Usage

Viewing All Users

  1. Navigate to Admin Panel → Users → All Users
  2. By default, shows all users in list view
  3. Users sorted by registration date (newest first)
  4. Click any row to view user details

Searching for Users

  1. Enter username or email in Search field
  2. Click Search button
  3. Results filtered to matching users
  4. Partial matches supported (LIKE '%term%')

 

Note: Search matches against both username AND email fields.

 

Filtering by Status

  1. Select status from Account Status dropdown:
  • Active - Currently active accounts
  • Suspended - Temporarily suspended
  • Banned - Permanently banned
  • Pending - Awaiting activation
  1. Click Search to apply
  2. Statistics update to reflect filter

Filtering by Account Type

  1. Select type from Account Type dropdown:

Free - Standard usersPremium - Paid subscribersVIP - VIP members

  • Creator - Content creators (uses iscreator flag)
  • Moderator - Site moderators
  • Admin - Administrators
  1. Click Search to apply

 

Tip: The "Creator" filter checks the iscreator flag, which is separate from accounttype. This allows creators to also be premium, VIP, etc.

 

Viewing User Details

  1. Find the user in the list or grid
  2. Click the row (list view) or "View Details" button (card view)
  3. Opens userdetails.php with full user management

Switching View Modes

  1. Click Card View or List View in toolbar
  2. View switches immediately
  3. Preference saved to localStorage
  4. Persists on page reload

Changing Results Per Page

  1. Select value from "Show:" dropdown in toolbar
  2. Options: 10, 25, 50, 100
  3. Page reloads with new pagination

Finding Pending Verifications

  1. Note the "Pending Verification" stat card
  2. To view pending verifications:

Click on a user

  • Check the Verification tab in userdetails.php
  • Or navigate to dedicated verification page

Managing Creators

  1. Click Manage Creators in header
  2. Opens creatorsadmin.php
  3. Dedicated interface for creator management

Best Practices

Daily User Management

  1. Check New Registrations:
  • Note "New Today" count
  • Review new users for spam/abuse
  • Verify legitimate sign-ups
  1. Monitor Online Activity:
  • Check "Online Now" metric
  • Identify peak activity times
  • Monitor for unusual patterns
  1. Review Pending Verifications:
  • Process identity verifications promptly
  • Maintain verification queue

User Status Workflow

Scenario Action
New user suspicious activity Suspend first, investigate
Confirmed spam/abuse Ban immediately
User requests account closure Can suspend (soft close) or ban
Temporary account issue Suspend with time limit
Appeal approved Restore to active

Creator Verification

User applies to become creatorIdentity verification submittedAdmin reviews in verification queue

  1. If approved: iscreator = 1
  2. User can now create content

Troubleshooting

Common Issues

No Users Displayed

Cause: Database connection or query error

Solutions:

  1. Check database connection in config.inc.php
  2. Verify tblCMSUsers table exists
  3. Check for SQL errors in PHP error log
  4. Ensure user has table access permissions

 

Search Returns No Results

Cause: Filter too restrictive or term mismatch

Solutions:

  1. Clear all filters and search again
  2. Check spelling of username/email
  3. Try partial search terms
  4. Remove status/type filters temporarily

 

Statistics Show Incorrect Counts

Cause: Database cache or query issue

Solutions:

  1. Refresh page to get fresh counts
  2. Verify COUNT queries in code:

 

SELECT COUNT() FROM tblCMSUsers WHERE accountstatus = 'active';

 

  1. Check database for data integrity

 

View Preference Not Saving

Cause: localStorage blocked or disabled

Solutions:

  1. Check browser allows localStorage
  2. Clear browser storage and retry
  3. View falls back to list view if unavailable

 

User Details Not Loading

Cause: Missing userdetails.php or invalid userid

Solutions:

  1. Verify userdetails.php exists
  2. Check user ID is valid integer
  3. Verify user exists in database
  4. Check admin authentication

 

Debug Queries

-- Count all users
SELECT COUNT() as total FROM tblCMSUsers;

-- Count by status
SELECT accountstatus, COUNT() as count
FROM tblCMSUsers
GROUP BY account
status;


-- Count by type
SELECT accounttype, COUNT() as count
FROM tblCMSUsers
GROUP BY account
type;


-- Users online (last 15 minutes)
SELECT COUNT() FROM tblCMSUsers
WHERE lastactivity > DATESUB(NOW(), INTERVAL 15 MINUTE);


-- New today
SELECT COUNT(
) FROM tblCMSUsers
WHERE DATE(registrationdate) = CURDATE();


-- Pending verifications
SELECT COUNT() FROM tblUserVerification
WHERE verification
status = 'pending';


-- Creators
SELECT COUNT(
) FROM tblCMSUsers WHERE iscreator = 1;

 


Security Considerations

Access Control

  • Admin authentication required via adminauth.php
  • Session validation on page load
  • Only administrators can access this page

Data Protection

  • Passwords are bcrypt hashed (never displayed)
  • Sensitive user data handled securely
  • No bulk export functionality (intentional)

Input Validation

  • Search terms sanitized for SQL
  • Filter values validated against allowed options
  • Pagination values cast to integers

GDPR Compliance

  • User data accessible by admin only
  • Individual user deletion possible via userdetails.php
  • Activity logging for audit trails

Translatable Strings

{
    "userstitle": "User Management",
    "usersbreadcrumb": "Dashboard / User Management",
    "usersmanagecreators": "Manage Creators",
    "usersfeaturetoggles": "Feature Toggles",
    "usersstattotal": "Total Users",
    "usersstatactive": "Active",
    "usersstatverified": "Email Verified",
    "usersstatnewtoday": "New Today",
    "usersstatonline": "Online Now",
    "usersstatpending": "Pending Verification",
    "usersstatcreators": "Creators",
    "usersfiltersearch": "Search",
    "usersfiltersearchplaceholder": "Username or email...",
    "usersfilterstatus": "Account Status",
    "usersfilterstatusall": "All Statuses",
    "usersfilterstatusactive": "Active",
    "usersfilterstatussuspended": "Suspended",
    "usersfilterstatusbanned": "Banned",
    "usersfilterstatuspending": "Pending",
    "usersfiltertype": "Account Type",
    "usersfiltertypeall": "All Types",
    "usersfiltertypefree": "Free",
    "usersfiltertypepremium": "Premium",
    "usersfiltertypevip": "VIP",
    "usersfiltertypecreator": "Creator",
    "usersfiltertypemoderator": "Moderator",
    "usersfiltertypeadmin": "Admin",
    "usersfilteremailverified": "Email Verified",
    "usersfilteremailall": "All",
    "usersfilteremailverified": "Verified",
    "usersfilteremailnotverified": "Not Verified",
    "usersbtnsearch": "Search",
    "usersbtnclear": "Clear",
    "usersviewcard": "Card View",
    "usersviewlist": "List View",
    "usersshowing": "Showing {count} of {total} users",
    "usersperpage": "Show:",
    "userstableid": "ID",
    "userstableuser": "User",
    "userstabletype": "Type",
    "userstablestatus": "Status",
    "userstableemail": "Email",
    "userstableverification": "Verification",
    "userstableregistered": "Registered",
    "userstablelastlogin": "Last Login",
    "userstableactions": "Actions",
    "usersviewdetails": "View Details",
    "usersregistered": "Registered",
    "userslastlogin": "Last Login",
    "usersnever": "Never",
    "usersemptytitle": "No Users Found",
    "usersemptytext": "No users match your current filters. Try adjusting your search criteria.",
    "usersstatusactive": "Active",
    "usersstatussuspended": "Suspended",
    "usersstatusbanned": "Banned",
    "usersstatuspending": "Pending",
    "userstypefree": "Free",
    "userstypepremium": "Premium",
    "userstypevip": "VIP",
    "userstypecreator": "Creator",
    "userstypemoderator": "Moderator",
    "userstypeadmin": "Admin",
    "usersverificationnone": "None",
    "usersverificationpending": "Pending",
    "usersverificationverified": "Verified",
    "usersverificationrejected": "Rejected"
}


Version History

Version Date Changes
1.0.0 2025-10-20 Initial user management page
1.0.5 2025-11-01 Added card view mode
1.0.8 2025-11-15 Added verification status display
1.1.0 2025-12-13 Modern UI, view toggle, creator count