User Mass Edit - Editing fields of users profile in one form
The User Mass Edit plugin for Cotonti CMF allows the site administrator to massively change user data without opening each profile separately.
The User Mass Edit plugin allows the site administrator to massively change user data without opening each profile separately. Editing fields is performed in one table, in one form, and allows you to make multiple edits and save them all at once.
User Mass Edit — mass editing of Cotonti users
Version: 1.1.27
Author: webitproff
License: BSD
Requirements: Cotonti (current version), users module, PHP 8.5+, MySQL 8.0+
Recommended plugins: xtradbrowusers, usercategories
Table of contents
- Plugin purpose
- Who it is for
- Installation
- Interface overview
- User List tab
- Mass Editing tab
- Fields available for editing
- Working with dates
- Working with passwords
- Filtering and search
- Plugin settings
- Integration with other extensions
- Hooks for developers
- Deleting users
- Save mechanism and update count
- Frequently asked questions
- Conclusion
Plugin purpose
The User Mass Edit plugin provides administrators with a single interface for mass viewing, filtering, and editing user accounts in Cotonti. It allows changing both standard fields of the cot_users table and additional fields (extrafields), as well as deleting selected users without opening each profile separately.
The plugin works only with the standard cot_users table and does not alter the database structure. Integration with external tables (for example, cot_xtradbrowusers) is done through hooks.
Who it is for
The plugin is intended exclusively for administrators of Cotonti who have access to the administration panel.
Access rights:
- Viewing and using the plugin is available only to users with administrator rights (
isadmin). - Regular users and moderators do not have access to this section.
Installation
- Copy the
usersmasseditfolder to theplugins/directory of your site. - Log in to the Cotonti administration panel.
- Go to Extensions.
- Find the User Mass Edit plugin and click Install.
- After installation, open the plugin settings and select which columns should be displayed in the mass editing table.
- A link to the plugin will appear in the administration menu (usually Administration → User Mass Edit).
Interface overview
After opening the plugin, you will see two tabs:
- User List — viewing and filtering users, summary statistics by groups.
- Mass Editing — a table with editable fields for mass data changes.
Switching between tabs is done using the tabs at the top of the page.
User List tab
On this tab, the administrator can view the list of users and apply filters to find the necessary records.
Filters
- Search — a text field for entering a keyword.
The search area is selected with a switch:- Name — search by
user_name. - Email — search by
user_email. - Name and Email — search by both fields.
- Name — search by
- User ID — exact filter by user identifier.
- Group — select the user’s main group (
user_maingrp).
The list of groups is taken from thecot_groupstable. - Category — filter by user category, if the
usercategoriesplugin is active.
Uses theuser_catsfield (categories are stored comma-separated). The dropdown is built with Select2 support and respects the category blacklist configured inusercategories.
Statistics
Summary information is displayed above the table:
- Total users — the total number of records in the
cot_userstable. - Count by groups — for each group, the number of users who have it as their main group is displayed.
Users table
The table contains the following columns:
- ID — user identifier.
- Name — user name; it is a link to the public profile (opens in a new tab).
- Email — email address.
- Group — main group name.
- Registration date — formatted registration date.
- Ban until — shows “Yes” if the user is banned (the ban period has not expired), otherwise “No”.
Pagination is available below the table.
Mass Editing tab
The main work of the plugin takes place here. You see a table in which each row corresponds to one user, and the columns are editable fields. The set of displayed columns depends on the plugin settings.
How it works
- Select the necessary filters to narrow down the users.
- Change the values in the table cells.
- Click the “Update” button at the bottom of the page.
- All changes will be saved to the database.
- A message will appear with the number of updated and deleted records.
Filters on this tab
The filters are similar to the User List tab, but their values are additionally stored in hidden form fields so that after saving you return to the same list.
Fields available for editing
The plugin allows editing the following standard fields of the cot_users table:
| DB field | Column name | Data type | Editing method | Notes |
|---|---|---|---|---|
user_name | Name | String | Text field | Required |
user_email | String | Text field | Required | |
user_password | New password | String (hash) | Field for entering a new password (empty = no change) | Minimum 4 characters; hashed with salt |
user_maingrp | Main group | Integer | Group dropdown | |
user_banexpire | Ban until | Timestamp | Date and time dropdowns | Empty value = 0 |
user_country | Country | String | Country dropdown | Value “00” is normalized to an empty string |
user_timezone | Timezone | String | Timezone dropdown | If old is empty and new is UTC, it is considered unchanged |
user_text | About me | Text | Multiline textarea | |
user_birthdate | Birth date | Date (DATE) | Year, month, day dropdowns | Empty value saved as NULL |
user_gender | Gender | String | Dropdown | Value “U” is normalized to an empty string |
user_hideemail | Hide email | Integer | Yes/No switch | |
user_theme + user_scheme | Theme | String | Theme dropdown (theme:scheme) | Handled together; empty value clears both fields |
user_lang | Language | String | Language dropdown | Empty language saved as empty string |
user_regdate | Registration date | Timestamp | Date and time dropdowns | |
user_lastlog | Last login | Timestamp | Date and time dropdowns | |
user_lastvisit | Last visit | Timestamp | Date and time dropdowns | |
user_lastip | Last IP | String | Text field | |
user_logcount | Login count | Integer | Number field | |
delete (virtual) | Delete | Flag | Yes/No switch | When “Yes” is set, the user is deleted |
Additionally: if the display of extrafields is enabled in settings (show_extrafields) and additional fields are registered for users, they will also appear in the table using the standard Cotonti mechanism (cot_build_extrafields). Supported types include: text, textarea, select, radio, checkbox, checklistbox, datetime, file.
Fields intentionally not editable:user_sid, user_sidtime, user_lostpass — service fields that do not require mass editing.
It is also impossible to view the current password; you can only set a new one.
Working with dates
Timestamp fields
Timestamp fields include:
user_banexpireuser_regdateuser_lastloguser_lastvisit
For them, dropdowns are displayed:
- Year
- Month
- Day
- Hour
- Minute
If the current value is 0 (or not set), the dropdowns remain empty, and you can either leave them empty or select a specific date.
When saving:
- If no date is selected (empty dropdowns), the field is set to
0for timestamp fields. - If a date is selected, it is converted to a Unix timestamp.
- Comparison with the current value is done to the minute: if the selected date matches the saved one (in
Y-m-d H:iformat), the field is not updated.
user_birthdate field (DATE)
For the birth date, the following dropdowns are displayed:
- Year
- Month
- Day
If no date is selected, the field is saved as NULL. Otherwise, it is saved in the YYYY-MM-DD format. The value 0000-00-00 is also treated as NULL.
Working with passwords
- The “New password” field is always empty.
- If you leave it empty, the user’s password is not changed.
- If you enter a new password, it must be at least 4 characters long.
- The password is hashed using Cotonti settings (
hashfunc) and a unique random salt (cot_unique(16)).
Warning: after saving, the password cannot be recovered, so make sure you remember the new password.
Filtering and search
Filters are applied both on the User List tab and on the Mass Editing tab. They are combined using logical AND. If a group filter and a name search are selected, only users that satisfy both conditions will be shown.
Available filters:
- Search by name, email, or both.
- Exact user ID.
- Main group (
user_maingrp). - User category (if
usercategoriesis active). The filter includes all subcategories of the selected category.
Plugin settings
In the plugin settings, you can control the visibility of each column in the mass editing table, as well as the number of records per page.
perpage— number of users per page (default 20).show_name— show the “Name” column.show_email— show the “Email” column.show_password— show the “New password” column.show_maingrp— show the “Main group” column.show_banexpire— show the “Ban until” column.show_country— show the “Country” column.show_timezone— show the “Timezone” column.show_text— show the “About me” column.show_birthdate— show the “Birth date” column.show_gender— show the “Gender” column.show_hideemail— show the “Hide email” column.show_theme— show the “Theme” column.show_lang— show the “Language” column.show_regdate— show the “Registration date” column.show_lastlog— show the “Last login” column.show_lastvisit— show the “Last visit” column.show_lastip— show the “Last IP” column.show_logcount— show the “Login count” column.show_delete— show the “Delete” column.show_extrafields— show extra field columns.
By default, all columns are enabled. You can hide unnecessary ones to simplify the table.
Integration with other extensions
xtradbrowusers plugin
The xtradbrowusers plugin (additional user fields in a separate table) can be integrated through hooks. This allows displaying and saving custom extrafields from the cot_xtradbrowusers table directly in the mass editing table.
The following hooks are used for integration:
usersmassedit.massedit.save— called when saving each user, allowing you to process and store additional fields.usersmassedit.massedit.saved— called after all updates are completed.usersmassedit.massedit.sql.fields— allows adding fields from other tables to the SELECT query.usersmassedit.massedit.flags— adds column visibility flags.usersmassedit.massedit.headers— adds column headers.usersmassedit.massedit.loop— called inside the loop for each user to output additional cells.
usercategories plugin
The function cot_usersmassedit_usercategories_select2() is used to create a category dropdown with Select2 support and respect the category blacklist configured in usercategories. The category filter includes all subcategories.
Hooks for developers
If you are a developer and want to add support for your own fields or integrate external data, use the following hooks:
usersmassedit.massedit.sql.fields
Allows adding fields to the SELECT query.
Example:
$selectFields[] = 'myextra.field_name AS alias';
$needXtraJoin = true; // if a JOIN is requiredusersmassedit.massedit.flags
Sets additional visibility flags, for example SHOW_MYFIELD.
usersmassedit.massedit.headers
Adds column headers via $t->parse('MAIN.MY_HEADER').
usersmassedit.massedit.loop
Called for each row, allowing you to output your own cell and process data.
usersmassedit.massedit.save
Called when saving each user. In this hook, you can intercept data from $_POST and write it to your own table. If you fill the $hookUpdate array inside the hook, it will be merged with the main update array.
usersmassedit.massedit.saved
Called after the entire save loop is completed.
Deleting users
The plugin uses the standard UsersControlService::delete() service to delete a user. This ensures:
- Deletion of the record from
cot_users. - Deletion of relations from
cot_groups_users. - Deletion of extrafield files.
- Deletion of the user’s personal files (PFS), if the PFS module is active.
- Calling the
users.deleteandusers.delete.donehooks.
Deletion is performed transactionally, ensuring data integrity. If the “Delete” flag (value 1) is set for a user, they are deleted before processing other fields, and no further changes are applied to them.
Save mechanism and update count
When the “Update” button is clicked, the form sends a POST request to the URL with the a=update parameter. The form sends:
- The list of user IDs (
ids[]) — only those displayed on the current page (taking pagination into account). - Field values for each ID as arrays (for example,
name[123],email[123], etc.). - Hidden fields with filter parameters, so that after saving you return to the same list.
Saving algorithm:
- All IDs from
$_POST['ids']are extracted and converted to integers. - A SELECT query is executed to retrieve the current values of all fields for the selected users.
- For each ID in a loop:
- If the delete flag (
delete[id] == 1) is set, the user is deleted, the deleted counter is incremented, and processing moves to the next ID. - Otherwise, an
$updatearray is built — fields that have actually changed. - For each editable field, the new value is compared with the current one:
- Text fields are compared as strings after
trim()and normalization of empty equivalents. - Integer fields are compared as
(int). - Password is processed only if a non-empty password of at least 4 characters is entered.
- Timestamp fields are compared to the minute.
- Birth date is compared in DATE format, taking
NULLinto account. - Extrafields are processed by type (files, checkboxes, lists, dates, etc.).
- Text fields are compared as strings after
- If the
$updatearray is not empty, an SQLUPDATEquery is executed, and the updated users counter ($updatedCount) increases by 1. - If there are no changes, the record is not updated, and the counter is not increased.
- If the delete flag (
- After the loop, the
usersmassedit.massedit.savedhook is called. - A message is generated with the number of updated and deleted users, and a redirect is performed to the original page with the filter parameters.
Important:
- No default values are inserted automatically. If a field has not been changed, it retains its current value from the database.
- Users whose fields were not edited do not count as updated, and no SQL
UPDATEquery is executed for them. - The
updatedCountcounter reflects only records in which at least one field was changed (including extrafields and fields added via hooks). - Updates are performed only for users displayed on the current page. If you want to change users on other pages, you need to go to the corresponding page and repeat the operation.
Frequently asked questions
Can I restore a user deleted by mistake?
No. Deleting a user is irreversible. Make sure it is truly necessary before deleting.
Why can’t I see the current password?
Cotonti stores passwords only as hashes. It is impossible to recover the original password. Therefore, the plugin only allows setting a new password.
How can I edit only a part of the users?
Use the filters on the Mass Editing tab to narrow the list to the necessary users. Then change the fields and save.
Why is the number of updated users less than the number of rows I edited?
The counter only counts records where at least one field actually changed. If you changed a field but the new value is the same as the old one (for example, entered the same email), the record is not updated and is not counted. Also check that you are on the correct page: only rows from the current page are saved.
Can I export data?
No, the plugin is intended only for mass editing, not for export or import.
Which fields cannot be edited?
Service fields user_sid, user_sidtime, user_lostpass, as well as technical fields user_auth, user_token, user_passfunc, user_passsalt (except when setting a new password) are not editable.
Are additional user fields (extrafields) supported?
Yes, if the show_extrafields option is enabled in settings, all standard extrafields of the cot_users table will be displayed and saved. Integration with the xtradbrowusers plugin is also possible through hooks.
Conclusion
The User Mass Edit plugin is a powerful tool for quickly managing Cotonti users. It saves administrator time and reduces the risk of errors when manually editing each profile. Thanks to flexible column settings, filters, extrafield support, and a hook system, the plugin easily adapts to specific tasks.
Buy User Mass Edit - Editing fields of users profile in one form at low prices. Online store offers to order User Mass Edit - Editing fields of users profile in one form, view full description, detailed specifications, product photos and current prices with discounts
Product has no downloadable file
Page Discussion in Telegram
Content author
Offline
webitproff
Last logged: 2026-08-23 02:19
- 2026-08-22 22:14
- 2026-08-22 22:32
- Editing a translation
- Language:
Related and similar products
Market PRO Showcase
CMS, Script and Engine for an online storefront, infoproduct shop and digital goods store. Different prices in different currencies. Online cryptocurrency payments for goods and services.
Русский