예제 #1
0
def readModCustomConfig(filePath):
    """Read configuration files which are individual for particular modules.
		Use configfile setting in user_modules.conf and modules.conf to enable
		reading of custom configuration files for selected modules.
		Input: (string) path to config file
		Output: (Config) Config class instance or None
	"""
    if not filePath:
        return None
    # Append configuration directory path to config file path if
    # config file path is not absolute.
    if filePath[0] != '/':
        filePath = '%s/%s' % (main_config['PATHS']['conf_dir'], filePath)
    # read file
    modconf = Config()
    readFiles = modconf.readFiles(filePath)
    if len(readFiles) > 0:
        return modconf
    else:
        return None
예제 #2
0
def readModCustomConfig(filePath):
	"""Read configuration files which are individual for particular modules.
		Use configfile setting in user_modules.conf and modules.conf to enable
		reading of custom configuration files for selected modules.
		Input: (string) path to config file
		Output: (Config) Config class instance or None
	"""
	if not filePath:
		return None
	# Append configuration directory path to config file path if
	# config file path is not absolute.
	if filePath[0] != '/':
		filePath =  '%s/%s' % (main_config['PATHS']['conf_dir'], filePath)
	# read file
	modconf = Config()
	readFiles = modconf.readFiles(filePath)
	if len(readFiles) > 0:
		return modconf
	else:
		return None
예제 #3
0
# Last changes:	$Date: 2006-05-17 12:48:27 +0300 (Tr, 17 Mai 2006) $

# import modules
#import sys, traceback
import types
import imp

from bsdradius.Config import Config, main_config
from bsdradius.logger import *
from bsdradius.BsdRadiusModule import BsdRadiusModule
from bsdradius import misc
from bsdradius.configDefaults import moduleConfigDefaults
from types import *

# global variable which should contain BSD Radius modules configuration data
modulesConfig = Config()

# contains all loaded modules
# key - module name, value - BsdRadiusModule class instance
loadedModules = {}

# defines order of modules for authorization phase
authzModules = []
# defines order of modules for accounting phase
acctModules = []
# ties auth type with corresponding module togeather
authcModules = {}

# module status values
MODULE_OK = 1
MODULE_REJECTED = 2