UserNewNotify v2.2.8 plugin for CMF Cotonti

The extension notifies the administrator about the registration of new users on the site via the system email. Detailed registration statistics with a filter.

User New Notify Plugin for CMF Cotonti Siena

Image Image Image Image Image

The extension notifies the administrator about new user registrations on the site via system email. Detailed registration statistics with filtering.

User New Notify is a plugin for the Cotonti Siena content management system, designed to notify administrators about new user registrations via email and provide an interface in the admin panel for viewing and filtering registration logs. The plugin supports notifications in text and HTML formats, logging to the database, and displaying detailed user information, including device, browser, and country determined by IP.

Key Features

The plugin allows administrators to receive email notifications when a new user registers and when their email address is confirmed. Notifications are available in two formats: plain text and HTML with a modern design, including styles and tables for better readability. Messages differ depending on the registration stage: upon registration, an email is sent with the text “Hello, Administrator! A user has registered but has not yet confirmed their email”, and after email confirmation — “Hello, Administrator! The user has successfully registered and confirmed their email!!!”. Each notification includes the username, email, registration date, IP address, country, device, browser, and a clickable link to the user’s profile.

Registration and email confirmation events are logged in the database in the cot_usrnewnotify_logs table, with a separate entry created for each event. The admin panel provides an interface for viewing logs with filtering by username, email, IP address, country, status, and date range, as well as pagination for convenient navigation.

The plugin supports sending notifications to multiple administrator email addresses (comma-separated) and offers flexible settings via the Cotonti admin panel. Multilingual support is implemented for Russian, English, and Ukrainian languages. Security is ensured through data escaping and validation, minimizing vulnerability risks.

Requirements

The plugin requires CMF Cotonti Siena version 0.9.26 or higher, PHP version 8.4 or higher, and MySQL version 8.0 or higher. The following access rights are required: guests — read-only (R), users — read and write (RW), lock — 12345A for guests and members. Country detection by IP uses the free external API ip-api.com with a limit of 45 requests per minute.

Installation

To install the plugin, download the latest version from the GitHub repository. Unpack the archive into the plugins/ folder of your Cotonti site. Then go to the admin panel under Administration → Extensions → Install Plugin, find User New Notify, and click Install. The plugin will automatically create the cot_usrnewnotify_logs table in the database.

Configuration

Plugin configuration is done via the admin panel under Administration → Extensions → User New Notify → Settings. Available parameters include: enabling/disabling email notifications (notify_enabled, 0 — disabled, 1 — enabled), specifying administrator email addresses separated by commas (notify_email, e.g., [email protected],[email protected]), selecting notification format (notify_format, text or html), and enabling/disabling database logging (notify_log, 0 — disabled, 1 — enabled).

Usage

Notifications

When a new user registers via the users.register.add.done hook, an email is sent with the text: “Hello, Administrator! A user has registered but has not yet confirmed their registration via email” (if regnoactivation is 0). The event is recorded in the cot_usrnewnotify_logs table with status error and message Pending email validation. After email confirmation via the users.register.validate.done hook, a notification is sent: “Hello, Administrator! The user has successfully registered and confirmed their email!”. A record is added to the database with status success and message Notification sent successfully. Notifications include username, email, registration date, IP address, country, device, browser, and a profile link, e.g., https://example.com/en/users/1687?m=details.

View Logs

In the Administration → Extensions → User New Notify section, an interface is available for viewing logs. Logs include record ID, username, email, IP address, country, device (Mobile, Tablet, Desktop), browser (Chrome, Firefox, Safari, etc.), registration date, notification status (success or error), message (e.g., “Pending email validation” or “Notification sent successfully”), and a link to the user profile. Filtering by name, email, IP, country, status, and date range is supported, along with pagination for convenient viewing.

 

Plugin File Structure Schema

 

plugins/usrnewnotify/
├── usrnewnotify.setup.php
├── usrnewnotify.users.register.add.done.php
├── usrnewnotify.users.register.validate.done.php
├── usrnewnotify.tools.php
├── usrnewnotify.tools.tpl
├── inc/
│   └── usrnewnotify.functions.php
├── lang/
│   ├── usrnewnotify.ru.lang.php
│   ├── usrnewnotify.en.lang.php
│   └── usrnewnotify.ua.lang.php
├── usrnewnotify.install.sql
└── usrnewnotify.uninstall.sql

 

List of Plugin Files with Descriptions

  1. usrnewnotify.setup.php This file contains metadata and plugin configuration required for integration with Cotonti Siena. It defines key plugin parameters such as name, version (2.2.8), dependencies, hooks, and settings displayed in the admin panel. It also specifies installation and uninstallation files, license (BSD), and author (webitproff). Cotonti uses this file to register the plugin and handle its installation correctly.
  2. usrnewnotify.users.register.add.done.php The file handles new user registration events. It triggers via the users.register.add.done hook, activated after the cot_add_user function in users.register.php. The logic includes sending an email notification to the admin with the text “Hello, Administrator! A user has registered but has not yet confirmed their email” (if regnoactivation is 0) and logging the event in cot_usrnewnotify_logs with log_status='error' and log_message='Pending email validation'. The notification includes username, email, date, IP, country, device, browser, and profile link.
  3. usrnewnotify.users.register.validate.done.php This file processes email confirmation events. It activates via the users.register.validate.done hook after the user clicks the confirmation link in users.register.php. The file sends an email notification with the text “Hello, Administrator! The user has successfully registered and confirmed their email!” and logs the event in cot_usrnewnotify_logs with log_status='success' and log_message='Notification sent successfully'. The notification includes the same data as during registration: name, email, date, IP, country, device, browser, and profile link.
  4. usrnewnotify.tools.php The file implements the admin panel interface for viewing and filtering registration logs. It processes filter requests by username, email, IP, country, status, and date range, generates SQL queries to retrieve data from cot_usrnewnotify_logs, and prepares data for template display. It also manages pagination and error or no-logs messages. This file ensures proper operation of the Administration → Extensions → User New Notify section.
  5. usrnewnotify.tools.tpl This is the admin panel interface template that defines the visual layout of the log viewing page. It includes HTML markup for the filter form (fields for name, email, IP, country, status, and dates), log table (columns for ID, name, email, IP, country, device, browser, date, status, message, and profile link), and pagination elements. The template uses Cotonti tags for dynamic data insertion prepared in usrnewnotify.tools.php.
  6. inc/usrnewnotify.functions.php The file contains helper functions used for data processing. It includes functions to detect device type (Mobile, Tablet, Desktop) and browser (Chrome, Firefox, Safari, etc.) based on the User-Agent string, and to determine country by IP using the ip-api.com API. It also implements logging functions to cot_usrnewnotify_logs, ensuring consistent data handling across all plugin parts.
  7. lang/usrnewnotify.ru.lang.php This file contains the Russian localization of the plugin, including translations for the admin interface, notification texts, and email templates. For example, it defines strings like L['Success'] = 'Success', L['Error'] = 'Error', and full email texts for registration and confirmation. The file is used to display the interface and messages in Russian.
  8. lang/usrnewnotify.en.lang.php The file provides English localization. It includes translations of all interface strings, notifications, and email templates into English, such as L['Success'] = 'Success', L['Error'] = 'Error'. This enables use on English-language sites with correct text and email display.
  9. lang/usrnewnotify.ua.lang.php This file provides Ukrainian localization. It includes translations of the interface, notifications, and email templates into Ukrainian, e.g., L['Success'] = 'Успіх', L['Error'] = 'Помилка'. The file is necessary for Ukrainian-language sites to ensure proper text display.
  10. usrnewnotify.install.sql The file contains an SQL script executed during plugin installation. It creates the cot_usrnewnotify_logs table with fields log_id, log_user_id, log_user_name, log_user_email, log_ip, log_user_agent, log_device, log_browser, log_country, log_date, log_status, and log_message. This script ensures proper database structure initialization for log storage.
  11. usrnewnotify.uninstall.sql This file contains an SQL script executed during plugin uninstallation. It drops the cot_usrnewnotify_logs table, clearing all plugin-related data. This ensures no unnecessary tables remain after removal.

     

 

Database Structure

The cot_usrnewnotify_logs table stores registration event information. The log_id field (integer, primary key) sets a unique record identifier. log_user_id (integer) indicates the user ID. log_user_name (string) stores the username, and log_user_email (string) — the email. log_ip (string) saves the user’s IP address, supporting IPv4 and IPv6. log_user_agent (text) contains the User-Agent string. log_device (string) indicates device type (Mobile, Tablet, Desktop), and log_browser (string) — the browser used. log_country (string) stores the country determined by IP. log_date (datetime) records the event date and time. log_status (enum, success or error) denotes notification status. log_message (text) contains the message, e.g., “Pending email validation” or “Notification sent successfully”.

Security

The plugin ensures a high level of security. Data is escaped using htmlspecialchars to protect against XSS attacks. IP addresses are validated via filter_var, and emails are checked before sending. SQL queries use prepared statements to prevent injections. Interaction with the ip-api.com API is performed securely with error handling.

License

The plugin is distributed under the BSD license, providing flexibility in use and modification.

Author

Plugin developer — webitproff. Contact information and other projects are available on GitHub: https://github.com/webitproff. Copyright © 2025 webitproff.

Known Issues

HTML notifications require HTML support in the email client, which may be a limitation for some users. Device, browser, and country detection depend on User-Agent data and the ip-api.com API, which can sometimes be inaccurate. The free version of ip-api.com is limited to 45 requests per minute, which should be considered under high load.

Support

For questions and issue resolution, create an Issue on GitHub. Plugin discussion is available on the forum. To offer the developer a task or job, contact via https://abuyfile.com/users/webitproff.

Date: October 29, 2025

8 minutes read Sodium Carbonate

Comments (0)

No comments yet
Only registered users can post new comments

Content author

webitproff

Offline

Sodium Carbonate

Last logged: 2026-07-20 04:22

  • Page published: 2025-10-29 19:33
  • Last update: 2025-10-30 11:46
  • Language:

Similar pages

Загрузчик плагина (Plugin loader) в Cotonti Siena CMF
1 Обзор загрузчика и Введение в систему плагинов CotontiПодробный разбор самой концепции инициализации плагинов и анализ
Cotonti Siena CMF • 2026-03-10 11:22 webitproff
Файл plugin.php в Cotonti
2 Основное назначение кода в файле plugin.php в системной папке Cotonti CMF — это обработка плагинов в рамках фреймворка.
AjaxPopover plugin Плагин
3 AjaxPopover plugin Плагин для фриланс-биржи на Cotonti При наведении на ссылку, всплывает доп. информация, например, на
User Blog • 2020-07-17 05:15 webitproff
Fast Passrecover plugin Плагин
4 Fast Passrecover plugin Плагин для фриланс-биржи на Cotonti Пропускает этап подтверждения смены пароля Данный плагин
User Blog • 2020-07-17 05:15 webitproff
reCaptcha API 2.0 plugin
5 reCaptcha API 2.0 plugin для фриланс-биржи на Cotonti Стильная Google reCaptcha теперь и для Cotonti Порядок
User Blog • 2020-07-17 05:15 webitproff