Conjunto de mudanças 5359 no repositório publico


Ignorar:
Timestamp:
13/10/2011 12:57:27 (8 anos atrás)
Autor:
felipevieira
Mensagem:

Merge branch 'ldap'

Localização:
SIGI/trunk/sigi
Arquivos:
2 editados

Legenda:

Não Modificado
Adicionado
Removido
  • SIGI/trunk/sigi/settings.py

    r5358 r5359  
     1# coding= utf-8
    12#
    23# Default Django settings for SIGI.
     
    1011
    1112import os
     13import ldap
     14import logging
     15
     16from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
     17
    1218BASE_DIR = os.path.abspath(os.path.dirname(__file__) + '../..')
    1319PROJECT_DIR = BASE_DIR + '/sigi'
     
    2834DATABASE_NAME = 'sigi'
    2935DATABASE_USER = 'administrador'
    30 DATABASE_PASSWORD = 'interlegis' 
     36DATABASE_PASSWORD = 'interlegis'
    3137DATABASE_HOST = '10.1.10.44'
    32 DATABASE_PORT = '5432'         
     38DATABASE_PORT = '5432'
    3339
    3440TIME_ZONE = 'Brazil/East'
     
    4349MEDIA_URL = '/sigi/media/'
    4450ADMIN_MEDIA_PREFIX = '/sigi/admin_media/'
     51
     52# Baseline configuration.
     53AUTH_LDAP_SERVER_URI = "ldap://w2k3dc01.interlegis.gov.br"
     54AUTH_LDAP_BIND_DN = u"cn=sigi-ldap,ou=Usuários de Sistema,ou=Usuários,ou=Interlegis,dc=interlegis,dc=gov,dc=br"
     55AUTH_LDAP_BIND_PASSWORD = "Sigi2609"
     56AUTH_LDAP_USER_SEARCH = LDAPSearch(u"ou=SINTER,ou=Usuários,ou=Sede,dc=interlegis,dc=gov,dc=br", ldap.SCOPE_SUBTREE, "(sAMAccountName=%(user)s)")
     57
     58# Set up the basic group parameters.
     59AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=Grupos Organizacionais,ou=Sede,dc=interlegis,dc=gov,dc=br", ldap.SCOPE_SUBTREE, "(objectClass=Group)")
     60AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn")
     61
     62# Only users in this group can log in.
     63#AUTH_LDAP_REQUIRE_GROUP = u"cn=Acesso ao SIGI,ou=Grupos de Permissão,ou=Sede,dc=interlegis,dc=gov,dc=br"
     64
     65AUTH_LDAP_USER_FLAGS_BY_GROUP = {
     66  "is_staff": u"cn=Acesso ao SIGI,ou=Grupos de Permissão,ou=Sede,dc=interlegis,dc=gov,dc=br"
     67}
     68
     69# Populate the Django user from the LDAP directory.
     70AUTH_LDAP_USER_ATTR_MAP = {
     71  "first_name": "givenName",
     72  "last_name": "sn",
     73  "email": "userPrincipalName"
     74}
     75
     76# Populate the Django user_profile from the LDAP directory.
     77#AUTH_LDAP_PROFILE_ATTR_MAP = {
     78#  "employee_number": "employeeNumber"
     79#}
     80
     81#AUTH_LDAP_PROFILE_FLAGS_BY_GROUP = {
     82#  "is_awesome": "cn=awesome,ou=django,ou=groups,dc=example,dc=com",
     83#}
     84
     85# Use LDAP group membership to calculate group permissions.
     86AUTH_LDAP_FIND_GROUP_PERMS = True
     87AUTH_LDAP_MIRROR_GROUPS = True
     88
     89# Cache group memberships for an hour to minimize LDAP traffic
     90AUTH_LDAP_CACHE_GROUPS = True
     91AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600
     92
     93# Keep ModelBackend around for per-user permissions and maybe a local superuser.
     94AUTHENTICATION_BACKENDS = (
     95    'django_auth_ldap.backend.LDAPBackend',
     96    'django.contrib.auth.backends.ModelBackend',
     97)
    4598
    4699CACHE_BACKEND = 'dummy:///'
  • SIGI/trunk/sigi/templates/snippets/modules/user.html

    r4348 r5359  
    11{% load i18n tree_menu_tags %}
     2{% if user.is_superuser %}
    23<div class="module" id="user-module">
    3   <h2>Meu espaço</h2>
    44  <h3>{{ user.get_full_name }}</h3>
    5   {% show_menu "Usuário" "unordered-list" %}
    65
    7   {% if user.is_superuser %}
    86  <h3>Administração</h3>
    97  {% show_menu "Administrador" "unordered-list" %}
    10   {% endif %}
    118</div>
     9{% endif %}
Note: Veja TracChangeset para ajuda no uso do visualizador de conjunto de mudanças.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.