root/modules/branches/2.4/asterisk-cli/page.cli.php

Revision 6019, 1.9 kB (checked in by p_lindheimer, 4 years ago)

Merged revisions 6016-6017 via svnmerge from
http://svn.freepbx.org/modules/branches/2.5

........

r6016 | p_lindheimer | 2008-07-15 13:59:17 -0700 (Tue, 15 Jul 2008) | 1 line


#2917 run CLI commands through the manager to avoid secrity issues trying to exec commands

........

r6017 | p_lindheimer | 2008-07-15 14:02:03 -0700 (Tue, 15 Jul 2008) | 1 line


Module Publish Script: asterisk-cli 2.5.0

........

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /*
3  *  Written by Diego Iastrubni <diego.iastrubni@xorcom.com>
4  *  Copyright (C) 2005, Xorcom
5  *
6  *  All rights reserved.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  *  This code is derived from ASTLinux 0.3, from the file
22  *  /var/www/admin/asterisk.php
23  *
24  *  The original author of AST linux is:
25  *  Kristian Kielhofner - KrisCompanies, LLC - http://astlinux.org/
26  */
27
28
29 $txtCommand = isset($_POST['txtCommand'])?$_POST['txtCommand']:'';
30 ?>
31
32 <h2><?php echo _("Asterisk CLI")?></h2>
33
34 <form action="config.php?type=tool&display=cli" method="POST" enctype="multipart/form-data" name="frmExecPlus">
35   <table>
36     <tr>
37       <td class="label" align="right"><?php echo _("Command:")?></td>
38       <td class="type"><input name="txtCommand" type="text" size="70" value="<?php htmlspecialchars($txtCommand);?>"></td>
39     </tr>
40     
41     <tr>
42       <td valign="top">   </td>
43       <td valign="top" class="label">
44         <input type="submit" class="button" value="<?php echo _("Execute:")?>">
45       </td>
46     </tr>
47     
48     <tr>
49       <td height="8"></td>
50       <td></td>
51     </tr>
52   </table>
53 </form>
54
55 <p>
56 <?php if (isBlank($txtCommand)): ?>
57 </p>
58 <?php endif;
59
60 function isBlank( $arg ) { return ereg( "^\s*$", $arg ); }
61
62 if (!isBlank($txtCommand))
63 {
64   $html_out = cli_runcommand($txtCommand);
65   echo $html_out;
66 }
67
68 ?>
Note: See TracBrowser for help on using the browser.