[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/admin/ -> phpshell.php (source)

   1  <?php
   2  /**
   3   * $Horde: horde/admin/phpshell.php,v 1.24.10.8 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::authenticationFailureRedirect();
  18  }
  19  
  20  $title = _("PHP Shell");
  21  require  HORDE_TEMPLATES . '/common-header.inc';
  22  require  HORDE_TEMPLATES . '/admin/common-header.inc';
  23  
  24  $apps_tmp = $registry->listApps();
  25  $apps = array();
  26  foreach ($apps_tmp as $app) {
  27      $apps[$app] = $registry->get('name', $app);
  28  }
  29  asort($apps);
  30  $application = Util::getFormData('app', 'horde');
  31  ?>
  32  <div style="padding:10px">
  33  <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
  34  <?php Util::pformInput() ?>
  35  
  36  <h1 class="header"><?php echo _("Application") ?></h1><br />
  37  <select name="app">
  38  <?php foreach ($apps as $app => $name): ?>
  39    <option value="<?php echo $app ?>"<?php if ($application == $app) echo ' selected="selected"' ?>><?php echo $name ?></option>
  40  <?php endforeach; ?>
  41  </select><br /><br />
  42  <?php
  43  
  44  if ($command = trim(Util::getFormData('php'))) {
  45      if (@file_exists($registry->get('fileroot', $application) . '/lib/base.php')) {
  46          include $registry->get('fileroot', $application) . '/lib/base.php';
  47      } else {
  48          $registry->pushApp($application);
  49      }
  50  
  51      require_once 'Horde/MIME/Viewer.php';
  52      require_once 'Horde/MIME/Viewer/source.php';
  53      $pretty = highlight_string('<?php ' . $command, true);
  54      $pretty = str_replace(array('&lt;?php ',
  55                                  '<font color="#000000"><font color="#007700">&lt;?</font><font color="#0000BB">php </font>',
  56                                  "\r\n",
  57                                  "\r",
  58                                  "\n",
  59                                  '<br />'),
  60                            array('',
  61                                  '',
  62                                  '',
  63                                  '',
  64                                  '',
  65                                  "\n"),
  66                            $pretty);
  67      $pretty = MIME_Viewer_Source::lineNumber(trim($pretty));
  68  
  69      echo '<h1 class="header">' . _("PHP Code") . '</h1><br />';
  70      echo $pretty;
  71  
  72      echo '<br /><h1 class="header">' . _("Results") . '</h1><br />';
  73      echo '<pre class="text">';
  74      eval($command);
  75      echo '</pre><br />';
  76  }
  77  ?>
  78  
  79  <textarea class="fixed" name="php" rows="10" cols="60">
  80  <?php if (!empty($command)) echo htmlspecialchars($command) ?></textarea>
  81  <br />
  82  <input type="submit" class="button" value="<?php echo _("Execute") ?>" />
  83  <?php echo Help::link('admin', 'admin-phpshell') ?>
  84  
  85  </form>
  86  </div>
  87  <?php
  88  
  89  require  HORDE_TEMPLATES . '/common-footer.inc';


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7