Forcing UID value
-
@baris my problem problem is :
how i can call db.sortedSetAdd('auid:uid', uid, auid, callback); on action:user.create ? i don't have uid until user is already created.
@baris said in Forcing UID value:
You need to load the value from the user hash and call db.sortedSetAdd('auid:uid', uid, auid, callback);
i mean some command to do it using redis-cli
-
Hooks won't let you fix existing users, you need to write custom script to run through all the users and fix the association.
You can use this template
/*globals require, console, process */ 'use strict'; var nconf = require('nconf'); var async = require('async'); nconf.file({ file: 'config.json' }); nconf.defaults({ base_dir: __dirname, views_dir: './build/public/templates', }); var db = require('./src/database'); db.init(function(err) { if (err) { console.log("NodeBB could not connect to your database. Error: " + err.message); process.exit(); } fixAssociation(function (err) { if (err) { console.error(err); process.exit(); } console.log('done'); process.exit(); }); }); function fixAssociation(callback) { // implement code }
-
@baris thanks.
I've just 2 new problems :
-
https://github.com/SimosNap/nodebb-plugin-login-anope/blob/master/library.js#L116
it look it can't change email what's wrong ? -
on IRC nicknames can also contain same special chars for example "nick`out" , i've seen that if an user switch to one of this nickname, i've seen that nodebb preserve the old username, any suggestion for this ?
-
-
@Simos said in Forcing UID value:
https://github.com/SimosNap/nodebb-plugin-login-anope/blob/master/library.js#L116
it look it can't change email what's wrong ?Does nodebb make some check on invalid emails ?