User Adds Admin — manual creation new users from admin panel

The User Adds Admin plugin provides a convenient tool for administrators to manually create new users directly from the Cotonti admin panel. It allows filling in all standard profile fields, assigning a primary group and additional groups

User Adds Admin — manual creation of users from the Cotonti admin panel

Version: 1.0.0
Author: webitproff
License: BSD
Requirements: Cotonti (current version), users module, PHP 8.5+, MySQL 8.0+
Recommended plugins: usercategories
Repository: github.com/webitproff/usersaddsadmin-cotonti


Table of contents

  1. Plugin purpose
  2. Key features
  3. File and folder structure
  4. Installation
  5. Plugin interface
  6. User List tab
    1. Filters
    2. Statistics
    3. Users table
  7. Create User tab
    1. Form fields
    2. Data validation
    3. Submit handling
  8. Working with extrafields
  9. Integration with usercategories
  10. Hooks for developers
  11. Plugin settings
  12. Frequently asked questions
  13. Conclusion

Plugin purpose

The User Adds Admin plugin provides a convenient tool for administrators to manually create new users directly from the Cotonti admin panel. It allows filling in all standard profile fields, assigning a primary group and additional groups, and populating extrafields without leaving the admin interface.

The plugin also includes a tab with a list of existing users, including filtering and viewing basic information about them.

The plugin works only with standard Cotonti tables (cot_users, cot_groups_users) and does not modify the database structure.

Key features

  • Two-tab interface: user list and user creation.
  • Viewing the user list with filters by name, email, ID, primary group, and category (if usercategories is active).
  • Summary statistics: total number of users and count by groups.
  • New user creation form with the following fields:
    • Username
    • Email
    • Password and password confirmation
    • Primary group
    • Additional groups (checkboxes)
    • Country
    • Timezone
    • Gender
    • Birth date
    • Ban until (date/time)
    • Hide email
    • Theme
    • Language
    • Extra fields, if registered in the system
  • Validation of entered data (username/email uniqueness, password length, email format, password match).
  • Use of the standard cot_add_user() function from the users module for correct user creation.
  • Support for the usercategories plugin for category-based filtering.
  • Hooks for extending functionality.

File and folder structure

plugins/
└── usersaddsadmin/
    ├── usersaddsadmin.setup.php          // Setup file (metadata and settings)
    ├── usersaddsadmin.global.php         // Global hook (compatibility stub)
    ├── usersaddsadmin.admin.php          // Main admin panel file
    ├── inc/
    │   └── usersaddsadmin.functions.php  // Helper functions
    ├── lang/
    │   ├── usersaddsadmin.ru.lang.php    // Russian language file
    │   └── usersaddsadmin.en.lang.php    // English language file
    └── tpl/
        └── usersaddsadmin.admin.tpl      // Admin panel template (XTemplate)

File descriptions

  • usersaddsadmin.setup.php
    Contains plugin metadata: code (usersaddsadmin), name, category, description, version, author, license, requirements (users module), recommendations (usercategories).
    Also contains the setting: perpage (number of users per page).
  • usersaddsadmin.global.php
    Loaded globally via the global hook. Serves as a stub to ensure the plugin is correctly registered in the system.
  • usersaddsadmin.admin.php
    The main admin panel script (hook tools). Handles both tabs:

    • list — user list with filters and statistics;
    • create — new user creation form.

    Performs all business logic: data extraction, validation, user creation via cot_add_user(), processing additional groups and extrafields, and redirects.

  • inc/usersaddsadmin.functions.php
    Helper function cot_usersaddsadmin_usercategories_select() that builds an HTML select of user categories for the list tab filter (if the usercategories plugin is active).
  • lang/usersaddsadmin.ru.lang.php
    Russian language file: all interface strings, field labels, messages.
  • lang/usersaddsadmin.en.lang.php
    English language file.
  • tpl/usersaddsadmin.admin.tpl
    Admin panel template on XTemplate. Defines the layout of both tabs: filter form, user table, statistics, and user creation form.

Installation

  1. Copy the usersaddsadmin folder to the plugins/ directory of your Cotonti site.
  2. Log in to the Cotonti admin panel.
  3. Go to Extensions.
  4. Find User Adds Admin and click Install.
  5. If necessary, configure the perpage setting (number of users per page in the list).
  6. A link to the plugin will appear in the administration menu (Administration → User Adds Admin).

Plugin interface

After opening the plugin, two tabs are displayed:

  1. User List — viewing and filtering existing users, statistics.
  2. Create User — a form for manually adding a new user.

Switching between tabs is done via navigation 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 — text field; 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 numeric identifier.
  • Group — selection of the user’s primary 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. The user_cats field is used (categories are stored comma-separated). All subcategories of the selected category are included in the filter.

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 for whom it is the primary group is displayed.

Users table

The table contains the following columns:

  • ID — user identifier.
  • Name — username, linked to the public profile (opens in a new tab).
  • Email — email address.
  • Group — primary 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.

Create User tab

This tab contains a form for manually adding a new user. All fields available for filling correspond to the standard fields of the cot_users table and additional fields (if they are registered).

Form fields

DB fieldNameElement typeNote
user_nameNameText fieldRequired, minimum 2 characters
user_emailEmailText fieldRequired, valid email
user_passwordPasswordPassword fieldRequired, minimum 4 characters
Repeat passwordPassword fieldMust match the password
user_maingrpPrimary groupDropdownGroups except guests, inactive, and banned
Additional groupsCheckboxesSelect groups to which the user will also be added
user_countryCountryDropdown 
user_timezoneTimezoneDropdownDefault from system settings
user_genderGenderDropdown 
user_birthdateBirth dateDropdowns (year/month/day)Empty value saved as NULL
user_banexpireBan untilDate/time dropdownsEmpty = 0
user_hideemailHide emailYes/No switchDefault “Yes”
user_themeThemeDropdown (theme:scheme) 
user_langLanguageDropdownDefault from system settings
extrafieldsExtra fieldsAccording to field typeDisplayed if extrafields are enabled

Fields that are not displayed in the form and are set automatically when creating a user:
user_regdate, user_lastlog, user_lastvisit, user_lastip, user_logcount, user_sid, user_sidtime, user_lostpass, user_auth, user_token, user_passsalt, user_passfunc. Some of them are filled by the cot_add_user() function.

Data validation

Before creating the user, the following checks are performed:

  • The username does not contain forbidden characters (<, >, #, ', ", /) and is at least 2 characters long.
  • The password is at least 4 characters long.
  • The email has a valid format.
  • The username is unique (does not exist in cot_users).
  • The email is unique if email duplicates are disabled in Cotonti settings (useremailduplicate).
  • The password and password confirmation match.
  • The birth date cannot be in the future.

If errors are found, the user remains on the form with error messages displayed and entered values retained (except for the password).

Submit handling

  1. When the form is submitted, cot_shield_protect() is triggered.
  2. Data is extracted using cot_import().
  3. Validation is performed.
  4. If there are no errors, the standard function cot_add_user($ruser, null, null, null, $ruser['user_maingrp'], false) is called, which:
    • hashes the password with a salt;
    • sets the primary group;
    • adds a record to cot_users;
    • adds a relation to cot_groups_users;
    • sets default values for service fields.
  5. After successful user creation:
    • additional groups (checkboxes) are processed — records are added to cot_groups_users;
    • cot_extrafield_movefiles() is called to move uploaded files (if any);
    • a success message is displayed;
    • a redirect to the “User List” tab is performed.
  6. If creation fails (for example, cot_add_user returned false), an error is displayed.

Working with extrafields

The plugin fully supports standard Cotonti user extrafields registered in the cot_users table.

  • On the user creation tab, each extrafield is rendered with the appropriate input type (text, textarea, select, radio, checkbox, file, etc.) using the cot_build_extrafields() function.
  • Extrafield values are passed to cot_add_user() inside the $ruser array, ensuring they are saved correctly.
  • Files uploaded through extrafield fields are moved to the appropriate directories after user creation using cot_extrafield_movefiles().
  • If validation errors occur, extrafield values are restored for re-display.

Integration with usercategories

If the usercategories plugin is installed and active, a category filter appears on the “User List” tab.

  • Categories are taken from Cot::$structure['usercategories'].
  • The filter respects the category blacklist configured in usercategories (the usercategoriesblacktreecatspage parameter).
  • The selected category includes all its subcategories (cot_structure_children() is used).
  • The search is performed by the user_cats field, where categories are stored comma-separated.

Hooks for developers

The plugin provides several hooks for extending functionality:

  • usersaddsadmin.add.validate
    Called after standard validation of the user creation form but before the cot_error_found() check. Allows adding custom validations.
  • usersaddsadmin.add.done
    Called after successful user creation and addition of additional groups. Suitable for performing extra actions (for example, writing to your own tables).
  • usersaddsadmin.tags
    Called at the end of processing the user creation tab before template rendering. Allows adding custom tags to the template.

Plugin settings

The plugin has one setting:

  • perpage — number of users per page in the list (default 20).

Frequently asked questions

Can I create users with the super administrator role?

Yes, the primary group can be selected from the list of available groups (except guests, inactive, and banned). If you have administrator rights, you can assign any group, including administrators.

What happens if the email is already in use?

If email duplicates are disabled in Cotonti settings (useremailduplicate is off), creation will be blocked with a corresponding error. If duplicates are allowed, the user will be created.

Are additional user fields supported?

Yes, the plugin automatically renders all registered extrafields for the cot_users table and saves them when creating the user.

Can I specify additional groups besides the primary one?

Yes, a list of checkboxes for all available groups is displayed below the primary group. Selected groups will be added to the cot_groups_users table.

Where does the redirect go after creation?

After successful creation, a redirect is performed to the “User List” tab, where the new user can be seen (sorted by descending ID, so they will be first).

Which fields cannot be set through this form?

The form does not allow setting the registration date, login count, last IP, last visit, last login, and other service fields. They are set automatically by the system when the user is created.

Conclusion

The User Adds Admin plugin is a convenient tool for Cotonti administrators that simplifies manual creation of new users with full control over all profile fields. It combines a filterable user list with a complete creation form, using standard Cotonti mechanisms. Thanks to extrafield support and hooks, the plugin can be easily adapted to specific tasks.

Buy User Adds Admin — manual creation new users from admin panel at low prices. Online store offers to order User Adds Admin — manual creation new users from admin panel, 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
8 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.