accountssetings.py 5.1 KB

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