#!/bin/sh
#####################################################################
# File: /srv/www/admin/phonebook_calls.cgi #
# Creation: 03.02.2001 tg #
# Modification: 20.06.2007 jk #
# Last Update: $Id$ #
#####################################################################
# phonebook_calls.cgi - show calls logged by telmond #
# angepaßte calls.cgi für die Verwendung mit OPT_Phonebook #
#####################################################################
# get main helper functions
. /srv/www/include/cgi-helper
dump_log()
{
imond-send "client-ip $REMOTE_ADDR" "telmond-log-file" | sed 's/.$//;/^OK/ d;s/^ //'
}
: ${FORM_action:=view}
# Security
check_rights "logs" "$FORM_action"
# Check if imond and telmond are running
if [ ! -f /var/run/telmond.pid -o ! -f /var/run/imond.port ]
then
show_html_header "$_MN_err"
show_error "$_MN_err" "Imond $_MN_or Telmond $_MN_notrun.
$_MN_rbfix"
show_html_footer
exit 1
fi
tmp="/tmp/$myname.$$"
case $FORM_action in
reset|$_MN_reset)
show_html_header "$_MN_resetting $_CALL_telmondlog ..." "refresh=1;url=$myname"
show_info "" "$_MN_resetting $_CALL_telmondlog ... `imond-send "client-ip $REMOTE_ADDR" "reset-telmond-log-file"`"
show_html_footer
;;
download|$_MN_download)
http_header download "ctype=text/plain;filename=calls.txt"
dump_log
;;
*)
# Build sed script
cat > $tmp.sed <<-EOF
s/^/
$_MN_date | $_MN_time | $_CALL_ingnr | $_CALL_dnr |
---|