root/modules/branches/2.11/asterisk-cli/functions.inc.php
| Revision 13091, 1.4 kB (checked in by p_lindheimer, 1 year ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } |
| 3 | //This file is part of FreePBX. |
| 4 | // |
| 5 | // FreePBX is free software: you can redistribute it and/or modify |
| 6 | // it under the terms of the GNU General Public License as published by |
| 7 | // the Free Software Foundation, either version 2 of the License, or |
| 8 | // (at your option) any later version. |
| 9 | // |
| 10 | // FreePBX is distributed in the hope that it will be useful, |
| 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | // GNU General Public License for more details. |
| 14 | // |
| 15 | // You should have received a copy of the GNU General Public License |
| 16 | // along with FreePBX. If not, see <http://www.gnu.org/licenses/>. |
| 17 | // |
| 18 | // Written by Diego Iastrubni <diego.iastrubni@xorcom.com> |
| 19 | // Copyright (C) 2005, Xorcom |
| 20 | // |
| 21 | // This code is derived from ASTLinux 0.3 |
| 22 | // |
| 23 | // The original author of AST linux is: |
| 24 | // Kristian Kielhofner - KrisCompanies, LLC - http://astlinux.org/ |
| 25 | // |
| 26 | |
| 27 | function cli_runcommand($txtCommand) { |
| 28 | global $astman; |
| 29 | |
| 30 | if ($astman) { |
| 31 | |
| 32 | $html_out = "<pre>"; |
| 33 | $response = $astman->send_request('Command',array('Command'=>"$txtCommand")); |
| 34 | $response = explode("\n",$response['data']); |
| 35 | unset($response[0]); //remove the Priviledge Command line |
| 36 | $response = implode("\n",$response); |
| 37 | $html_out .= htmlspecialchars($response); |
| 38 | $html_out .= "</pre>"; |
| 39 | return $html_out; |
| 40 | } |
| 41 | } |
| 42 | ?> |
| 43 |
Note: See TracBrowser for help on using the browser.
