Getting rid of guest users
-
up
-
Up. Need help. Anyone? @3rd-Party-Developers @administrators
-
@baris said in Getting rid of guest users:
You will have to manually remove them from the db, depending on mongo or redis the commands are different. The sorted set keys you need to remove from are here https://github.com/NodeBB/NodeBB/blob/master/src/user/delete.js#L68-L101
thank you
i have mongo but totally noob on commands -
problem is i cant find that null values on mongodb
by downloading CSV of my users i get this lines -
Yeah csv download won't be useful, you will have to use mongo cli and check the contents of the
username:sorted
sorted set.For example
db.objects.find({_key:"username:sorted", value: {$regex: /tini/}});
This will show you all users containing the phrase
tini
in the format<username>:<uid>
that way you can find that user's uid and username.After that you have to remove them from all the sorted sets I linked to earlier. The remove command for uid is
db.objects.remove({_key: "users:joindate", value: "<their_uid>"});
And to remove them from
username:sorted
use.db.objects.remove({_key: "username:sorted", value: "<username>:<uid>"});
-
@baris said in Getting rid of guest users:
db.objects.find({_key:"username:sorted", value: {$regex: /tini/}});
all right
i checked db username:sorted looking for that user "tini" and found 2 entries
was not present on any object like joindate etc, (it was old user from the website that was deleted, maybe it was removed from all db but the username:sorted set) so i just removed that 2 entries from username:sorted, no issues.however, restarted nodebb and that 2 entries from global guest still present on the csv with that id=0 that i think it breaks some plugins eventually
now i did this
my question is, should i delete that? is that core user for guest posting or just a problem on my db?
-
@baris said in Getting rid of guest users:
You can safely delete
Guest:0
from that sorted set. It shouldn't be in there at all.thank you
deleted and restarted nodebb
no changes on csv download getting still that 2 null entries -
@baris said in Getting rid of guest users:
the csv uses the
username:uid
sorted set, did you remove uid 0 from that as well?no, there is no results with id 0 at all
-
solved, the removed users were still present on username:uid
the id 0 and global guest comes from trying to search non existant users on user:uid