Exemple #1
0
    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)
Exemple #2
0
    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()
Exemple #3
0
 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)
Exemple #4
0
 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()
Exemple #5
0
    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)
Exemple #6
0
def init():
    ras_main.getFactory().register(PersistentLanRas, "Persistent Lan")
Exemple #7
0
def init():
    ras_main.getFactory().register(CiscoRas,"Cisco")
Exemple #8
0
def init():
    ras_main.getFactory().register(MikrotikRas, "Mikrotik")
Exemple #9
0
def init():
    ras_main.getFactory().register(ChilliSpot, "ChilliSpot")
Exemple #10
0
def init():
    ras_main.getFactory().register(CiscoVPDNRas, "CiscoVPDN")
Exemple #11
0
def init():
    ras_main.getFactory().register(PersistentLanRas,"Persistent Lan")
Exemple #12
0
def init():
    ras_main.getFactory().register(BSAERas, "BSAE")
Exemple #13
0
def init():
    if not handlers_manager.getManager().handlerRegistered("asterisk"):
        handlers_manager.getManager().registerHandler(AsteriskHandler())

    ras_main.getFactory().register(AsteriskRas, "Asterisk")
Exemple #14
0
def init():
    ras_main.getFactory().register(GnuGKRas, "GnuGk")
Exemple #15
0
    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)
Exemple #16
0
def init():
    ras_main.getFactory().register(PortMasterRas, "PortMaster")
Exemple #17
0
def init():
    ras_main.getFactory().register(GnuGKRas,"GnuGk")
Exemple #18
0
def init():
    ras_main.getFactory().register(TotalControlRas, "Total Control")
Exemple #19
0
def init():
    ras_main.getFactory().register(PPPDRas,"pppd")
Exemple #20
0
def init():
    ras_main.getFactory().register(SerRas, "Ser")
Exemple #21
0
def init():
    ras_main.getFactory().register(PPPDRas, "pppd")
Exemple #22
0
def init():
    ras_main.getFactory().register(QuintumTenorRas,"Quintum Tenor")
Exemple #23
0
def init():
    ras_main.getFactory().register(MVTSRas, "MVTS")
Exemple #24
0
def init():
    ras_main.getFactory().register(PortSlaveRas, "Portslave")