You can't get the current user data without their uid. If you have access to the express req object you can grab it with req.uid or if it is a socket call then its socket.uid. The value of uid is 0 if the user is not logged in.
User problem after a database restore
-
Over the weekend we had 300 or so bots register on the forum. I deleted them yesterday. After that, i tried to do an update to the latest RC as i wanted to use the latest features on the spam plugin. The update caused some redirect loops and NodeBB would not work.
I restored to a back up i created just be fore the update but then i found out that some of the threads had posts missing and in the incorrect order.
I restored the database, the version of the database had the 300 or so bots on it that I had previously delete.
Clicking on the users menu it showed all the normal user and all the bots which it should do as that was the database that i used. The forum stats widget only showed 40.
Clicking on a bot that I had deleted before the restore would produce a 404 page.
In the admin cp I could delete the bot users with no issue.I removed all the bots but now the forum stats widget is showing -228 users.
Is there any way i can reset the stats to be the correct number?
Suggested Topics
-
-
Hook: user is online
Unsolved Plugin Development
-
-
-