-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Currently, we do not have all information in the database needed for preset addressbook in common operations. Since presets are only processed during login, it is possible that, when the admin removes a preset, an addressbook of an already logged in user belonging to that preset will still be loaded and we cannot access the preset configuration anymore. So far, we are using default values in that situation.
With the introduction of the flags column for addressbooks, we have quite a few bits we can use to store simple information, and the readonly setting is stored as such a flag. This leaves the require_always config option. It is currently possible to use this option for any DB column, which apart from email includes the various name columns. While we could use a bit for each of these, I cannot see the use case for any require always value other than email, which can be used for large company addressbooks that may include lots of contacts without email addresses and thus limited use in roundcube. Why one would want to filter out contacts that have a first name, or last name, etc. set, I cannot see.
So to simplify, for v5 replace the require_always feature with a simpler require_always_email feature that does the same as a previous 'require_always' => ['email']
setting. Require always on the other fields will no longer be possible. We could re-add it later if it turns out it is actually a useful feature.
Having done this, only the main plugin class (for setting the special addressbooks, log levels, etc.) and the UI (for evaluating fixed settings of presets) would depend on the AdminSettings class, which clears up the dependencies and particularly the circular dependency AddressbookManager <> AdminSettings.