PageRenderTime 25ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/templates/default/macros/ldap.html

https://bitbucket.org/sqbell/iredadmin-ose
HTML | 133 lines | 124 code | 9 blank | 0 comment | 0 complexity | e082846a19c81eddb0bfc1ffe0aacdb5 MD5 | raw file
Possible License(s): GPL-2.0
  1. {% macro display_all_domains(managedDomains=[], allDomains=[]) -%}
  2. <div class="columns clear">
  3. <div class="col2-3">
  4. <div class="form-field clear">
  5. <h4 class="size-250 fl-space">{{ _('Managed Domains') }}</h4>
  6. <div class="checklist clear">
  7. <fieldset>
  8. {% for domain in allDomains %}
  9. {% set domainName = domain[1].get('domainName')[0] %}
  10. <div class="checklist-item">
  11. <span class="fl-space">
  12. <input type="checkbox" name="domainName" value="{{ domainName |e }}" {% if domainName in managedDomains %}checked{%endif%} />
  13. </span>
  14. <label>
  15. {% if domain[1].has_key('cn') %}
  16. {{ _("%s (%s)") |format(domainName |e, domain[1].get('cn')[0].decode('utf-8') |e) }}
  17. {% else %}
  18. {{ domainName |e }}
  19. {% endif %}
  20. </label>
  21. </div>
  22. <div class="clear"></div>
  23. {% endfor %}
  24. </fieldset>
  25. </div>
  26. </div>
  27. </div>{#-- .col2-3 --#}
  28. <div class="col1-3 lastcol">
  29. <div class="mark_blue bt-space10">
  30. <ul class="standard clean-padding bt-space10">
  31. <li class="bt-space5"><a href="{{ctx.homepath}}/create/domain" class="action_add">{{ _('Add domain') }}</a></li>
  32. </ul>
  33. </div>
  34. </div>
  35. </div>{#-- .columns --#}
  36. {%- endmacro %}
  37. {% macro display_all_admins(domainAdmins=[], allAdmins=[]) -%}
  38. <div class="form-field clear">
  39. <h4 class="size-250 fl-space">{{ _('Domain Admins') }}</h4>
  40. <div class="checklist clear">
  41. <fieldset>
  42. {% for (dn, entry) in allAdmins %}
  43. {% set mail = entry.get('mail')[0] |e %}
  44. <div class="checklist-item">
  45. <span class="fl-space"><input type="checkbox" name="domainAdmin" value="{{ mail }}" {% if mail in domainAdmins %}checked{%endif%} class="checkbox" rel="checkboxhorizont" /></span>
  46. <label>
  47. {{ entry.get('cn')[0].decode('utf-8') }} (<a href="{{ctx.homepath}}/profile/admin/general/{{ mail }}" target="_blank">{{ mail }}</a>{% if 'yes' in entry.get('domainGlobalAdmin', []) %}, {{ _('Global Admin') }}{% endif %})
  48. </label>
  49. </div>
  50. <div class="clear"></div>
  51. {% endfor %}
  52. </fieldset>
  53. </div>
  54. </div>
  55. {%- endmacro %}
  56. {#
  57. Display enabledService
  58. - accountType: domain, admin, user, maillist, alias.
  59. - enabledService: list of all enabled services.
  60. #}
  61. {% macro display_enabled_services(accountType, enabledService, greylisted=false) -%}
  62. {# Set list of available services for different account types.
  63. Format:
  64. [
  65. ('type_of_input', 'value_of_enabledService', 'label'),
  66. ...
  67. ]
  68. @type_of_input: value of attribute "type" in HTML <input> tag.
  69. Available: hidden, checkbox.
  70. Note: This is an OPTIONAL.
  71. #}
  72. {% if accountType == 'domain' %}
  73. {% set available_services = [
  74. ('checkbox', 'domainalias', _('Domain alias')),
  75. ('checkbox', 'recipientbcc', _('BCC incoming mails to other address')),
  76. ('checkbox', 'senderbcc', _('BCC outgoing mails to other address')),
  77. ] %}
  78. {% elif accountType == 'user' %}
  79. {% set available_services = [
  80. ('hidden', 'internal', ''),
  81. ('checkbox', 'smtp', _('Sending mails via SMTP')),
  82. ('checkbox', 'smtpsecured', _('Sending mails via SMTP over TLS/SSL')),
  83. ('checkbox', 'pop3', _('Fetching mails via POP3')),
  84. ('checkbox', 'pop3secured', _('Fetching mails via POP3 over TLS/SSL')),
  85. ('checkbox', 'imap', _('Fetching mails via IMAP')),
  86. ('checkbox', 'imapsecured', _('Fetching mails via IMAP over TLS/SSL')),
  87. ('checkbox', 'deliver', _('Receiving mails for this account on mail server')),
  88. ('checkbox', 'forward', _('Forwarding mails to other addresses')),
  89. ('checkbox', 'shadowaddress', _('Alias account')),
  90. ('checkbox', 'managesieve', _('Customize mail filter rule')),
  91. ('checkbox', 'managesievesecured', _('Customize mail filter rule over TLS/SSL')),
  92. ('checkbox', 'recipientbcc', _('BCC incoming mails to other address')),
  93. ('checkbox', 'senderbcc', _('BCC outgoing mails to other address')),
  94. ('checkbox', 'displayedInGlobalAddressBook', _('Display mail address in global LDAP address book')),
  95. ] %}
  96. {% elif accountType == 'alias' %}
  97. {% set available_services = [
  98. ('checkbox', 'displayedInGlobalAddressBook', _('Display mail address in global LDAP address book')),
  99. ] %}
  100. {% endif %}
  101. <h4 class="size-250 fl-space">{{ _('Enabled Services') }}</h4>
  102. <div class="form-checkbox-item clear">
  103. <input type="checkbox" name="enabledService" value="mail" {% if 'mail' in enabledService %}checked{%endif%} class="checkbox fl-space" rel="checkboxhorizont" />
  104. <label>{{ _('Mail service') }} <span class="grey"><em>({{ _('Check this box in order to enable other services') }})</em></span></label>
  105. </div>
  106. {% if accountType in ['domain', 'user', ] %}
  107. {% if session.get('enablePolicyd') is sameas true %}
  108. <h4 class="size-250 fl-space">&nbsp;</h4>
  109. <div class="form-checkbox-item clear">
  110. <input type="checkbox" name="greylisting" value="greylisting" {% if greylisted is sameas true %}checked{%endif%} class="checkbox fl-space" rel="checkboxhorizont" />
  111. <label>{{ _('Greylisting') }} {% if accountType == 'domain' %}<span class="grey"><em>({{ _('Per-user greylisting setting has higher priority') }})</em></span>{% endif %}</label>
  112. </div>
  113. {% endif %}
  114. {% endif %}
  115. {% for srv in available_services %}
  116. {% if srv[0] != 'hidden' %}
  117. <h4 class="size-250 fl-space">&nbsp;</h4>
  118. {% endif %}
  119. <div class="form-checkbox-item clear">
  120. <input type="{{ srv[0] }}" name="enabledService" value="{{ srv[1] }}" {% if srv[1] in enabledService or srv[1] |lower in enabledService %}checked{%endif%} class="{{ srv[0] }} fl-space" rel="checkboxhorizont" />
  121. <label>{{ srv[2] }}</label>
  122. </div>
  123. {% endfor %}
  124. {%- endmacro %}