I found a good way to get the user list out of mongodb. In case anyone need it:
async function doMongoDb() { const { MongoClient } = require("mongodb"); const username = encodeURIComponent("admin"); const password = encodeURIComponent("mypassword"); const clusterUrl = "localhost:27017"; const authMechanism = "DEFAULT"; const uri = `mongodb://${username}:${password}@${clusterUrl}/?authMechanism=${authMechanism}`; const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true }); try { await client.connect(); const database = client.db("nodebb"); const objects = database.collection("objects"); // get all user const query = { _key: /^user:\d+$/ }; // select fields we want to see const options = { projection: { _id: 0, username: true, _id: false, email: true, "email:confirmed": true, joindate: true, fullname: true }, }; const cursor = objects.find(query, options); if ((await cursor.count()) === 0) { console.log("No user found!"); } // iterate over the users await cursor.forEach(user => { if (user["email:confirmed"] == 1 ) { console.dir(user); } }); } finally { // make sure we close the connection await client.close(); } } // --------------------------------------------------- function init() { try { doMongoDb(); } catch(e) { console.log(e); } } // --------------------------------------------------- init();how to made a user moderator
-
i just want to let a user get moderator access without using privilege thresholds ....is this function available
-
Global moderator functionality? Not yet, but that's an idea we may be implementing soon.
-
just category moderator
-
Meanwhile, how about making it possible for the admin to assign reputation points to a user, that is, a fast-track way to attain moderator status.
-
@sunqi said:
just category moderator
yup, implemented on a per-user basis (but not for groups yet)
Head over the Category ACP, find the category you want and click on "Options -> Access Control" and you should have an interface similar to this:
-
That would be great
-
@psychobunny said:
@sunqi said:
just category moderator
yup, implemented on a per-user basis (but not for groups yet)
Head over the Category ACP, find the category you want and click on "Options -> Access Control" and you should have an interface similar to this:
When should we expect this to be applied to groups?