Ejemplo n.º 1
0
 }
 if (!is_array($d)) {
     $a_date[] = _toDate(array(1970, 1, 1, 0, 0, 0));
 } else {
     $a_date[] = _toDate($d);
 }
 if ($uuid) {
     $a_client[] = $cmd['title'];
 } else {
     $a_client[] = $coh['host'];
 }
 $proxy_id = $coh['fk_use_as_proxy'];
 $proxy_str = '';
 if ($proxy_id != '') {
     if ($proxies[$proxy_id] == '') {
         $lp = get_commands_on_host($proxy_id);
         $proxies[$proxy_id] = $lp['host'];
     }
     $proxy_str = sprintf(_T(', using proxy %s', 'msc'), $proxies[$proxy_id]);
 }
 if ($cmd['proxy_mode'] == 'none') {
     if ($pull_mode) {
         $a_mode[] = '<img style="vertical-align: middle;" title="' . _T('Pull', 'msc') . '" src="modules/msc/graph/images/proxy/pull.gif"/> ';
     } else {
         $a_mode[] = '<img style="vertical-align: middle;" title="' . _T('Normal', 'msc') . '" src="modules/msc/graph/images/proxy/no_proxy.png"/> ';
     }
 } elseif ($cmd['proxy_mode'] == 'split') {
     if ($coh['order_in_proxy'] == '') {
         $a_mode[] = '<img style="vertical-align: middle;" title="' . sprintf(_T('Multiple, client mode%s', 'msc'), $proxy_str) . '" src="modules/msc/graph/images/proxy/proxy_client.png"/> ';
     } else {
         $a_mode[] = '<img style="vertical-align: middle;" title="' . _T('Multiple, server mode', 'msc') . '" src="modules/msc/graph/images/proxy/proxy_server.png"/> ';
Ejemplo n.º 2
0
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC.  If not, see <http://www.gnu.org/licenses/>.
 */
require 'modules/msc/includes/commands_xmlrpc.inc.php';
require 'modules/msc/includes/functions.php';
if (strlen($_GET['cmd_id'])) {
    $cmd_id = $_GET['cmd_id'];
    $coh_ids = get_id_command_on_host($cmd_id);
    $coh = get_commands_on_host($coh_ids[0]);
    $title = get_command_on_host_title($cmd_id);
    $title = sprintf(_T("Command '%s' state concerning <b>%s</b>", "msc"), $title, $coh['host']);
    print "<h3>{$title}</h3>";
    $statusTable = getStatusTable();
    print '<table width="100%">';
    print '<tr><th>' . _T('Current State', 'msc') . '</th><th>' . _T('uploaded', 'msc') . '</th><th>' . _T('executed', 'msc') . '</th><th>' . _T('deleted', 'msc') . '</th></tr>';
    print '<tr><td>' . $statusTable[$coh['current_state']] . '</td>';
    print '<td width="33%"><img style="vertical-align: middle;" alt="' . $coh['uploaded'] . '" src="modules/msc/graph/images/status/' . return_icon($coh['uploaded']) . '"/></td> ';
    print '<td width="33%"><img style="vertical-align: middle;" alt="' . $coh['executed'] . '" src="modules/msc/graph/images/status/' . return_icon($coh['executed']) . '"/></td> ';
    print '<td width="33%"><img style="vertical-align: middle;" alt="' . $coh['deleted'] . '" src="modules/msc/graph/images/status/' . return_icon($coh['deleted']) . '"/></td> ';
    print '</tr></table>';
} else {
    print _T("error : cmd_id must be given", "msc");
}
Ejemplo n.º 3
0
 function CommandHistory($coh_id)
 {
     // TODO : ch is a list, we have to chose the good one (ie : the most recent date)
     $this->db_ch = get_command_history($coh_id);
     $this->db_coh = get_commands_on_host($coh_id);
     if ($this->db_coh['fk_use_as_proxy']) {
         $this->db_lproxy = get_commands_on_host($this->db_coh['fk_use_as_proxy']);
     } else {
         $this->db_lproxy = NULL;
     }
     $this->db_cmd = command_detail($this->db_coh['fk_commands']);
 }