Example #1
0
def fetch_ldap_user(username):
    config = get_config_file()
    ldap_url = config.get("LDAP_CONF", "ldap_url")
    base_dn = config.get("LDAP_CONF", "ldap_dn")

    import ldap
    try:
        l = ldap.open(ldap_url)
        l.protocol_version = ldap.VERSION3
    except ldap.LDAPError, e:
        current.logger.error(e)
        return None
Example #2
0
def fetch_ldap_user(username):
    config = get_config_file()
    ldap_url = config.get("LDAP_CONF","ldap_url")
    base_dn = config.get("LDAP_CONF","ldap_dn")

    import ldap
    try:
        l = ldap.open(ldap_url)
        l.protocol_version = ldap.VERSION3    
    except ldap.LDAPError, e:
        current.logger.error(e)
        return None
Example #3
0
# -*- coding: utf-8 -*-
###################################################################################
# Added to enable code completion in IDE's.
# from task_scheduler import test123
if 0:
    from gluon import *  # @UnusedWildImport
    from gluon import request
###################################################################################
from helper import get_config_file,get_datetime
from auth_user import login_callback,login_ldap_callback

#### Connection Pooling of Db is also possible

config = get_config_file()
db_type = config.get("GENERAL_CONF","database_type")
conn_str = config.get(db_type.upper() + "_CONF", db_type + "_conn")
db = DAL(conn_str)

db.define_table('constants',
    Field('name', 'string', notnull = True, unique = True),
    Field('value', 'string', notnull = True))

db.define_table('organisation',
    Field('name', 'string', notnull = True, unique = True),
    Field('details', 'string'),
    Field('public_ip', 'string',length = 15), 
    Field('admin_mailid', 'string', length = 50),
    format = '%(details)s')

from gluon.tools import Auth
auth = Auth(db)