Reset anonymous user's email address to default?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
dncollins
Registered User
Posts: 127
Joined: Sat Feb 14, 2009 9:06 am

Reset anonymous user's email address to default?

Post by dncollins »

I want to return the email address for the anonymous user to its default value.

When first setting up my board, I inadvertently set the anonymous user's email address to one of my email addresses ... I do not remember what it was by default.

phpBB ACP will not allow me to blank the anonymous user email field. It wants a legitimate email address. Can/Should I use <nobody@[mydoman].com>. (I'm not sure what would happen if email is sent to a nonexistent personality in mydomain)

Since I've completely disabled all guest access to my board, I'm pretty sure it's unlikely that any activity by a non-logged in anonymous user would cause phpBB to emit an email message to the anonymous user email address. Still, I'd like to simply set the anonymous user's info back to its default setting so I don't have to depend on assumptions about how phpBB reacts to an anonymous user.
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Reset anonymous user's email address to default?

Post by stevemaury »

Code: Select all

UPDATE phpbb_users SET `user_email` = ' ' WHERE `username` = 'Anonymous';
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
dncollins
Registered User
Posts: 127
Joined: Sat Feb 14, 2009 9:06 am

Re: Reset anonymous user's email address to default?

Post by dncollins »

Thanks. That worked when I used 'guest' instead of 'Anonymous'

Quashing something like that manually is easy enough ... but I wouldn't do something like that without first consulting an expert like yourself (at least according to your sig). Without knowing the subtleties of the implementation, a fix that seems obvious and straightforward could be anything but.
dncollins
Registered User
Posts: 127
Joined: Sat Feb 14, 2009 9:06 am

Re: Reset anonymous user's email address to default?

Post by dncollins »

stevemaury wrote:

Code: Select all

UPDATE phpbb_users SET `user_email` = ' ' WHERE `username` = 'Anonymous';
Houston ... I think we still may have a problem ... after using above (except using 'guest' instead of 'Anonymous') the email address for the anonymous user was successfully blanked ... but ....

I tried to create a new user using <me>@<mydomain.com> ... same address that I had blanked out of the anonymous user ... and phpbb told me that it was already in use.

Subsequent search of all users using ACP revealed none that were using <me>@<mydomain.com> so I went for more power with phpMyadmin. A search of the entire DB for 'mydomain' yielded only two records in the phpbb_log in the log_data field. Only other thing I noticed was that the user_email_hash still has a non-zero value (as opposed to other records having user_email_hash=0 if email address is blank).

Seems like simply deleting the log records and/or zeroing the hash field would be benign things to do to try to fix the problem ... but I'd feel a whole lot better if someone with more experience in these things would pass judgement on that idea.
dncollins
Registered User
Posts: 127
Joined: Sat Feb 14, 2009 9:06 am

Re: Reset anonymous user's email address to default?

Post by dncollins »

Follow Up: full solution found

Deleting the log entries that referenced the email address I was trying to purge had no effect: attempts to assign the address continued to result in the "already in use" warning.

Setting the user_email_hash field to 0 worked: I am now able to assign the address to a different user.

The command that works (assuming the anonymous user's ID is guest:

Code: Select all

UPDATE phpbb_users SET `user_email` = ' ', `user_email_hash` = 0 WHERE `username` = 'guest';
My comment about making changes without being fully aware of the implementation stands.
Locked

Return to “[3.0.x] Support Forum”