From 4c12ef0a4f7e819c91f0a720d1d85490798332d5 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 24 Oct 2008 00:32:46 +0000 Subject: Break out item that can be its own function --- usr/local/sbin/pfSsh.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'usr/local/sbin') diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php index 3bcb7ef..93c8f89 100755 --- a/usr/local/sbin/pfSsh.php +++ b/usr/local/sbin/pfSsh.php @@ -100,7 +100,7 @@ $show_help_text = << Sessions available for playback are:\n"; - system("cd /etc/phpshellsessions && ls /etc/phpshellsessions"); - echo "==> end of list.\n"; - $command = ""; + show_recordings(); + $command = ""; } if($first_command == "reset") { $playbackbuffer = ""; @@ -263,6 +256,16 @@ while($shell_active == true) { $playbackbuffer .= $command . "\n"; } +function show_recordings() { + conf_mount_rw(); + safe_mkdir("/etc/phpshellsessions"); + if($recording) + conf_mount_ro(); + echo "==> Sessions available for playback are:\n"; + system("cd /etc/phpshellsessions && ls /etc/phpshellsessions"); + echo "==> end of list.\n"; +} + function returnlastchar($command) { $commandlen = strlen($command); $endofstring = substr($command, ($commandlen-1)); -- cgit v1.1