<?php
require 'kmd.php';
class kmd_shell extends kmd { function inv($host) { return $host . ':' . getcwd() . '# '; } function ret($line) { $line = trim($line); if (substr($line, 0, 2) == 'cd') { chdir(substr($line, 3)); return "\n"; } elseif ($line == 'exit') return false; else return shell_exec($line); } }
$kmd_shell = new kmd_shell(get_current_user() . '@' . php_uname('n')); $kmd_shell->run();
?>
|