Author Topic: Different plugins per User  (Read 123 times)

Offline malenkin

  • Newbie
  • *
  • Posts: 3
Different plugins per User
« on: May 23, 2020, 01:42:05 PM »
Hi,

  I've tried ude_login and user_config but seems aren't working for 1.4.X release, is there any other plugin or native way to do it? I need to activate some plugins for only some users

Thanks


Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,438
Re: Different plugins per User
« Reply #1 on: May 24, 2020, 04:35:44 AM »
what error(s) do the plugins give? I've never used either of them but they both look quite simple.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline malenkin

  • Newbie
  • *
  • Posts: 3
Re: Different plugins per User
« Reply #2 on: May 24, 2020, 08:46:05 AM »
Hi,
 
  No error, just does not work at all.

  ude_login.php

            // load (remaining) user-specific plugins
            foreach (array_unique($user_plugins) as $plugin) {
                error_log("Loading plugin =>  $plugin", 0);  // <-- mine, it arrives here
                $rcmail->plugins->load_plugin($plugin);
            }


users.txt

malenkin   enable_plugins=password


errors.log

[24-May-2020 14:41:30 Europe/Rome] Loading plugin =>  password

But password, or any other plugin does not load. Password works if I declare it in config['plugins']

Thanks for your help.






Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,438
Re: Different plugins per User
« Reply #3 on: May 24, 2020, 10:00:15 AM »
strange i tried it myself and there is nothing in the rc error log either. the plugin does appear to be dead (5 years since last commit) and I don't want to spend time debugging other people's plugins so I guess you'll need to find a different solution. may be make a plugin if your own.

Tip: I don't think `$rcmail->plugins->load_plugin($plugin);` is the right way to load a plugin from inside another plugin, use `$this->require_plugin($plugin);` instead.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline malenkin

  • Newbie
  • *
  • Posts: 3
Re: Different plugins per User
« Reply #4 on: May 24, 2020, 10:16:44 AM »
my godness, it do the trick!.

Many thanks for your help and work for community.