From 318f8871db3f93f5338b60e65ba02c8e93919b74 Mon Sep 17 00:00:00 2001 From: nagyrobi Date: Mon, 23 Sep 2013 14:24:04 +0200 Subject: Update asterisk_calls.php Trim and Clear should give an infobox now, + chmod and chown correctly set. --- config/asterisk/asterisk_calls.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/asterisk/asterisk_calls.php b/config/asterisk/asterisk_calls.php index 7fd75274..6a4f973e 100644 --- a/config/asterisk/asterisk_calls.php +++ b/config/asterisk/asterisk_calls.php @@ -61,11 +61,13 @@ $pfile = $break[count($break) - 1]; if (file_exists($callog)) switch ($cmd){ case "trim": - $trimres=shell_exec("tail -50 '$callog' > /tmp/trimmed.csv; rm '$callog'; mv /tmp/trimmed.csv '$callog'; chmod 666 '$callog'"); + $trimres=shell_exec("tail -50 '$callog' > /tmp/trimmed_asterisk.csv && rm '$callog' && mv /tmp/trimmed_asterisk.csv '$callog' && chown asterisk:asterisk '$callog' && chmod g+w '$callog'"); + header( 'Location: asterisk_calls.php?savemsg=Calls+log+trimmed.') ; break; case "clear": - $trimres=shell_exec("rm '$callog'; touch '$callog'; chmod 666 '$callog'"); + $trimres=shell_exec("rm '$callog' && touch '$callog' && chown asterisk:asterisk '$callog' && chmod g+w '$callog'"); + header( 'Location: asterisk_calls.php?savemsg=Calls+log+cleared.') ; break; case "download": @@ -91,6 +93,12 @@ if (file_exists($callog)) +
@@ -159,7 +167,7 @@ if (file_exists($callog)) This log is lost when rebooting the system."; + echo "
This log may be lost when rebooting the system."; ?> -- cgit v1.2.3