def GroupSecurityCreateIndex(HttpRequest): msglist = AppendMessageList(HttpRequest) ip = HttpRequest.META['REMOTE_ADDR'] logindetails = GetLoginDetails(HttpRequest) if( logindetails["userid"] == -1): msglist.append('Please Login to continue') HttpRequest.session[SESSION_MESSAGE] = msglist return HttpResponseRedirect('/user/login/') try: ContentTypeObj = ContentTypeFnx() StatesObj = StateFnx() PermissionObj = PermissionFnx() GroupObj = GroupFnx() ContentSecurityList = ContentTypeObj.getDjangoContentTypes() StatesList = StatesObj.ListAllStates() PermissionsList = PermissionObj.ListAllPermissions() GroupsList = GroupObj.ListAllGroups() if(ContentSecurityList[0] == 1 and StatesList[0] == 1 and PermissionsList[0] == 1 and GroupsList[0] == 1): ContentSecurityList = ContentSecurityList[1] StatesList = StatesList[1] PermissionsList = PermissionsList[1] GroupsList = GroupsList[1] HttpRequest.session[SESSION_MESSAGE] = msglist return render_to_response("SecuritySystem/GroupContentSecurity.html",{'ContentSecurityList':ContentSecurityList,'StatesList':StatesList,'PermissionsList':PermissionsList,'GroupList':GroupsList,'GroupSecurityInsert':'true','GroupSecurityList':'false'},context_instance=RequestContext(HttpRequest)) else: msglist.append('Error Occured while fetching your request') HttpRequest.session[SESSION_MESSAGE] = msglist HttpResponseRedirect('/message/') except: Logger_User.exception('[%s][%s] == EXCEPTION =='%('GroupSecurityCreate',ip)) msglist.append('Error Occured while fetching your request') HttpRequest.session[SESSION_MESSAGE] = msglist HttpResponseRedirect('/message/')
def ListAllContentTypes(HttpRequest): msglist = AppendMessageList(HttpRequest) ip = HttpRequest.META['REMOTE_ADDR'] logindetails = GetLoginDetails(HttpRequest) print logindetails if( logindetails["userid"] == -1): msglist.append('Please Login to continue') HttpRequest.session[SESSION_MESSAGE] = msglist return HttpResponseRedirect('/user/login/') try: print 'in try' ContentTypeObj = ContentTypeFnx() ContentTypeList = ContentTypeObj.getDjangoContentTypes() if(ContentTypeList[0] == 1): print ContentTypeList ContentTypeList = ContentTypeList[1] if( len (ContentTypeList) == 0): msglist.append('There are no content types in the system yet') HttpRequest.session[SESSION_MESSAGE] = msglist print 'here' return render_to_response("SecuritySystem/ContentType.html",{'ContentTypeList':ContentTypeList,'ListContentTypes':'true',},context_instance=RequestContext(HttpRequest)) else: print 'in else' msglist.append('Error Occured while fetching your request') HttpRequest.session[SESSION_MESSAGE] = msglist HttpResponseRedirect('/message/') except: Logger_User.exception('[%s][%s] == EXCEPTION =='%('ListAllContentTypes',ip)) msglist.append('Error Occured while fetching your request') HttpRequest.session[SESSION_MESSAGE] = msglist HttpResponseRedirect('/message/')
def ListAllContentTypes(HttpRequest): msglist = AppendMessageList(HttpRequest) ip = HttpRequest.META["REMOTE_ADDR"] logindetails = GetLoginDetails(HttpRequest) print logindetails if logindetails["userid"] == -1: msglist.append("Please Login to continue") HttpRequest.session[SESSION_MESSAGE] = msglist return HttpResponseRedirect("/user/login/") try: print "in try" ContentTypeObj = ContentTypeFnx() ContentTypeList = ContentTypeObj.getDjangoContentTypes() if ContentTypeList[0] == 1: print ContentTypeList ContentTypeList = ContentTypeList[1] if len(ContentTypeList) == 0: msglist.append("There are no content types in the system yet") HttpRequest.session[SESSION_MESSAGE] = msglist print "here" return render_to_response( "SecuritySystem/ContentType.html", {"ContentTypeList": ContentTypeList, "ListContentTypes": "true"}, context_instance=RequestContext(HttpRequest), ) else: print "in else" msglist.append("Error Occured while fetching your request") HttpRequest.session[SESSION_MESSAGE] = msglist HttpResponseRedirect("/message/") except: Logger_User.exception("[%s][%s] == EXCEPTION ==" % ("ListAllContentTypes", ip)) msglist.append("Error Occured while fetching your request") HttpRequest.session[SESSION_MESSAGE] = msglist HttpResponseRedirect("/message/")
def GroupSecurityCreateIndex(HttpRequest): msglist = AppendMessageList(HttpRequest) ip = HttpRequest.META["REMOTE_ADDR"] logindetails = GetLoginDetails(HttpRequest) if logindetails["userid"] == -1: msglist.append("Please Login to continue") HttpRequest.session[SESSION_MESSAGE] = msglist return HttpResponseRedirect("/user/login/") try: ContentTypeObj = ContentTypeFnx() StatesObj = StateFnx() PermissionObj = PermissionFnx() GroupObj = GroupFnx() ContentSecurityList = ContentTypeObj.getDjangoContentTypes() StatesList = StatesObj.ListAllStates() PermissionsList = PermissionObj.ListAllPermissions() GroupsList = GroupObj.ListAllGroups() if ContentSecurityList[0] == 1 and StatesList[0] == 1 and PermissionsList[0] == 1 and GroupsList[0] == 1: ContentSecurityList = ContentSecurityList[1] StatesList = StatesList[1] PermissionsList = PermissionsList[1] GroupsList = GroupsList[1] HttpRequest.session[SESSION_MESSAGE] = msglist return render_to_response( "SecuritySystem/GroupContentSecurity.html", { "ContentSecurityList": ContentSecurityList, "StatesList": StatesList, "PermissionsList": PermissionsList, "GroupList": GroupsList, "GroupSecurityInsert": "true", "GroupSecurityList": "false", }, context_instance=RequestContext(HttpRequest), ) else: msglist.append("Error Occured while fetching your request") HttpRequest.session[SESSION_MESSAGE] = msglist HttpResponseRedirect("/message/") except: Logger_User.exception("[%s][%s] == EXCEPTION ==" % ("GroupSecurityCreate", ip)) msglist.append("Error Occured while fetching your request") HttpRequest.session[SESSION_MESSAGE] = msglist HttpResponseRedirect("/message/")