I had a user sign onto our system and post a viagra ad on their profile. I was able to delete the user account but not the profile, help?
If you delete malicious user profile from Administration menu the user is only marked deleted but all data is in database and user folders.
Set first from Administration -> Security -> Site policies
Force users to login for profiles
and if you have phpmyadmin or some other tool to use mysql find table mdl_user and from that table row with id 72
This person or bot has probably not done anything else - only saved the profile so you can delete that row with id 72 with
or use a command like
DELETE FROM `mdl_user` WHERE `id` = 72
I have had several of these bogus accounts created with spam profiles. I have changed my admin setting to force users to login for profiles now, but I would like all those spam profiles to be deleted. Some of these are coming up when searching for our site. Now, they are directed to a page that says you have to be logged in, but I would reather the profile just be completely removed.
What would you recommend? I am guessing we had about 100 of these profiles created.
select * from mdl_user where description like '%img%*
I suspect all your bogus accounts will show up.
You should then be able to do a
delete from mdl_user where description like '%img%'
(Be careful with that command as deleting from user can be a dangerous exercise, perhaps take a backup first)
I got so fed up with descriptions offering horse porn (?????) I resized the description field to two characters. It does mean nobody can have a meaningful description but at least I get to amuse myself by the failed attempts at creating profiles with spammy descriptions
SET username='timestamp' || email, email='', password='xxx', firstname='xxx', lastname='xxx', description = '', deleted = 1
WHERE description LIKE '%horse porn%'
OR description LIKE '%etc%';
This makes it highly likely that the account will be of any use to the spammer without deleting any rows.
This makes it highly UN-likely that the account will be of any use to the spammer ...
Please see Reducing spam in Moodle for advice on preventing/reducing the chance of spammers creating an account on your site.