DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:autogroup

AutoGroup Plugin

Compatible with DokuWiki

Greebo

plugin Provides a way to automatically group users based on account values

Last updated on
2018-08-06
Provides
Action
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to virtualgroup

Tagged with groups

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Configuration

After installing, the automatic grouping can be configured exclusively in the Configuration page in the Admin Menu.

There are three settings:

  1. The first turns on the addition of users to groups when they amtch the grouping rules.
  2. The second turns on the removal of users when they do not match the rules.
  3. The last is a list if group matching rules, with one rule per line.

This plugin uses the wiki's assigned authentication module. It is shown to work on the default auththenication module, and should support any module where the users can be listed AND the groups modified.

Rule Syntax

<group name>,<account value>,<PCRE regular expression>
  • The group name is the name of the group you would like to alter the membership of.
  • The account value is either login for the username, name for the wiki visible name, or mail for the email address.
  • The PCRE is a Perl Regular Expression that is supplied to the PHP preg_match function to test the account value associated with the user. Common formats are /expression/ for case sensitive matches and /expression/i for case insensitive matches. Please refer to PHP PCRE documentation for further information.

There can be more than one rule per group. In that case, a user is included in the group if any rule matches and removed if all rules fail.

Examples/Usage

Find any username containing mike and add them to the mikes group:

mikes,login,/mike/

The above rule with a case insensitive search:

mikes,login,/mike/i

Add all users with a Gmail email address to the Gmail group:

Gmail,mail,/@gmail.com$/i

Add the user to the Dirty group if their username contains dishes (case insensitive), their given name contains the word Harry (case sensitive), or their email ends in @dirty.com (case insensitive):

Dirty,login,/dishes/i
Dirty,name,/\bHarry\b/
Dirty,mail,/@dirty.com$/i

Testing Rules

The recommended method to test is to use an online PCRE testing tool and test your scenarios out there. One such site is Regular Expressions 101.

This plugin also supports the Dokuwiki debug framework. If you enable the allow debug setting in the wiki's configuration, then this module will display the groups a user is assigned to or removed from. Please note that the debug option is not meant to be left on, so disable it when you are done testing.

Change Log

Known Bugs and Issues

  • This plugin does not allow for rules to remove users on match, only to add on match and remove with no match. For now, rewite the rules to not match the users that should be removed.

ToDo/Wish List

There are no plans at this time for any new features. If you have a feature request, then please file it as an issue at GitHub by clicking on the “Submit Bug” button at the top of this page.

plugin/autogroup.txt · Last modified: 2020-01-25 21:20 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki