#!/bin/sh # set_debug=yes # get main helper functions . /srv/www/include/cgi-helper check_rights "oac" "view" _rshort=5 # short reload (5) _rurl=$myname # reload-url configfile=/var/run/oac.cfg configfile_groups=/var/run/oac-groups.cfg show_html_header "Online Access Control" "cssfile=status" OAC_GROUP_N=0 if [ -f $configfile_groups ] then . $configfile_groups fi filter='' skip=0 group=0 if [ 0${FORM_group} -gt 0 -a 0${FORM_group} -le $OAC_GROUP_N ] then group=${FORM_group} fi show_tab_header "$_OAC_tab_header" no invisible="no" tabsused=0 tabs='' if [ $OAC_GROUP_N -gt 0 ] then tabs='' for i in `seq 0 $OAC_GROUP_N` do if [ $i -eq 0 ] then if [ "$OAC_ALL_INVISIBLE" = "yes" ] then invisible='yes' else tabs="\"$_OAC_tab_all\"" tabsused=`expr $tabsused + 1` fi else eval invisible=\$OAC_GROUP_${i}_INVISIBLE if [ "$invisible" != "yes" ] then eval tabname=\$OAC_GROUP_${i}_NAME tabs="$tabs \"$tabname\"" tabsused=`expr $tabsused + 1` fi fi if [ "$invisible" != "yes" ] then if [ "$OAC_ALL_INVISIBLE" = "yes" -a "$group" -eq 0 ] then group=$i fi if [ $group = $i ] then tabs="$tabs \"no\"" else tabs="$tabs \"$myname?group=$i\"" fi fi done if [ "$tabsused" -gt 1 ] then eval "show_tab_header $tabs" fi fi if [ $group -gt 0 ] then eval numclients=\$OAC_GROUP_${group}_CLIENT_N filter='^ ' for i in `seq 1 $numclients` do eval client=\$OAC_GROUP_${group}_CLIENT_$i filter="$filter $client" done filter="$filter \$" fi eval `set | sed -n 's/^\(FORM_action\)\(\(un\|\)block\(group\|\)\)\(\(num\)\([0-9]\+\)\|\)\(delay[12]\|\)=.*/\1=\2;num=\7;mode=\8/p'` # set | grep "^FORM_" | show_info "Environment" if [ -n "${FORM_action}" ] then case ${FORM_action} in block|unblock) eval limit=\$FORM_limit_$num;; blockgroup|unblockgroup) limit=$FORM_limit;; esac fi # Reverse action if delayed action is selected if [ "$mode" = "delay1" -o "$mode" = "delay2" ] then if [ "$mode" != "delay1" -o "$limit" -gt 0 ] then case ${FORM_action} in block) FORM_action="unblock";; unblock) FORM_action="block";; blockgroup) FORM_action="unblockgroup";; unblockgroup) FORM_action="blockgroup";; esac fi fi if [ -n "${FORM_action}" ] then case ${FORM_action} in block|unblock) /usr/local/bin/oac.sh $FORM_action limit=$limit $num >/dev/null 2>&1;; blockgroup|unblockgroup) /usr/local/bin/oac.sh $FORM_action limit=$limit $FORM_group >/dev/null 2>&1;; esac fi limits=`sed "s/\\$_OAC_text_hours/$_OAC_text_hours/" /var/run/oac-limits.cfg` echo "
" if [ "$tabsused" -gt 1 ] then eval "show_tab_footer $tabs" fi show_tab_footer show_html_footer