def getCurrentRecordsForDomain(request): try: userID = request.session['userID'] dm = DNSManager() return dm.getCurrentRecordsForDomain(userID, json.loads(request.body)) except KeyError: return redirect(loadLoginPage)
def addDeleteDNSRecords(request): try: userID = request.session['userID'] dm = DNSManager() return dm.addDeleteDNSRecords(request, userID) except KeyError: return redirect(loadLoginPage)
def createDNSZone(request): try: userID = request.session['userID'] dm = DNSManager() return dm.createDNSZone(request, userID) except KeyError: return redirect(loadLoginPage)
def saveNSConfigurations(request): try: userID = request.session['userID'] dm = DNSManager() return dm.saveNSConfigurations(userID, json.loads(request.body)) except KeyError: return redirect(loadLoginPage)
def configureDefaultNameServers(request): try: userID = request.session['userID'] dm = DNSManager() return dm.configureDefaultNameServers(request, userID) except KeyError: return redirect(loadLoginPage)
def submitZoneDeletion(request): try: userID = request.session['userID'] result = pluginManager.preSubmitZoneDeletion(request) if result != 200: return result dm = DNSManager() coreResult = dm.submitZoneDeletion(userID, json.loads(request.body)) result = pluginManager.postSubmitZoneDeletion(request, coreResult) if result != 200: return result return coreResult except KeyError: return redirect(loadLoginPage)
def addDNSRecord(request): try: userID = request.session['userID'] result = pluginManager.preAddDNSRecord(request) if result != 200: return result dm = DNSManager() coreResult = dm.addDNSRecord(userID, json.loads(request.body)) result = pluginManager.postAddDNSRecord(request, coreResult) if result != 200: return result return coreResult except KeyError: return redirect(loadLoginPage)