[nodebb-plugin-stockparser] First plugin; how do I add an editable field?

NodeBB Plugins

Suggested Topics


  • 0 Votes
    20 Posts
    542 Views

    Hi,

    i have a little Change, that will also leave User when NOT in ldap group:

    groupJoin: (ldapGroup, ldapId, uid, callback) => { winston.verbose("[LDAP] groupJoin " + ldapGroup.cn + " for user " + ldapId + " uid " + uid) nodebb_ldap.createGroup(ldapGroup, (err, groupId) => { if (err) { return callback(err); } let members = ldapGroup.uniqueMember; if (!Array.isArray(members)) { members = [members]; } winston.verbose("[LDAP] groupJoin members " + members && typeof members) let found = false if (members) { members.forEach(member => { if (member && member.indexOf(ldapId) != -1) { found = true } }); } if (found) { const groupsToJoin = [groupId]; if ((master_config.admin_groups || '').split(',').includes(ldapGroup.cn)) { winston.verbose("[LDAP] joins admin group") groupsToJoin.push('administrators'); } if ((master_config.moderator_groups || '').split(',').includes(ldapGroup.cn)) { groupsToJoin.push('Global Moderators'); } return groups.join(groupsToJoin, uid, callback); } else { const groupsToUnJoin = [groupId]; winston.verbose("[LDAP] unjoins group" + ldapGroup.cn + " uid " + uid); return groups.leave(groupsToUnJoin, uid, callback); //callback(); } } ); },

    thats realy cool for use 🙂 maybe someone else will help it 🙂

  • 3 Votes
    1 Posts
    144 Views

    GitHub - NodeBB/nodebb-plugin-debug-hook: A plugin to see parameters passed to hooks in real time

    A plugin to see parameters passed to hooks in real time - GitHub - NodeBB/nodebb-plugin-debug-hook: A plugin to see parameters passed to hooks in real time

    favicon

    GitHub (github.com)

    Sometimes you need to see the result of some filter/action on a live/prod instance and it is not easy to add a console.log and restart.

    This plugin allows you to select a plugin hook and see the resulting data after all plugins are done executing their hooks.

    Here is a sample from running it against filter:search.query

    d0347032-02ff-4dcc-83a8-8bc039b4b297-image.png

    The output is updated automatically every time you trigger the hook.

  • 0 Votes
    9 Posts
    3k Views

    Thank you for your quick reply! It was extremely helpful.

    I have added the 1-line fix to map your from_name field to SendGrid's API. I submitted a PR to the nodebb-plugin-emailer-sendgrid GitHub repo, so that hopefully others can benefit too. This is the first time I have submitted a PR to an open source project, so I hope I did the procedure correctly. 🙂

    The 1-line fix works on our installation, and I am now receiving emails which have a proper From name!

  • 0 Votes
    20 Posts
    5k Views

    Provide more details please.

  • Plugin to rate users

    NodeBB Plugins
    0 Votes
    7 Posts
    3k Views

    up, this will be nice feature for the market section of the boards