captchasettings.py 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. from misago.utils.fixtures import load_settings_fixture, update_settings_fixture
  2. from misago.utils.translation import ugettext_lazy as _
  3. settings_fixture = (
  4. # Spam Countermeasures
  5. ('captcha', {
  6. 'name': _("Spam Countermeasures"),
  7. 'description': _("Those settings allow you to combat automatic registrations and spam messages on your forum."),
  8. 'settings': (
  9. ('bots_registration', {
  10. 'type': "string",
  11. 'input': "choice",
  12. 'extra': {'choices': [('', _("No protection")), ('recaptcha', _("reCaptcha")), ('qa', _("Question & Answer"))]},
  13. 'separator': _("Spambots Registrations"),
  14. 'name': _("CAPTCHA type"),
  15. 'description': _('CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". Its type of test developed on purpose of blocking automatic registrations.'),
  16. }),
  17. ('recaptcha_public', {
  18. 'type': "string",
  19. 'input': "text",
  20. 'separator': _("reCaptcha"),
  21. 'name': _("Public Key"),
  22. 'description': _("Enter public API key that you have received from reCaptcha."),
  23. }),
  24. ('recaptcha_private', {
  25. 'type': "string",
  26. 'input': "text",
  27. 'name': _("Private Key"),
  28. 'description': _("Enter private API key that you have received from reCaptcha."),
  29. }),
  30. ('recaptcha_ssl', {
  31. 'value': False,
  32. 'type': "boolean",
  33. 'input': "yesno",
  34. 'name': _("Use SSL in reCaptcha"),
  35. 'description': _("Do you want forum to use SSL when making requests to reCaptha servers?"),
  36. }),
  37. ('qa_test', {
  38. 'type': "string",
  39. 'input': "text",
  40. 'separator': _("Question and Answer Test"),
  41. 'name': _("Question"),
  42. 'description': _("Question visible to your users."),
  43. }),
  44. ('qa_test_help', {
  45. 'type': "string",
  46. 'input': "text",
  47. 'name': _("Help Message"),
  48. 'description': _("Optional help message displayed on form."),
  49. }),
  50. ('qa_test_answers', {
  51. 'type': "string",
  52. 'input': "textarea",
  53. 'name': _("Answers"),
  54. 'description': _("Enter allowed answers to this question, each in new line. Test is case-insensitive."),
  55. }),
  56. ),
  57. }),
  58. )
  59. def load():
  60. load_settings_fixture(settings_fixture)
  61. def update():
  62. update_settings_fixture(settings_fixture)