Previous Thread
Next Thread
Print Thread
Hop To
Joined: Aug 2006
Posts: 1,360
Likes: 2
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,360
Likes: 2
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 wink )

The problem is in this line:
PHP Code
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!


[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
that code is fine.

you realize that !0 --> true and !1 --> bummer, right ?

Joined: Aug 2006
Posts: 1,360
Likes: 2
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,360
Likes: 2
This my replacement code.

Update: Removed it. Was no good.

Last edited by blaaskaak; 09/23/2007 6:24 PM.

[Linked Image from siemons.org]
Joined: Aug 2006
Posts: 1,360
Likes: 2
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,360
Likes: 2
Originally Posted by Sirdude
that code is fine.


Whether that code is fine or not, I don't know for sure, it was my primary suspect, I do know the setting is ignored because I gets loads of new user notifications while the setting for me is off smile

update:
okay, did a codetest, you are right. But somehow somewhere else on the road it goes wrong, because the bug itselve is definitely there.

Last edited by blaaskaak; 09/23/2007 5:59 PM.

[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
ok, so your config must be set to 1 then. so !1 && !0 is killing that if and forcing an unwanted email.

i see, at 2nd blush there looks to be a small 'buglet' smile

Joined: Aug 2006
Posts: 1,360
Likes: 2
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,360
Likes: 2
Originally Posted by Sirdude
i see, at 2nd blush there looks to be a small 'buglet' smile


hehe, I only just noticed it because I changed a bit in the board name (we have a tagline that I moved to the "Powered by" language string. So my mail blocks weren't working anymore.

Well, the checks done in the code can be done in the query smile


[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
except for the $config check. that turns it off, regardless if admins like emails.

so to me i see the $config check must be true, then any admin who wants emails gets them. right ?

Joined: Aug 2006
Posts: 1,360
Likes: 2
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,360
Likes: 2
Well, the whole block should not be run according to the config setting. It should not be checked inside the loop.


[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
hrm...

there are 2 settings 'EMAIL_VERIFICATION' and 'NEW_USER_MODERATION'

1st one is whether the new user needs to verify their email. 2nd one is whether or not the new users get placed in a queue to be accepted or declined.

as i see it.

and currently the question asked of the admin in their preferences is if they want to be notified on any new user registration. there is really noting about whether an approval is required.

so if you want to take it to the extreme, the admin gets emails if he likes them and those emails are either : 'hey a new user signed up' or 'hey a new user signed up and needs you to approve the poor bashtid'

no ?

Joined: Aug 2006
Posts: 1,360
Likes: 2
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,360
Likes: 2
Originally Posted by Sirdude
no ?


Basicly, that's a yes smile

As long as I don't get those mails laugh


[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
Fixed 7.3 smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
After server reboot
by Morgan - 09/02/2026 8:27 AM
Email Settings
by Outdoorking - 05/13/2026 2:44 AM
Who's Online Now
0 members (), 225 guests, and 88 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)