def __updateRasCheckInput(self, ras_id, ras_ip, ras_description, ras_type, radius_secret, comment): ras_obj = ras_main.getLoader()[ras_id] if ras_obj.getRasIP() != ras_ip: if not iplib.checkIPAddrWithoutMask(ras_ip): raise GeneralException( errorText("RAS", "INVALID_RAS_IP") % ras_ip) if ras_main.getLoader().rasIPExists(ras_ip): raise GeneralException( errorText("RAS", "RAS_IP_ALREADY_EXISTS") % ras_ip) if self.__rasIPExistsInDB(ras_ip): raise GeneralException( errorText("RAS", "RAS_IS_INACTIVE") % ras_ip) if ras_obj.getRasDesc() != ras_description and ras_main.getLoader( ).rasDescExists(ras_description): raise GeneralException( errorText("RAS", "RAS_DESCRIPTION_ALREADY_EXISTS") % ras_description) self.__checkValidRasDescription(ras_description) if not ras_main.getFactory().hasType(ras_type): raise GeneralException( errorText("RAS", "RAS_TYPE_NOT_REGISTERED") % ras_type)
def getRasTypes(self,request): """ return a list of all available ras types """ request.needAuthType(request.ADMIN) creator_obj=request.getAuthNameObj() creator_obj.canDo("GET RAS INFORMATION") return ras_main.getFactory().getAllTypes()
def __createRasObj(self, ras_info, ras_attrs, ports, ippools): """ create a ras object, using ras_info and ras_attrs """ return ras_main.getFactory().getClassFor(ras_info["ras_type"])( ras_info["ras_ip"], ras_info["ras_id"], ras_info["ras_description"], ras_info["ras_type"], ras_info["radius_secret"], ras_info["comment"], ports, ippools, ras_attrs)
def getRasTypes(self, request): """ return a list of all available ras types """ request.needAuthType(request.ADMIN) creator_obj = request.getAuthNameObj() creator_obj.canDo("GET RAS INFORMATION") type_list = ras_main.getFactory().getAllTypes() sorted = SortedList(type_list) sorted.sort(False) return sorted.getList()
def __addNewRasCheckInput(self,ras_ip,ras_type,radius_secret): if not iplib.checkIPAddrWithoutMask(ras_ip): raise GeneralException(errorText("RAS","INVALID_RAS_IP")%ras_ip) if ras_main.getLoader().rasIPExists(ras_ip): raise GeneralException(errorText("RAS","RAS_IP_ALREADY_EXISTS")%ras_ip) if self.__rasIPExistsInDB(ras_ip): raise GeneralException(errorText("RAS","RAS_IS_INACTIVE")%ras_ip) if not ras_main.getFactory().hasType(ras_type): raise GeneralException(errorText("RAS","RAS_TYPE_NOT_REGISTERED")%ras_type)
def init(): ras_main.getFactory().register(PersistentLanRas, "Persistent Lan")
def init(): ras_main.getFactory().register(CiscoRas,"Cisco")
def init(): ras_main.getFactory().register(MikrotikRas, "Mikrotik")
def init(): ras_main.getFactory().register(ChilliSpot, "ChilliSpot")
def init(): ras_main.getFactory().register(CiscoVPDNRas, "CiscoVPDN")
def init(): ras_main.getFactory().register(PersistentLanRas,"Persistent Lan")
def init(): ras_main.getFactory().register(BSAERas, "BSAE")
def init(): if not handlers_manager.getManager().handlerRegistered("asterisk"): handlers_manager.getManager().registerHandler(AsteriskHandler()) ras_main.getFactory().register(AsteriskRas, "Asterisk")
def init(): ras_main.getFactory().register(GnuGKRas, "GnuGk")
def __createRasObj(self,ras_info,ras_attrs,ports,ippools): """ create a ras object, using ras_info and ras_attrs """ return ras_main.getFactory().getClassFor(ras_info["ras_type"])(ras_info["ras_ip"],ras_info["ras_id"], ras_info["ras_type"],ras_info["radius_secret"],ports,ippools,ras_attrs)
def init(): ras_main.getFactory().register(PortMasterRas, "PortMaster")
def init(): ras_main.getFactory().register(GnuGKRas,"GnuGk")
def init(): ras_main.getFactory().register(TotalControlRas, "Total Control")
def init(): ras_main.getFactory().register(PPPDRas,"pppd")
def init(): ras_main.getFactory().register(SerRas, "Ser")
def init(): ras_main.getFactory().register(PPPDRas, "pppd")
def init(): ras_main.getFactory().register(QuintumTenorRas,"Quintum Tenor")
def init(): ras_main.getFactory().register(MVTSRas, "MVTS")
def init(): ras_main.getFactory().register(PortSlaveRas, "Portslave")