Skip to content

Rework Custom plugins

Maxime Besson requested to merge fix-custom-2675 into v2.0

See #2675 (closed), #2676 (closed), #2677 (closed), #2678 (closed)

The first commit gets rid of the getDisplayType overloading, which was only used in the context of Choice. We now delegate getDisplayType entirely to the loaded plugin, which is probably saner.

Auth, UserDB, Password, Register and CertificateResetByEmail all do the same thing: load a custom module from a conf parameter and delegate everything to it. And yet their code was different. So I created a new class (Lib::CustomModule) to handle the common stuff and make the rest of the modules trivial.

The only change of behavior, in addition to fixing bugs, should be that $portal->loadedPlugins now only contains ::Auth::Custom and no longer the actual module. But I don't think this is a problem. The actual module instance can be reached with $portal->_authentication.

Please review and test with your use cases if you have one.

Merge request reports