accountssetings.py 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. # Register and Sign-In Settings
  5. ('accounts', {
  6. 'name': _("Users Accounts Settings"),
  7. 'description': _("Those settings allow you to increase security of your members accounts."),
  8. 'settings': (
  9. ('account_activation', {
  10. 'value': "none",
  11. 'type': "string",
  12. 'input': "choice",
  13. 'extra': {'choices': [('none', _("No validation required")), ('user', _("Activation Token sent to User")), ('admin', _("Activation by Administrator")), ('block', _("Dont allow new registrations"))]},
  14. 'separator': _("Users Registrations"),
  15. 'name': _("New accounts validation"),
  16. }),
  17. ('default_timezone', {
  18. 'value': "utc",
  19. 'type': "string",
  20. 'input': "select",
  21. 'extra': {'choices': '#TZ#'},
  22. 'name': _("Default Timezone"),
  23. 'description': _("Used by guests, crawlers and newly registered users."),
  24. }),
  25. ('username_length_min', {
  26. 'value': 3,
  27. 'type': "integer",
  28. 'input': "text",
  29. 'extra': {'min': 3},
  30. 'separator': _("Users Names"),
  31. 'name': _("Minimum allowed username length"),
  32. }),
  33. ('username_length_max', {
  34. 'value': 16,
  35. 'type': "integer",
  36. 'input': "text",
  37. 'extra': {'min': 3},
  38. 'name': _("Maxim allowed username length"),
  39. }),
  40. ('password_length', {
  41. 'value': 4,
  42. 'type': "integer",
  43. 'input': "text",
  44. 'extra': {'min': 1},
  45. 'separator': _("Users Passwords"),
  46. 'name': _("Minimum user password length"),
  47. }),
  48. ('password_complexity', {
  49. 'value': [],
  50. 'type': "array",
  51. 'input': "mlist",
  52. 'extra': {'choices': [('case', _("Require mixed Case")), ('digits', _("Require digits")), ('special', _("Require special characters"))]},
  53. 'name': _("Password Complexity"),
  54. }),
  55. ('password_lifetime', {
  56. 'value': 0,
  57. 'type': "integer",
  58. 'input': "text",
  59. 'extra': {'min': 0},
  60. 'name': _("Password Lifetime"),
  61. 'description': _("Enter number of days since password was set to force member to change it with new one, or 0 to dont force your members to change their passwords."),
  62. }),
  63. ('password_in_email', {
  64. 'value': False,
  65. 'type': "boolean",
  66. 'input': "yesno",
  67. 'name': _("Include User Password in Welcoming E-mail"),
  68. 'description': _("If you want to, Misago can include new user password in welcoming e-mail that is sent to new users after successful account creation."),
  69. }),
  70. ('subscribe_start', {
  71. 'value': 2,
  72. 'type': "integer",
  73. 'input': "select",
  74. 'extra': {'choices': ((0, _("Don't watch")),
  75. (1, _("Put on watched threads list")),
  76. (2, _("Put on watched threads list and e-mail user when somebody replies")),
  77. )},
  78. 'separator': _("Default Watching Preferences"),
  79. 'name': _("Watch threads user started"),
  80. }),
  81. ('subscribe_reply', {
  82. 'value': 2,
  83. 'type': "integer",
  84. 'input': "select",
  85. 'extra': {'choices': ((0, _("Don't watch")),
  86. (1, _("Put on watched threads list")),
  87. (2, _("Put on watched threads list and e-mail user when somebody replies")),
  88. )},
  89. 'name': _("Watch threads user replied in"),
  90. }),
  91. ('profiles_per_list', {
  92. 'value': 24,
  93. 'type': "integer",
  94. 'input': "string",
  95. 'extra': {'min': 1, 'max': 128},
  96. 'separator': _("Users List"),
  97. 'name': _("Number of Profiles Per Page"),
  98. }),
  99. ),
  100. }),
  101. )
  102. def load():
  103. load_settings_fixture(settings_fixture)
  104. def update():
  105. update_settings_fixture(settings_fixture)