[ Index ] |
|
Code source de Horde 3.1.3 |
1 <?php 2 /** 3 * $Horde: horde/admin/cmdshell.php,v 1.9.10.6 2006/02/24 22:48:29 chuck Exp $ 4 * 5 * Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org> 6 * 7 * See the enclosed file COPYING for license information (LGPL). If you 8 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. 9 */ 10 11 @define('HORDE_BASE', dirname(__FILE__) . '/..'); 12 require_once HORDE_BASE . '/lib/base.php'; 13 require_once 'Horde/Menu.php'; 14 require_once 'Horde/Help.php'; 15 16 if (!Auth::isAdmin()) { 17 Horde::fatal('Forbidden.', __FILE__, __LINE__); 18 } 19 20 $title = _("Command Shell"); 21 require HORDE_TEMPLATES . '/common-header.inc'; 22 require HORDE_TEMPLATES . '/admin/common-header.inc'; 23 24 echo '<div style="padding:10px">'; 25 if ($command = trim(Util::getFormData('cmd'))) { 26 echo '<h1 class="header">' . _("Command") . ':</h1><br />'; 27 echo '<p class="text"><code>' . nl2br(htmlspecialchars($command)) . '</code></p>'; 28 29 echo '<br /><h1 class="header">' . _("Results") . ':</h1><br />'; 30 echo '<pre class="text">'; 31 32 $cmds = explode("\n", $command); 33 foreach ($cmds as $cmd) { 34 $cmd = trim($cmd); 35 if (strlen($cmd)) { 36 unset($results); 37 flush(); 38 echo htmlspecialchars(shell_exec($cmd)); 39 } 40 } 41 42 echo '</pre><br />'; 43 } 44 ?> 45 46 <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"> 47 <?php Util::pformInput() ?> 48 <textarea class="fixed" name="cmd" rows="10" cols="60"> 49 <?php if (!empty($command)) echo htmlspecialchars($command) ?></textarea> 50 <br /> 51 <input type="submit" class="button" value="<?php echo _("Execute") ?>" /> 52 <?php echo Help::link('admin', 'admin-cmdshell') ?> 53 54 </form> 55 </div> 56 <?php 57 58 require HORDE_TEMPLATES . '/common-footer.inc';
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |