#!/usr/bin/env python3 import html import cgi import sys import os import funct from configparser import ConfigParser, ExtendedInterpolation funct.head("Admin area: View settings") funct.check_config() funct.check_login() funct.page_for_admin() path_config = "haproxy-webintarface.config" config = ConfigParser(interpolation=ExtendedInterpolation()) config.read(path_config) fullpath = config.get('main', 'fullpath') print('

Admin area: View settings

' '
' '

Only view, edit you can here: {fullpath}/haproxy-webintarface.config

' '
'.format(fullpath=fullpath))

for section_name in config.sections():
    print('Section:', section_name)
    for name, value in config.items(section_name):
        print('  {} = {}'.format(name, value))
    print()

print('
') funct.footer()