Форуми / Cotonti / Support / How to mass delete Banned members ?

ez
#1 01.12.2011 19:58

How can I remove all banned members in 1 click... Genoa

 

thnx,

ez

==- I say: Keep it EZ -==
tensh
#2 01.12.2011 20:11

I would say: go to phpmyadmin and execute a single sql query... There's no such way unless it's a self-made plugin.

ez
#3 01.12.2011 21:27

There might be linked data in other tables ???????

Sure i can go to phpMyAdmin and do that....

There is more stuff... avatar, photo... etc...  (So it isnt THAT simple)

==- I say: Keep it EZ -==

Відредаговано: ez (01.12.2011 21:35, 12 років тому)
tensh
#4 02.12.2011 07:50

I see what you mean :)

Then the plugin would be okay. There was the usermanager plugin somewhere available, it had a couple of bugs but it would be a good base to start.

pieter
#5 02.12.2011 11:39

If you delete banned users, the users can make the same user and same IP.

Better is not to display that user anymore in the lists, except when you are an admin.

... can we help you ...
Trustmaster
#6 02.12.2011 16:44

Here is the code from system/core/users/users.edit.inc.php:

$sql = sed_sql_query("SELECT * FROM $db_users WHERE user_id='$id'");

			if ($row = sed_sql_fetchassoc($sql))
			{
				if ($cfg['trash_user'])
				{ sed_trash_put('user', $L['User']." #".$id." ".$row['user_name'], $id, $row); }
				$sql = sed_sql_query("DELETE FROM $db_users WHERE user_id='$id'");
				$sql = sed_sql_query("DELETE FROM $db_groups_users WHERE gru_userid='$id'");
				if ($ruserdelpfs) { sed_pfs_deleteall($id); }
				sed_log("Deleted user #".$id,'adm');
				header("Location: " . SED_ABSOLUTE_URL . sed_url('message', "msg=109&rc=200&id=".$id, '', true));
				exit;
			}

What you need to change in your plugin is the main select query. Something like this:

SELECT * FROM $db_users AS u LEFT JOIN $db_users_groups AS g ON g.gru_userid = u.user_id WHERE g.gru_groupid = 3

And of course changed if to while and remove sed_log/header/exit lines from the loop.

May the Source be with you!
Kaan
#7 02.12.2011 22:13

Mass Delete User: DELETE FROM sed_users WHERE `user_maingrp`='3';