The current Captcha class has a lot of responsibilities. It renders the captcha
image, can check if a certain captcha type is a Google captcha, if a captcha is
required for a certain email. The SubscriberSubscribeController is not only in
charge of "controlling" the subscription process but also validates, whether a
captcha is correct or not. This architecture made it difficult to extend the
functionality and introduce the audio captcha feature.
Therefore this commit refactors the captcha architecture and tries to seperate
the different concerns into several classes and objects. Validation is now done
by validators.
The CaptchaPhrase now is in charge of keeping the captcha phrase consistent
between the image and the new audio, so that you can renew the captcha and both
captchas are in sync.
[MAILPOET-4514]
This commit fixes the logic of the code that enables third party
libraries by default. It was meant to enable those libraries only for
existing installs when the code was introduced in cfae753601
to avoid breaking functionality. But due to a bug, it was also enabling
those libraries for new installs.
To fix this issue, this commit moves the code to the Migrator class and
makes sure it is only executed for existing installs and only once when
doing a version update.
[MAILPOET-4285]