Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodebb-plugin-assign-newuser-to-group

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodebb-plugin-assign-newuser-to-group - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

45

library.js

@@ -1,10 +0,9 @@

var fs = require('fs'),
groups = module.parent.require('./groups'),
winston = module.parent.require('winston'),
Meta = module.parent.require('./meta'),
const winston = require.main.require('winston');
const groups = require.main.require('./src/groups');
const Meta = require.main.require('./src/meta');
AssignNewUser = {},
userGroup = null;
const AssignNewUser = module.exports;
let userGroup = null;
AssignNewUser.init = function(params, callback) {
AssignNewUser.init = async function(params) {
function render(req, res, next) {

@@ -14,19 +13,16 @@ res.render('admin/plugins/assign-newuser-to-group', {});

Meta.settings.get('assign-newuser-to-group', function(err, settings) {
if (!err && settings && settings.userGroup) {
userGroup = settings.userGroup;
} else {
winston.error('[plugins/assign-newuser-to-group] User group not set!');
}
});
const settings = await Meta.settings.get('assign-newuser-to-group');
if (settings && settings.userGroup) {
userGroup = settings.userGroup;
} else {
winston.error('[plugins/assign-newuser-to-group] User group not set!');
}
params.router.get('/admin/plugins/assign-newuser-to-group', params.middleware.admin.buildHeader, render);
params.router.get('/api/admin/plugins/assign-newuser-to-group', render);
callback();
};
AssignNewUser.assignUserToGroup = function(userData) {
if (userGroup != null) {
groups.join(userGroup, userData.uid);
AssignNewUser.assignUserToGroup = async function (hookData) {
if (userGroup != null && hookData && hookData.user) {
await groups.join(userGroup, hookData.user.uid);
}

@@ -36,4 +32,4 @@ };

AssignNewUser.admin = {
menu: function(custom_header, callback) {
custom_header.plugins.push({
menu: async function(header) {
header.plugins.push({
"route": '/plugins/assign-newuser-to-group',

@@ -43,7 +39,4 @@ "icon": 'fa-check',

});
callback(null, custom_header);
return header;
}
};
module.exports = AssignNewUser;
{
"name": "nodebb-plugin-assign-newuser-to-group",
"version": "0.0.2",
"version": "0.0.3",
"description": "A plugin for NodeBB to assign new users to a specified group.",

@@ -25,4 +25,4 @@ "main": "library.js",

"nbbpm": {
"compatibility": "^0.7.0 || ^1.0.0"
"compatibility": "^1.16.0"
}
}

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ # NodeBB assign new user to group

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc