MyBB Community Forums

Full Version: Activate awaiting validation users to members
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I have a group of people who have yet to validate their email(Users Awaiting Validation), however, I want to activate them to Members, can it be done ?

I know I can activate them by AdminCP, but theres 100 of them...can it be done by MySQL query instead?
upload this the root of the board, and execute it.

regards
Most of the time that will work, but maybe sometimes the 'oldgroup' is not the registered usergroup.

Modified the code:
<?php

require "./global.php";

$query = $db->query("
	SELECT u.uid, u.usergroup, a.oldgroup
	FROM ".TABLE_PREFIX."users u 
		LEFT JOIN ".TABLE_PREFIX."awaitingactivation a ON (u.uid=a.uid)
	WHERE u.usergroup='5'");
while($ex = $db->fetch_array($query))
{
	if(!$ex['oldgroup'])
	{
		$ex['oldgroup'] = 2;
	}
	$del = $db->query("UPDATE ".TABLE_PREFIX."users SET usergroup ='".$ex['oldgroup']."' WHERE uid='".$ex['uid']."'");
	$clean_ac = $db->query("DELETE FROM ".TABLE_PREFIX."awaitingactivation WHERE uid='".$ex['uid']."'");
}
if($del && $clean_ac)
{
	echo "<h1>DONE!</h1>";
}
else
{
	echo "<h1>A problem occurred</h1>";
}
?>

It would be nice in the admincp there was "bulk" selections.