# Path: ldaptor/config.py
# class MissingBaseDNError(Exception):
# class LDAPConfig(object):
#     def __str__(self):
#     def __init__(self,
#                  baseDN=None,
#                  serviceLocationOverrides=None,
#                  identityBaseDN=None,
#                  identitySearch=None):
#     def getBaseDN(self):
#     def getServiceLocationOverrides(self):
#     def _loadServiceLocationOverrides(self):
#     def copy(self, **kw):
#     def getIdentityBaseDN(self):
#     def getIdentitySearch(self, name):
# def loadConfig(configFiles=None,
#                reload=False):
# def useLMhash():
# DEFAULTS = {
#     'samba': { 'use-lmhash': 'no',
#                },
#     }
# CONFIG_FILES = [
#     '/etc/ldaptor/global.cfg',
#     os.path.expanduser('~/.ldaptor/global.cfg'),
#     ]


from ldaptor import config

def _getSearchFields():
    cfg = config.loadConfig()
    if not cfg.has_section('webui'):
        return
    for raw in cfg.options('webui'):
        if not raw:
            continue
        l=raw.split(None, 2)
        if l[0].lower() == 'search-field':
            pri, name = l[1:]
            pri = int(pri)
            yield (pri, name, raw)

def getSearchFieldByName(name, vars):
    for pri, n, raw in _getSearchFields():
        if n == name:

# Path: ldaptor/config.py
# class MissingBaseDNError(Exception):
# class LDAPConfig(object):
#     def __str__(self):
#     def __init__(self,
#                  baseDN=None,
#                  serviceLocationOverrides=None,
#                  identityBaseDN=None,
#                  identitySearch=None):
#     def getBaseDN(self):
#     def getServiceLocationOverrides(self):
#     def _loadServiceLocationOverrides(self):
#     def copy(self, **kw):
#     def getIdentityBaseDN(self):
#     def getIdentitySearch(self, name):
# def loadConfig(configFiles=None,
#                reload=False):
# def useLMhash():
# DEFAULTS = {
#     'samba': { 'use-lmhash': 'no',
#                },
#     }
# CONFIG_FILES = [
#     '/etc/ldaptor/global.cfg',
#     os.path.expanduser('~/.ldaptor/global.cfg'),
#     ]


# Path: ldaptor/apps/webui/config.py
from ldaptor import config


def _getSearchFields():
    cfg = config.loadConfig()
    if not cfg.has_section('webui'):
        return
    for raw in cfg.options('webui'):
        if not raw:
            continue
        l=raw.split(None, 2)
        if l[0].lower() == 'search-field':
            pri, name = l[1:]
            pri = int(pri)
            yield (pri, name, raw)

def getSearchFieldByName(name, vars):
    for pri, n, raw in _getSearchFields():
        if n == name:

            cfg = config.loadConfig()