示例#1
0
    def load(self):
        self.fields["auth_anonymous_access"].initial = not self.siteconfig.get("auth_require_sitewide_login")

        self.fields["custom_backends"].initial = ", ".join(self.siteconfig.get("auth_custom_backends"))

        can_enable_dns, reason = get_can_enable_dns()
        if not can_enable_dns:
            self.disabled_fields["auth_ad_find_dc_from_dns"] = reason

        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields["auth_ldap_uri"] = True
            self.disabled_fields["auth_ldap_email_domain"] = True
            self.disabled_fields["auth_ldap_email_attribute"] = True
            self.disabled_fields["auth_ldap_tls"] = True
            self.disabled_fields["auth_ldap_base_dn"] = True
            self.disabled_fields["auth_ldap_uid_mask"] = True
            self.disabled_fields["auth_ldap_anon_bind_uid"] = True
            self.disabled_fields["auth_ldap_anon_bind_password"] = True

            self.disabled_fields["auth_ad_use_tls"] = True
            self.disabled_fields["auth_ad_group_name"] = True
            self.disabled_fields["auth_ad_recursion_depth"] = True
            self.disabled_fields["auth_ad_ou_name"] = True
            self.disabled_fields["auth_ad_search_root"] = True
            self.disabled_fields["auth_ad_find_dc_from_dns"] = True
            self.disabled_fields["auth_ad_domain_controller"] = True
            self.disabled_fields["auth_ad_domain_name"] = _(reason)

            self.disabled_reasons["auth_ldap_uri"] = reason

        super(AuthenticationSettingsForm, self).load()
示例#2
0
    def load(self):
        """Load the data for the form."""
        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields['auth_ad_use_tls'] = True
            self.disabled_fields['auth_ad_group_name'] = True
            self.disabled_fields['auth_ad_recursion_depth'] = True
            self.disabled_fields['auth_ad_ou_name'] = True
            self.disabled_fields['auth_ad_search_root'] = True
            self.disabled_fields['auth_ad_find_dc_from_dns'] = True
            self.disabled_fields['auth_ad_domain_controller'] = True

            self.disabled_reasons['auth_ad_domain_name'] = reason

        super(ActiveDirectorySettingsForm, self).load()
示例#3
0
    def load(self):
        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields['auth_ldap_uri'] = True
            self.disabled_fields['auth_ldap_email_domain'] = True
            self.disabled_fields['auth_ldap_email_attribute'] = True
            self.disabled_fields['auth_ldap_tls'] = True
            self.disabled_fields['auth_ldap_base_dn'] = True
            self.disabled_fields['auth_ldap_uid_mask'] = True
            self.disabled_fields['auth_ldap_anon_bind_uid'] = True
            self.disabled_fields['auth_ldap_anon_bind_password'] = True

            self.disabled_reasons['auth_ldap_uri'] = reason

        super(LDAPSettingsForm, self).load()
示例#4
0
    def load(self):
        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields['auth_ldap_uri'] = True
            self.disabled_fields['auth_ldap_email_domain'] = True
            self.disabled_fields['auth_ldap_email_attribute'] = True
            self.disabled_fields['auth_ldap_tls'] = True
            self.disabled_fields['auth_ldap_base_dn'] = True
            self.disabled_fields['auth_ldap_uid_mask'] = True
            self.disabled_fields['auth_ldap_anon_bind_uid'] = True
            self.disabled_fields['auth_ldap_anon_bind_password'] = True

            self.disabled_reasons['auth_ldap_uri'] = reason

        super(LDAPSettingsForm, self).load()
示例#5
0
    def load(self):
        # First set some sane defaults.
        domain_method = self.siteconfig.get("site_domain_method")
        site = Site.objects.get_current()
        self.fields['server'].initial = "%s://%s" % (domain_method,
                                                     site.domain)
        self.fields['auth_anonymous_access'].initial = \
            not self.siteconfig.get("auth_require_sitewide_login")

        self.fields['custom_backends'].initial = \
            ', '.join(self.siteconfig.get('auth_custom_backends'))

        can_enable_search, reason = get_can_enable_search()
        if not can_enable_search:
            self.disabled_fields['search_enable'] = True
            self.disabled_fields['search_index_file'] = True
            self.disabled_reasons['search_enable'] = reason

        can_enable_dns, reason = get_can_enable_dns()
        if not can_enable_dns:
            self.disabled_fields['auth_ad_find_dc_from_dns'] = reason

        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields['auth_ldap_uri'] = True
            self.disabled_fields['auth_ldap_email_domain'] = True
            self.disabled_fields['auth_ldap_email_attribute'] = True
            self.disabled_fields['auth_ldap_tls'] = True
            self.disabled_fields['auth_ldap_base_dn'] = True
            self.disabled_fields['auth_ldap_uid_mask'] = True
            self.disabled_fields['auth_ldap_anon_bind_uid'] = True
            self.disabled_fields['auth_ldap_anon_bind_password'] = True

            self.disabled_fields['auth_ad_use_tls'] = True
            self.disabled_fields['auth_ad_group_name'] = True
            self.disabled_fields['auth_ad_recursion_depth'] = True
            self.disabled_fields['auth_ad_ou_name'] = True
            self.disabled_fields['auth_ad_search_root'] = True
            self.disabled_fields['auth_ad_find_dc_from_dns'] = True
            self.disabled_fields['auth_ad_domain_controller'] = True
            self.disabled_fields['auth_ad_domain_name'] = _(reason)

            self.disabled_reasons['auth_ldap_uri'] = reason

        super(GeneralSettingsForm, self).load()
示例#6
0
    def load(self):
        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields["auth_ldap_uri"] = True
            self.disabled_fields["auth_ldap_given_name_attribute"] = True
            self.disabled_fields["auth_ldap_surname_attribute"] = True
            self.disabled_fields["auth_ldap_full_name_attribute"] = True
            self.disabled_fields["auth_ldap_email_domain"] = True
            self.disabled_fields["auth_ldap_email_attribute"] = True
            self.disabled_fields["auth_ldap_tls"] = True
            self.disabled_fields["auth_ldap_base_dn"] = True
            self.disabled_fields["auth_ldap_uid_mask"] = True
            self.disabled_fields["auth_ldap_anon_bind_uid"] = True
            self.disabled_fields["auth_ldap_anon_bind_password"] = True

            self.disabled_reasons["auth_ldap_uri"] = reason

        super(LDAPSettingsForm, self).load()
示例#7
0
    def load(self):
        can_enable_dns, reason = get_can_enable_dns()

        if not can_enable_dns:
            self.disabled_fields['auth_ad_find_dc_from_dns'] = reason

        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields['auth_ad_use_tls'] = True
            self.disabled_fields['auth_ad_group_name'] = True
            self.disabled_fields['auth_ad_recursion_depth'] = True
            self.disabled_fields['auth_ad_ou_name'] = True
            self.disabled_fields['auth_ad_search_root'] = True
            self.disabled_fields['auth_ad_find_dc_from_dns'] = True
            self.disabled_fields['auth_ad_domain_controller'] = True

            self.disabled_reasons['auth_ad_domain_name'] = reason

        super(ActiveDirectorySettingsForm, self).load()
示例#8
0
    def load(self):
        """Load the data for the form."""
        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields['auth_ldap_uri'] = True
            self.disabled_fields['auth_ldap_given_name_attribute'] = True
            self.disabled_fields['auth_ldap_surname_attribute'] = True
            self.disabled_fields['auth_ldap_full_name_attribute'] = True
            self.disabled_fields['auth_ldap_email_domain'] = True
            self.disabled_fields['auth_ldap_email_attribute'] = True
            self.disabled_fields['auth_ldap_tls'] = True
            self.disabled_fields['auth_ldap_base_dn'] = True
            self.disabled_fields['auth_ldap_uid'] = True
            self.disabled_fields['auth_ldap_uid_mask'] = True
            self.disabled_fields['auth_ldap_anon_bind_uid'] = True
            self.disabled_fields['auth_ldap_anon_bind_password'] = True

            self.disabled_reasons['auth_ldap_uri'] = reason

        super(LDAPSettingsForm, self).load()
示例#9
0
    def load(self):
        """Load the data for the form."""
        can_enable_ldap, reason = get_can_enable_ldap()

        if not can_enable_ldap:
            self.disabled_fields['auth_ldap_uri'] = True
            self.disabled_fields['auth_ldap_given_name_attribute'] = True
            self.disabled_fields['auth_ldap_surname_attribute'] = True
            self.disabled_fields['auth_ldap_full_name_attribute'] = True
            self.disabled_fields['auth_ldap_email_domain'] = True
            self.disabled_fields['auth_ldap_email_attribute'] = True
            self.disabled_fields['auth_ldap_tls'] = True
            self.disabled_fields['auth_ldap_base_dn'] = True
            self.disabled_fields['auth_ldap_uid'] = True
            self.disabled_fields['auth_ldap_uid_mask'] = True
            self.disabled_fields['auth_ldap_anon_bind_uid'] = True
            self.disabled_fields['auth_ldap_anon_bind_password'] = True

            self.disabled_reasons['auth_ldap_uri'] = reason

        super(LDAPSettingsForm, self).load()