#!/bin/sh
. /etc/control.d/functions

CONFIG=/etc/httpd/conf/addon-modules/phpMyAdmin.conf

new_subst disabled \
        '^#[[:space:]]*Allow from all$' \
        's,^\([[:space:]]*Allow from all\)$,#\1,'

new_subst disabled \
        '^#[[:space:]]*Allow from 127.0.0.1$' \
        's,^\([[:space:]]*Allow from 127.0.0.1\)$,#\1,'

new_subst restricted \
        '^#[[:space:]]*Allow from all' \
        's,^\([[:space:]]*Allow from all\),#\1,'

new_subst restricted \
        '^[[:space:]]*Allow from 127.0.0.1' \
        's,^#\([[:space:]]*Allow from 127.0.0.1\),\1,'

new_subst public \
        '^[[:space:]]*Allow from all' \
        's,^#\([[:space:]]*Allow from all\),\1,'

new_subst public \
        '^[[:space:]]*Allow from 127.0.0.1' \
        's,^#\([[:space:]]*Allow from 127.0.0.1\),\1,'


new_help disabled 'Disable access for phpMyAdmin'
new_help restricted 'Restriced access for phpMyAdmin '
new_help public 'Public access for phpMyAdmin '

new_summary 'Access for phpMyAdmin'

control_subst "$CONFIG" "$*"
