MyBB Community Forums
Activate awaiting validation users to members - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.2 Series (https://community.mybb.com/forum-3.html)
+------ Forum: MyBB 1.2 General Support (https://community.mybb.com/forum-4.html)
+------ Thread: Activate awaiting validation users to members (/thread-9722.html)



Activate awaiting validation users to members - xiaozhu - 2006-06-14

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?


RE: Activate awaiting validation users to members - zaher1988 - 2006-06-14

upload this the root of the board, and execute it.

regards


RE: Activate awaiting validation users to members - Dennis Tsang - 2006-06-14

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>";
}
?>




RE: Activate awaiting validation users to members - labrocca - 2006-06-14

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