IRedAdmin-Pro/FAQ/Howto.Add.Custom.Service

From iRedMail
Revision as of 07:53, 18 August 2010 by ZhangHuangbin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

We add 'jabber' service for example. It will be used as "enabledService=jabber" in LDAP. You can manage it in iRedAdmin-Pro, like in this screenshot: Domain Profile: Service Control, User Profile: Service Control.

  • Open libs/ldaplib/attrs.py, add 'jabber' (or whatever you want) in below two lists:
File: libs/libldap/attrs.py
USER_ENABLED_SERVICE = ['jabber', ]
USER_SERVICE_UNDER_CONTROL = ['jabber', ...]
  • Open libs/ldaplib/iredldif.py, find line 160, in function "ldif_mailuser", append 'jabber':
File: libs/ldaplib/iredldif.py
         ('enabledService',      ['mail', 'smtp', 'deliver', 'jabber',
  • [iRedAdmin-Pro-1.3.0 and newer version] Open templates/default/macros.html, find below lines in macro "display_enabled_services":
File: templates/default/macros.html
{% macro display_enabled_services(accountType, enabledService) -%}
    ... SKIP OTHER LINES HERE ...

    {% elif accountType == 'user' %}
        {% set available_services = [
                ('hidden', 'internal', ''),
                ... SKIP OTHER SERVICES HERE ...
                ('checkbox', 'jabber', _('Jabber IM Service')),             # <-- Add this line.
  • [iRedAdmin-Pro-1.2.0 only] Open templates/default/macros.html, find line 360, in macro "display_enabled_services", append 'jabber':
File: templates/default/macros.html

            {# We already have below lines, don't touch them #}
            <div class="mf-item">
                <span class="fld-input"><input type="checkbox" name="enabledService" value="managesievesecured" {% if 'managesievesecured' in enabledService %}checked{%endif%}/></span>
                <label>{{ _('Customize mail filter rule over TLS/SSL.') }}</label>
            </div>

{# <-- Append 'jabber' service below #}

            <div class="mf-item">
                <span class="fld-input"><input type="checkbox" name="enabledService" value="jabber" {% if 'jabber' in enabledService %}checked{%endif%}/></span>
                <label>{{ _('Jabber service.') }}</label>
            </div>

{# <-- END #}
Personal tools