Download & Extend

User Register Notify module giving error with öppning

Project:User registration notification
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Den tyska hustomten
Status:closed (duplicate)
Issue tags:Register Notify

Issue Summary

There is a bug in the user_register_notify.module which yields this error upon new user registration:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3,0,0,0,0' at line 1 query: SELECT mail FROM users AS u INNER JOIN users_roles AS r ON u.uid = r.uid WHERE r.rid IN('')3,0,0,0,0 in D:\****************
user warning: Data too long for column 'type' at row 1 query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'user_register_notify', '', 0, '', 'http://drupal52.local/user/register', 'http://drupal52.local/user/register', '66.185.109.71', 1240417865) in D:\*********\includes\database.mysqli.inc on line 156.
user warning: Data too long for column 'type' at row 1 query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'user_register_notify', '', 0, '', 'http://drupal52.local/user/register', 'http://drupal52.local/user/register', '66.185.109.71', 1240417865) in D:\************\includes\database.mysqli.inc on line 156.

---
On line 189 of user_register_notify.module,

//$result = db_query("SELECT mail FROM {users} AS u INNER JOIN {users_roles} AS r ON u.uid = r.uid WHERE r.rid IN('%s')". $roles);

Should read:

$result = db_query("SELECT mail FROM {users} AS u INNER JOIN {users_roles} AS r ON u.uid = r.uid WHERE r.rid IN('{$roles}')");

The problem was the mix-match of (s)printf style formatting-without an inner call to (s)printf- in addition to invalid syntax (dot operator instead of comma). No worries!

Comments

#1

Status:fixed» needs work

#2

I want you to talk to the security team and ask is this is a good fix?

#3

I just got bit by this bug. Is there any fix on the horizon?

#4

Status:needs work» fixed

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#6

Title:User Register Notify module giving error on user registration» User Register Notify module giving error with öppning
Version:5.x-1.10» 7.x-1.x-dev
Assigned to:mchrisneglia» Den tyska hustomten
Status:closed (fixed)» needs work

Hej

I´ve opend admin user_registry_notify ang h´ve got the following errormessage

* Notice: Constant USER_REGISTER_NOTIFY_SUBJECT already defined in require_once() (Zeile 9 von /hsphere/local/home/jmgse/den-tyska-hustomte.se/drupal/sites/all/modules/user_register_notify/user_register_notify.admin.inc).
* Notice: Constant USER_REGISTER_NOTIFY_BODY already defined in require_once() (Zeile 10 von /hsphere/local/home/jmgse/den-tyska-hustomte.se/drupal/sites/all/modules/user_register_notify/user_register_notify.admin.inc).

With best regards
Jörg

#7

I am seeing the exact same problem. My site's email address provided under the Administration->Configuration->System is a no-reply email address and would like to use the User Register Notify module to send an email to administrators of the site when new users register.

The exact error I am seeing is

Notice: Constant USER_REGISTER_NOTIFY_SUBJECT already defined in require_once() (line 9 of /var/www/Sites/drupal-7.0/sites/all/modules/user_register_notify/user_register_notify.admin.inc).
Notice: Constant USER_REGISTER_NOTIFY_BODY already defined in require_once() (line 10 of /var/www/Sites/drupal-7.0/sites/all/modules/user_register_notify/user_register_notify.admin.inc).

Thanks.

#8

Status:needs work» closed (duplicate)

The Drupal 7 version has been fixed. The original issue is related to only 1 role is supported. I am going to make this one as duplicate.

Thanks
Robert