Esempio n. 1
0
def init():
    global bw_loader
    from core.bandwidth_limit.bw_loader import BWLoader
    bw_loader=BWLoader()
    bw_loader.loadAll()
    registerInParents()

    global tc
    from core.bandwidth_limit.tc import TC
    tc=TC()

    global mark_id_pool
    from core.bandwidth_limit.idpool import IDPool
    mark_id_pool=IDPool([10000,4294967295],"iptables mark")
    
    global iptables
    from core.bandwidth_limit.iptables import IPTables
    iptables=IPTables()
    
    initTree()

    global manager
    from core.bandwidth_limit.bw_manager import BWManager,UpdateCounters
    manager=BWManager()
    periodic_events.getManager().register(UpdateCounters())    
    
    global actions
    from core.bandwidth_limit.bw_actions import BWActions
    actions=BWActions()
    
    from core.bandwidth_limit.bw_handler import BWHandler
    handlers_manager.getManager().registerHandler(BWHandler())

    applyStatics()
Esempio n. 2
0
def init():
    from core.message import message_actions
    global message_action_manager
    message_action_manager = message_actions.MessageActions()

    from core.message.message_handler import MessageHandler
    handlers_manager.getManager().registerHandler(MessageHandler())
Esempio n. 3
0
def init():
    from core.ias.ias_actions import IASActions
    global ias_actions
    ias_actions = IASActions()

    from core.ias.ias_handler import IASHandler
    handlers_manager.getManager().registerHandler(IASHandler())
Esempio n. 4
0
def init():
    from core.log_console.log_console import LogConsole
    global log_console
    log_console = LogConsole()

    from core.log_console.log_console_handler import LogConsoleHandler
    handlers_manager.getManager().registerHandler(LogConsoleHandler())
Esempio n. 5
0
def init():
    global admin_loader, admin_actions, deposit_change_log_actions

    import core.admin.perm_loader

    core.admin.perm_loader.init()

    from core.admin.admin_loader import AdminLoader

    admin_loader = AdminLoader()
    admin_loader.loadAllAdmins()

    from core.admin.admin_actions import AdminActions

    admin_actions = AdminActions()

    import core.admin.perm_actions

    core.admin.perm_actions.init()

    from core.admin.deposit_change_log import DepositChangeLogActions

    deposit_change_log_actions = DepositChangeLogActions()

    from core.admin.admin_handler import AdminHandler

    handlers_manager.getManager().registerHandler(AdminHandler())

    from core.admin.perm_handler import PermHandler

    handlers_manager.getManager().registerHandler(PermHandler())
Esempio n. 6
0
def init():
    from core.stats.stat_handler import StatHandler
    handlers_manager.getManager().registerHandler(StatHandler())

    from core.stats.stat_keeper import StatKeeper
    global stat_keeper
    stat_keeper = StatKeeper()
Esempio n. 7
0
def init():
    from core.web_analyzer.web_analyzer_handler import WebAnalyzerHandler
    handlers_manager.getManager().registerHandler(WebAnalyzerHandler())

    from core.web_analyzer.web_analyzer_logger import WebAnalyzerLogger
    global web_analyzer_logger
    web_analyzer_logger = WebAnalyzerLogger()
Esempio n. 8
0
def init():
    from core.report import onlines_filter
    onlines_filter.init()

    from core.report.report_handler import ReportHandler
    handlers_manager.getManager().registerHandler(ReportHandler())

    from core.report.report_cleaner import ReportCleaner
    global report_cleaner
    report_cleaner = ReportCleaner()
Esempio n. 9
0
def init():
    user_main.getAttributeManager().registerHandler(VoIPUserAttrHandler(), [
        "voip_username", "voip_password", "voip_generate_password",
        "voip_generate_password_len", "voip_save_usernames"
    ], ["voip_username"], [])
    handlers_manager.getManager().registerHandler(VoIPUserHandler())
    user_main.getUserPluginManager().register("voip_user_plugin", VoIPUser)

    global actions
    actions = VoIPUserActions()
Esempio n. 10
0
def init():
    from core.group.group_loader import GroupLoader
    global group_loader
    group_loader=GroupLoader()
    group_loader.loadAllGroups()

    from core.group.group_actions import GroupActions
    global group_actions
    group_actions=GroupActions()

    from core.group.group_handler import GroupHandler
    handlers_manager.getManager().registerHandler(GroupHandler())
Esempio n. 11
0
def init():
    from core.ippool.ippool_loader import IPpoolLoader
    global ippool_loader
    ippool_loader = IPpoolLoader()
    ippool_loader.loadAllIPpools()

    from core.ippool.ippool_actions import IPpoolActions
    global ippool_actions
    ippool_actions = IPpoolActions()

    from core.ippool.ippool_handler import IPpoolHandler
    handlers_manager.getManager().registerHandler(IPpoolHandler())
Esempio n. 12
0
def init():
    from core.charge.voip_tariff.tariff_actions import TariffActions
    global actions_manager
    actions_manager=TariffActions()

    from core.charge.voip_tariff.tariff_loader import TariffLoader
    global tariff_loader
    tariff_loader=TariffLoader()
    tariff_loader.loadAllTariffs()
    
    from core.charge.voip_tariff.tariff_handler import TariffHandler
    handlers_manager.getManager().registerHandler(TariffHandler())
Esempio n. 13
0
def init():
    from core.ippool.ippool_loader import IPpoolLoader    
    global ippool_loader
    ippool_loader=IPpoolLoader()
    ippool_loader.loadAllIPpools()

    from core.ippool.ippool_actions import IPpoolActions
    global ippool_actions
    ippool_actions=IPpoolActions()

    from core.ippool.ippool_handler import IPpoolHandler
    handlers_manager.getManager().registerHandler(IPpoolHandler())
Esempio n. 14
0
def initWSProcess():

    from core.ras.base_ras_loader import RasLoader
    global ras_loader
    ras_loader = RasLoader()
    ras_loader.loadAllRases()

    from core.ras.ras_actions import RasActions
    global ras_actions
    ras_actions = RasActions()

    from core.ras.ras_handler import RasHandler
    handlers_manager.getManager().registerHandler(RasHandler())
Esempio n. 15
0
def init():
    user_main.getAttributeManager().registerHandler(
        NormalUserAttrHandler(),
        [
            "normal_username",
            "normal_password",
            "normal_generate_password",
            "normal_generate_password_len",
            "normal_save_usernames",
        ],
        ["normal_username"],
        [],
    )
    handlers_manager.getManager().registerHandler(NormalUserHandler())
Esempio n. 16
0
def init():
    from core.charge.voip_tariff import tariff_main
    tariff_main.init()

    from core.charge.charge_loader import ChargeLoader
    global charge_loader
    charge_loader=ChargeLoader()
    charge_loader.loadAllCharges()
    
    from core.charge.charge_actions import ChargeActions
    global charge_actions
    charge_actions=ChargeActions()

    from core.charge.charge_handler import ChargeHandler
    handlers_manager.getManager().registerHandler(ChargeHandler())
Esempio n. 17
0
def init():
    from core.charge.voip_tariff import tariff_main
    tariff_main.init()

    from core.charge.charge_loader import ChargeLoader
    global charge_loader
    charge_loader = ChargeLoader()
    charge_loader.loadAllCharges()

    from core.charge.charge_actions import ChargeActions
    global charge_actions
    charge_actions = ChargeActions()

    from core.charge.charge_handler import ChargeHandler
    handlers_manager.getManager().registerHandler(ChargeHandler())
Esempio n. 18
0
def init():
    from core.group.group_loader import GroupLoader

    global group_loader
    group_loader = GroupLoader()
    group_loader.loadAllGroups()

    from core.group.group_actions import GroupActions

    global group_actions
    group_actions = GroupActions()

    from core.group.group_handler import GroupHandler

    handlers_manager.getManager().registerHandler(GroupHandler())
Esempio n. 19
0
    def _dispatch(self, method, params):
        """Dispatches the XML-RPC method.
        """
        start = time.time()
        if defs.LOG_SERVER_REQUESTS:
            try:
                format = "%s %s %s"
                args = [params[0]["auth_type"], params[0]["auth_name"], method]
            except (KeyError, IndexError, TypeError):
                format = "N/A N/A %s %s"
                args = [method, str(params)]

            apply(self.log_message, [format] + args)

        #handle request
        params = self.__convToUTF8(params)
        ret_val = handlers_manager.getManager().dispatch(
            method, params, self.client_address)

        #update statistics
        duration = time.time() - start

        stat_main.getStatKeeper().avg("server_avg_response_time",
                                      "server_total_requests", duration)
        stat_main.getStatKeeper().max("server_max_response_time", duration)

        if defs.LOG_SERVER_REQUESTS:
            apply(self.log_message,
                  [format + " duration: %s"] + args + [duration])

        return ret_val
Esempio n. 20
0
def init():
    from core.user import user_actions,user_plugin,attribute_manager

    global attr_manager
    attr_manager=attribute_manager.AttributeManager()
    
    global user_loader
    from core.user.user_loader import UserLoader
    user_loader=UserLoader()

    global user_pool
    from core.user.user_pool import UserPool
    user_pool=UserPool()
    
    global user_action_manager
    user_action_manager=user_actions.UserActions()

    global user_plugin_manager
    user_plugin_manager=user_plugin.UserPluginManager()

    global credit_change_log_actions
    from core.user.credit_change_log import CreditChangeLogActions
    credit_change_log_actions=CreditChangeLogActions()

    global connection_log_manager
    from core.user.connection_log import ConnectionLogActions
    connection_log_manager=ConnectionLogActions()

    global add_user_save_actions
    from core.user.add_user_save import AddUserSaveActions,AddUserSaveHandler
    add_user_save_actions=AddUserSaveActions()
    handlers_manager.getManager().registerHandler(AddUserSaveHandler())

    global ras_msg_dispatcher
    from core.user.ras_msg_dispatcher import RasMsgDispatcher
    ras_msg_dispatcher=RasMsgDispatcher()
    
    global online
    from core.user.online import OnlineUsers,OnlineCheckPeriodicEvent
    online=OnlineUsers()
    periodic_events.getManager().register(OnlineCheckPeriodicEvent())
    
    
    plugin_loader.loadPlugins(defs.IBS_CORE+"/user/plugins")

    from core.user.user_handler import UserHandler
    handlers_manager.getManager().registerHandler(UserHandler())
Esempio n. 21
0
def init():
    from core.ras.ras_factory import RasFactory
    global ras_factory
    ras_factory=RasFactory()

    loadPlugins(RAS_IMPLEMENTIONS)
    
    from core.ras.ras_actions import RasActions
    global ras_actions
    ras_actions=RasActions()

    from core.ras.user_msg_dispatcher import UserMsgDispatcher
    global user_msg_dispatcher
    user_msg_dispatcher=UserMsgDispatcher()

    from core.ras.ras_loader import RasLoader
    global ras_loader
    ras_loader=RasLoader()
    ras_loader.loadAllRases()

    from core.ras.ras_handler import RasHandler
    handlers_manager.getManager().registerHandler(RasHandler())
Esempio n. 22
0
def init():
    from core.ras.ras_factory import RasFactory
    global ras_factory
    ras_factory = RasFactory()

    loadPlugins(RAS_IMPLEMENTIONS)

    from core.ras.ras_actions import RasActions
    global ras_actions
    ras_actions = RasActions()

    from core.ras.user_msg_dispatcher import UserMsgDispatcher
    global user_msg_dispatcher
    user_msg_dispatcher = UserMsgDispatcher()

    from core.ras.ras_loader import RasLoader
    global ras_loader
    ras_loader = RasLoader()
    ras_loader.loadAllRases()

    from core.ras.ras_handler import RasHandler
    handlers_manager.getManager().registerHandler(RasHandler())
Esempio n. 23
0
def init():
    global bw_loader
    from core.bandwidth_limit.bw_loader import BWLoader
    bw_loader=BWLoader()
    bw_loader.loadAll()
    registerInParents()

    global tc
    from core.bandwidth_limit.tc import TC
    tc=TC()

    global mark_id_pool
    from core.bandwidth_limit.idpool import IDPool
    mark_id_pool=IDPool([10000,4294967295],"iptables mark")
    
    global iptables
    from core.bandwidth_limit.iptables import IPTables
    iptables=IPTables()
    
    initTree()

    global manager
    from core.bandwidth_limit.bw_manager import BWManager,UpdateCounters
    manager=BWManager()
    periodic_events.getManager().register(UpdateCounters())    
    
    global actions
    from core.bandwidth_limit.bw_actions import BWActions
    actions=BWActions()
    
    from core.bandwidth_limit.bw_handler import BWHandler
    handlers_manager.getManager().registerHandler(BWHandler())

    applyStatics()


    setReCreateTreeSignalHandler()
Esempio n. 24
0
def init():
    global admin_loader, admin_actions, deposit_change_log_actions

    import core.admin.perm_loader
    core.admin.perm_loader.init()

    from core.admin.admin_loader import AdminLoader
    admin_loader = AdminLoader()
    admin_loader.loadAllAdmins()

    from core.admin.admin_actions import AdminActions
    admin_actions = AdminActions()

    import core.admin.perm_actions
    core.admin.perm_actions.init()

    from core.admin.deposit_change_log import DepositChangeLogActions
    deposit_change_log_actions = DepositChangeLogActions()

    from core.admin.admin_handler import AdminHandler
    handlers_manager.getManager().registerHandler(AdminHandler())

    from core.admin.perm_handler import PermHandler
    handlers_manager.getManager().registerHandler(PermHandler())
Esempio n. 25
0
def init():
    global onlines_loop
    from core.snapshot.onlines_loop import OnlinesLoop
    onlines_loop = OnlinesLoop()

    global realtime_manager
    from core.snapshot.realtime_manager import RealTimeManager
    realtime_manager = RealTimeManager()

    from core.snapshot.realtime_manager import RealTimePeriodicEvent
    periodic_events.getManager().register(RealTimePeriodicEvent())

    plugin_loader.loadPlugins(defs.IBS_CORE + "/snapshot/plugins")

    from core.snapshot.snapshot_handler import SnapShotHandler
    handlers_manager.getManager().registerHandler(SnapShotHandler())

    from core.snapshot.bw_snapshot import BWSnapShotOnlinesLoopClient
    getOnlinesLoop().registerClient(BWSnapShotOnlinesLoopClient())

    from core.snapshot.onlines_snapshot import OnlinesSnapShotOnlinesLoopClient
    getOnlinesLoop().registerClient(OnlinesSnapShotOnlinesLoopClient())

    getOnlinesLoop().doLoop()  #do loop for first time
Esempio n. 26
0
def init():
    if not handlers_manager.getManager().handlerRegistered("asterisk"):
        handlers_manager.getManager().registerHandler(AsteriskHandler())

    ras_main.getFactory().register(AsteriskRas, "Asterisk")
Esempio n. 27
0
def init():
    global user_audit_log_manager
    from core.user.user_audit_log import UserAuditLog
    user_audit_log_manager = UserAuditLog()

    from core.user import user_actions, user_plugin, attribute_manager
    global attr_manager
    attr_manager = attribute_manager.AttributeManager()

    global user_loader
    from core.user.user_loader import UserLoader
    user_loader = UserLoader()

    global user_pool
    from core.user.user_pool import UserPool
    user_pool = UserPool()

    global mail_actions
    from core.user.mail_actions import MailActions
    mail_actions = MailActions()

    global user_action_manager
    user_action_manager = user_actions.UserActions()

    global user_plugin_manager
    user_plugin_manager = user_plugin.UserPluginManager()

    global credit_change_log_actions
    from core.user.credit_change_log import CreditChangeLogActions
    credit_change_log_actions = CreditChangeLogActions()

    global connection_log_manager
    from core.user.connection_log import ConnectionLogActions
    connection_log_manager = ConnectionLogActions()

    global add_user_save_actions
    from core.user.add_user_save import AddUserSaveActions, AddUserSaveHandler
    add_user_save_actions = AddUserSaveActions()
    handlers_manager.getManager().registerHandler(AddUserSaveHandler())

    global ras_msg_dispatcher
    from core.user.ras_msg_dispatcher import RasMsgDispatcher
    ras_msg_dispatcher = RasMsgDispatcher()

    global online
    from core.user.online import OnlineUsers, OnlineCheckPeriodicEvent
    online = OnlineUsers()
    periodic_events.getManager().register(OnlineCheckPeriodicEvent())

    global user_server_auth
    from core.user.server_auth import UserServerAuth
    user_server_auth = UserServerAuth()

    global dialer_errors
    from core.user.dialer_errors import DialerErrors
    dialer_errors = DialerErrors()

    global voip_errors
    from core.user.voip_errors import VoIPErrors
    voip_errors = VoIPErrors()

    global ip_map
    from core.user.ip_map import IPMap
    ip_map = IPMap()

    global user_plugin_modules
    user_plugin_modules = plugin_loader.loadPlugins(defs.IBS_CORE +
                                                    "/user/plugins")

    from core.user.user_handler import UserHandler
    handlers_manager.getManager().registerHandler(UserHandler())
Esempio n. 28
0
def init():
    user_main.getAttributeManager().registerHandler(NormalUserAttrHandler(), [
        "normal_username", "normal_password", "normal_generate_password",
        "normal_generate_password_len", "normal_save_usernames"
    ], ["normal_username"], [])
    handlers_manager.getManager().registerHandler(NormalUserHandler())
Esempio n. 29
0
def init():
    user_main.getAttributeManager().registerHandler(VoIPUserAttrHandler(),["voip_username","voip_password","voip_generate_password","voip_generate_password_len","voip_save_usernames"],["voip_username"],[])
    handlers_manager.getManager().registerHandler(VoIPUserHandler())
    user_main.getUserPluginManager().register("voip_user_plugin",VoIPUser)
Esempio n. 30
0
def init():    
    from core.defs_lib.defs_handler import DefsHandler
    handlers_manager.getManager().registerHandler(DefsHandler())
    global actions_manager
    from core.defs_lib.defs_actions import DefsActions
    actions_manager=DefsActions()
Esempio n. 31
0
def init():
    from core.util.util_handler import UtilHandler
    handlers_manager.getManager().registerHandler(UtilHandler())
Esempio n. 32
0
def init():
    handlers_manager.getManager().registerHandler(LoginHandler())
Esempio n. 33
0
def init():
    from core.util.util_handler import UtilHandler
    handlers_manager.getManager().registerHandler(UtilHandler())
Esempio n. 34
0
def init():
    handlers_manager.getManager().registerHandler(LoginHandler())
Esempio n. 35
0
def init():
    from core.defs_lib.defs_handler import DefsHandler
    handlers_manager.getManager().registerHandler(DefsHandler())
    global actions_manager
    from core.defs_lib.defs_actions import DefsActions
    actions_manager = DefsActions()
Esempio n. 36
0
 def _dispatch(self, method, params):
     """Dispatches the XML-RPC method.
     """
     return handlers_manager.getManager().dispatch(method, params, self.client_address)