there's a setting in admin's profile whether or not to receive e-mails when a new user has registered. Both the code in /scripts/adduser.inc.php and /scripts/verifyemail.inc.php does not work (well, it's the same piece of code

)
The problem is in this line:
if (!$config['NEW_USER_MODERATION'] && !$notify_newuser) {
Since $notify_newuser is always 0 or 1, it always has a value.
I fixed it locally by moving this check into the query instead of in the code. Did the same for the admin e-mail check that's there.I'm gonna testrun the code now and place it here for anyone looking to fix this.
Update: analysed why it goes wrong wrong, but the bug is there!