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

  1. Plugin purpose
  2. Who it is for
  3. Installation
  4. Interface overview
  5. User List tab
  6. Mass Editing tab
  7. Fields available for editing
  8. Working with dates
  9. Working with passwords
  10. Filtering and search
  11. Plugin settings
  12. Integration with other extensions
  13. Hooks for developers
  14. Deleting users
  15. Save mechanism and update count
  16. Frequently asked questions
  17. 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

  1. Copy the usersmassedit folder to the plugins/ directory of your site.
  2. Log in to the Cotonti administration panel.
  3. Go to Extensions.
  4. Find the User Mass Edit plugin and click Install.
  5. After installation, open the plugin settings and select which columns should be displayed in the mass editing table.
  6. 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:

  1. User List — viewing and filtering users, summary statistics by groups.
  2. 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.
  • User ID — exact filter by user identifier.
  • Group — select the user’s main group (user_maingrp).
    The list of groups is taken from the cot_groups table.
  • Category — filter by user category, if the usercategories plugin is active.
    Uses the user_cats field (categories are stored comma-separated). The dropdown is built with Select2 support and respects the category blacklist configured in usercategories.

Statistics

Summary information is displayed above the table:

  • Total users — the total number of records in the cot_users table.
  • 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

  1. Select the necessary filters to narrow down the users.
  2. Change the values in the table cells.
  3. Click the “Update” button at the bottom of the page.
  4. All changes will be saved to the database.
  5. 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 fieldColumn nameData typeEditing methodNotes
user_nameNameStringText fieldRequired
user_emailEmailStringText fieldRequired
user_passwordNew passwordString (hash)Field for entering a new password (empty = no change)Minimum 4 characters; hashed with salt
user_maingrpMain groupIntegerGroup dropdown 
user_banexpireBan untilTimestampDate and time dropdownsEmpty value = 0
user_countryCountryStringCountry dropdownValue “00” is normalized to an empty string
user_timezoneTimezoneStringTimezone dropdownIf old is empty and new is UTC, it is considered unchanged
user_textAbout meTextMultiline textarea 
user_birthdateBirth dateDate (DATE)Year, month, day dropdownsEmpty value saved as NULL
user_genderGenderStringDropdownValue “U” is normalized to an empty string
user_hideemailHide emailIntegerYes/No switch 
user_theme + user_schemeThemeStringTheme dropdown (theme:scheme)Handled together; empty value clears both fields
user_langLanguageStringLanguage dropdownEmpty language saved as empty string
user_regdateRegistration dateTimestampDate and time dropdowns 
user_lastlogLast loginTimestampDate and time dropdowns 
user_lastvisitLast visitTimestampDate and time dropdowns 
user_lastipLast IPStringText field 
user_logcountLogin countIntegerNumber field 
delete (virtual)DeleteFlagYes/No switchWhen “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_banexpire
  • user_regdate
  • user_lastlog
  • user_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 0 for 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:i format), 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 usercategories is 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 required

usersmassedit.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.delete and users.delete.done hooks.

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:

  1. All IDs from $_POST['ids'] are extracted and converted to integers.
  2. A SELECT query is executed to retrieve the current values of all fields for the selected users.
  3. 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 $update array 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 NULL into account.
      • Extrafields are processed by type (files, checkboxes, lists, dates, etc.).
    • If the $update array is not empty, an SQL UPDATE query 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.
  4. After the loop, the usersmassedit.massedit.saved hook is called.
  5. 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 UPDATE query is executed for them.
  • The updatedCount counter 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


Rating based on reviews:
Stars received: 0
Total reviews: 0
Average rating: 0
11 minutes read

Reviews to products

No reviews yet


Add to Cart

Product has no downloadable file

 

Page Discussion in Telegram

Content author

webitproff

Offline

webitproff

Last logged: 2026-08-23 02:19

About me briefly
Support and development of web projects on the CMF Cotonti: private messengers via the website, open and closed small social networks, trading platforms and marketplaces, freelance and services exchange portal, catalogs of goods from wholesale suppliers, dropshipping platforms, online stores, and much more.
View developments and download
Public portfolio of my works and developments
Telegram for messages
@webitproff
Telegram channel
@s/aBuyFILE

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.