def fw(req, name, params): location = 'admin:fw' # get current config config = vsutil.fw_get_config(name)['CURRENT'] body_tmpl = _tmpl_path('fw_body.html') mode = config['mode'] if mode == 'block': rules = config['open'] else: rules = config['close'] body_vars = {'mode': mode, 'rules': rules} vars = {'global_menu': _global_menu(req, name, location), 'body':psp.PSP(req, body_tmpl, vars=body_vars), 'name':name} p = psp.PSP(req, _tmpl_path('main_frame.html'), vars=vars) p.run() return apache.OK
def fw(req, name, params): location = 'admin:fw' # get current config config = vsutil.fw_get_config(name)['CURRENT'] body_tmpl = _tmpl_path('fw_body.html') mode = config['mode'] if mode == 'block': rules = config['open'] else: rules = config['close'] body_vars = {'mode': mode, 'rules': rules} vars = { 'global_menu': _global_menu(req, name, location), 'body': psp.PSP(req, body_tmpl, vars=body_vars), 'name': name } p = psp.PSP(req, _tmpl_path('main_frame.html'), vars=vars) p.run() return apache.OK
def block(req, name, params): location = 'admin:block' # get current config ips = vsutil.fw_get_config(name)['BLOCK'] body_tmpl = _tmpl_path('block_body.html') body_vars = {'ips': ' '.join(ips)} vars = {'global_menu': _global_menu(req, name, location), 'body':psp.PSP(req, body_tmpl, vars=body_vars), 'name':name} p = psp.PSP(req, _tmpl_path('main_frame.html'), vars=vars) p.run() return apache.OK
def block(req, name, params): location = 'admin:block' # get current config ips = vsutil.fw_get_config(name)['BLOCK'] body_tmpl = _tmpl_path('block_body.html') body_vars = {'ips': ' '.join(ips)} vars = { 'global_menu': _global_menu(req, name, location), 'body': psp.PSP(req, body_tmpl, vars=body_vars), 'name': name } p = psp.PSP(req, _tmpl_path('main_frame.html'), vars=vars) p.run() return apache.OK