Flyspray - The bug killer!

  • Status Unconfirmed
  • Percent Complete
    50%
  • Task Type Bug Report
  • Category Notifications
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 1.0-rc
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Flyspray - The bug killer!
Opened by Arthmoor - 16.02.2017

FS#2344 - Admins still get noticed for new users even with the option disabled

/index.php?do=admin&area=prefs

There’s a checkbox on this menu to toggle whether admins get notices for new user registrations or not. Ours is off, but I’m still getting those notices.

Project Manager
peterdd commented on 20.03.2017 20:33

Maybe former devs did it with intention?

With some user registration settings it seems to be an requirement that at least 1 admin account gets notified about a new user waiting for approval, regardless of that option.

So maybe the option depends a bit on the current new user registration settings? Mmh..

Arthmoor commented on 23.03.2017 05:59

I've been scanning through the code looking for why this isn't working and all I can conclude so far is that $fs→prefs['notify_registration'] is never used by anything. It's only ever touched by the admin CP code that sets or unsets the option.

I can't find where the actual email is sent out in the code to even try to fix it on our end. Spammers have driven the system mad trying to register and it blocked the server's account from being able to send mail at all now.

If the former developers did this on purpose, it was a really dumb thing to do.

Project Manager
peterdd commented on 23.03.2017 17:08

The usage of notify_registration was removed with this commit:

https://github.com/Flyspray/flyspray/commit/b0a5ed89764ef2bce4dacf5cc56afe493be3d7ea

In includes/class.backend.php function create_user():

 $recipients = self::GetAdminAddresses();
...
            // Notify the appropriate users
            $notify->Create(NOTIFY_NEW_USER, null,
                            array($baseurl, $user_name, $real_name, $email, $jabber_id, $password, $auto),
                            $recipients, NOTIFY_EMAIL);

I think @jahto wanted to move the decision to the notification part. So the notification system decides if enabled admins get informed by their prefered notification settings. So that global pref 'notify_registration' gets deprecated...

This temporarly fix (untested):

if($fs->prefs['notify_registration']){
    $notify->Create(NOTIFY_NEW_USER, null,
                            array($baseurl, $user_name, $real_name, $email, $jabber_id, $password, $auto),
                            $recipients, NOTIFY_EMAIL);
}else{
    $notify->Create(NOTIFY_NEW_USER, null,
                            array($baseurl, $user_name, $real_name, $email, $jabber_id, $password, $auto),
                            $recipients, 0); # do not send emails to admins, only show as notification 'online' (when implemented)
}
Arthmoor commented on 23.03.2017 20:09

I tried adding that fix to the code on our site, it hasn't done anything to stop the notifications from being sent. Is there another place that users might be getting created?

Arthmoor commented on 23.03.2017 21:51

Ok, I trimmed it to this:

            // Notify the appropriate users
            if($fs->prefs['notify_registration']) {
                $notify->Create(NOTIFY_NEW_USER, null,
                    array($baseurl, $user_name, $real_name, $email, $jabber_id, $password, $auto), $recipients, NOTIFY_EMAIL);
            }

Now the notifications no longer get sent to admins if the setting isn't enabled.

Project Manager
peterdd commented on 24.03.2017 04:36

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing