MyBB Community Forums

Full Version: Upgrade to 1.8.10 - admin email activation stopped working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there

I have just upgraded to 1.8.10.

My normal SMTP emails continue to be sent from the Admin gmail account.

However under the new module 'Awaiting Activation' when a user is activated by the administrator, they no longer receive an Admin activation notification email.

This looks like a bug in the latest release.

regards

BB
Is this an email that's sent by a plugin? I don't believe an email is sent to users when they're activated by default.
(2017-02-04, 02:48 PM)Matt Wrote: [ -> ]Is this an email that's sent by a plugin? I don't believe an email is sent to users when they're activated by default.

Thanks for the reply Matt

No. This is definitely a standard part of 1.8.x You are right there was a plug-in that did do this in 1.6.

Unfortunately I have had to restore the user modules from the previous version and make a custom admin view for users awaiting authorisation as a work-around. Not ideal but can't really wait for a fix.

The old code for 1.8.7 works fine and our site has been sending admin activation emails for a while now...
Forgive me, I can see that it does now. It seems like the code for the email physically doesn't exist in the new section.

I will log this as a bug, however for the time being, we should be able to use the same code as the old file. If you can revert back to the 1.8.10 version of the users module, and then apply these changes to the new awaiting activation section...

In ./admin/modules/user/awaiting_activation.php, line 72:

$query = $db->simple_select("users", "uid, usergroup, coppauser", "uid IN ({$user_ids})");

change this to:

$query = $db->simple_select("users", "uid, username, email, usergroup, coppauser", "uid IN ({$user_ids})");

Then, line 93:

$db->update_query("users", $updated_user, "uid='{$user['uid']}'");

After this, add:

$message = $lang->sprintf($lang->email_adminactivateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl']);
my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);

Lastly, in ./inc/languages/english/admin/user_awaiting_activation.lang.php, at the end of the file, add this:

$l['emailsubject_activateaccount'] = "Account Activation at {1}";
$l['email_adminactivateaccount'] = "{1},

The administrator has activated your forum account on {2}.

To proceed, please go to

{3}

You will be able to login with the credentials you registered with.

Thank you,
{2} Staff";

This is just moving the existing language strings into the awaiting activation section language file.

This should then restore the original functionality.
Hi Matt, Have applied all these changes and the admin activation emails are now working under 1.8.10.

Many thanks! Not even asking how you know this code so well. Genius. Big Grin

C
Several years of looking at it Big Grin Glad it works again though Smile
Me, after these changes I get an Error 500 from ?module=user-awaiting_activation. Hmm.
Might be due to a syntax error, make sure the changes have been applied correctly. If not, I'll be patching this officially soon so you can use that new file when I've fixed the bug.