from app.utils.priv_required import priv_required
from app.utils.render import render
from app import app
from config import V5Config

@app.route('/admin/config', methods=['GET'])
@priv_required('misc.admin-panel')
def adm_config():
    config = {k: getattr(V5Config, k) for k in [
        "DOMAIN", "DB_NAME", "USE_LDAP", "LDAP_ROOT", "LDAP_ENV",
        "ENABLE_GUEST_POST", "ENABLE_EMAIL_CONFIRMATION", "SEND_MAILS"
    ]}
    return render('admin/config.html', config=config)
