Ejemplo n.º 1
0
            }
            header("Location: ".urlStrRedirect("base/computers/$actionpage", array('tab'=>$tab, 'uuid'=>$_GET['uuid'], 'hostname'=>$_GET['hostname'], 'cmd_id'=>$id, 'gid'=>$_GET['gid'])));
            exit;
        }
    }
}

$action = $_GET['launchAction'];

if (isset($_POST["bconfirm"]) || isset($_POST["badvanced"])) {
    $is_advanced = isset($_POST["badvanced"]);
    /* quick action on a single target */
    if (isset($_GET['uuid'])) {
        $machine = getMachine(array('uuid'=>$_GET['uuid']), True);
        action($_GET['launchAction'], array($machine->uuid), $is_advanced);
    }

    /* single action post on a group */
    if (isset($_GET['gid'])) {
        $group = new Group($_GET['gid'], true);
        action($_GET['launchAction'], null, $is_advanced);
    }
} else {
    $f = new PopupForm(_T("Please confirm you really want to perform this action", "msc"));
    $f->addValidateButton("bconfirm");
    $f->addButton("badvanced", _T('Advanced', 'msc'));
    $f->addCancelButton("bback");
    $f->display();
}
?>
Ejemplo n.º 2
0
require_once "includes/xmlrpc.inc.php";
require_once 'modules/backuppc/includes/xmlrpc.php';
if (isset($_POST["bfull"], $_POST["uuid"])) {
    // Starting Full backup
    start_full_backup($_POST["uuid"]);
    return;
} elseif (isset($_POST["bincr"], $_POST["uuid"])) {
    // Starting Full backup
    start_incr_backup($_POST["uuid"]);
    return;
} else {
    /* Form displaying */
    $title = _T("Choose the backup type.", 'backuppc');
    $f = new PopupForm($title, 'backupManualAction');
    $f->add(new HiddenTpl("uuid"), array("value" => $_GET['objectUUID'], "hide" => True));
    $f->addButton("bfull", _T('Full backup', 'backuppc'));
    $f->addButton("bincr", _T('Incremental backup', 'backuppc'));
    //$f->addCancelButton("bback");
    $f->display();
}
?>
<script type="text/javascript">
    jQuery(function() {
        var $ = jQuery;
        $('form#backupManualAction').find('input[type=submit]').click(function() {
            var form = $('form#backupManualAction');
            $.ajax(form.attr('action'), {
                type: form.attr('method'),
                data: form.serialize() + '&' + $(this).attr('name') + '=' + $(this).val()
            }).success(function() {
                pushSearch();
Ejemplo n.º 3
0
$status_strings = array('no ping' => '<span style="color:red">' . _T('No ping response', 'backuppc') . '</span>', 'backup failed' => '<span style="color:red">' . _T('Backup failed', 'backuppc') . '</span>', 'restore failed' => '<span style="color:red">' . _T('Restore failed', 'backuppc') . '</span>', 'backup_done' => '<span style="color:green">' . _T('Backup up to date', 'backuppc') . '</span>', 'restore done' => '<span style="color:green">' . _T('Restore done', 'backuppc') . '</span>', 'nothing' => '<span style="color:red">' . _T('This computer has never been backed up', 'backuppc') . '</span>', 'idle' => '<span style="color:black">' . _T('Idle', 'backuppc') . '</span>', 'canceled' => '<span style="color:black">' . _T('Cancelled by user', 'backuppc') . '</span>', 'in progress' => '<img src="modules/msc/graph/images/status/inprogress.gif" width="14" alt="" /> <span style="color:orange">' . _T('Backup in progress') . '</span>');
print '<table><tr><td width="130" valign="top">' . _T('Current state: ', 'backuppc') . '</td><td><b id="statustext">';
foreach ($response['status'] as $line) {
    print $status_strings[$line] . '<br/>';
}
if ($line == 'nothing') {
    $nerverbackuped = 1;
}
print "</b></td></tr></table>";
// ==========================================================
// User actions Form
// ==========================================================
$f = new PopupForm("");
$hidden = new HiddenTpl("host");
$f->add($hidden, array("value" => $uuid, "hide" => True));
$f->addButton("startFullBackup", _T("Start Full Backup", 'backuppc'));
if (!isset($nerverbackuped)) {
    $f->addButton("startIncrBackup", _T("Sart Incr Backup", 'backuppc'));
}
$f->addButton("stopBackup", _T("Stop Backup", 'backuppc'));
$f->display();
// ==========================================================
// Backup status table
// ==========================================================
if ($response['data']) {
    $backup_nums = $response['data']['backup_nums'];
    $types = $response['data']['type'];
    $ages = $response['data']['ages'];
    $start_dates = $response['data']['start_dates'];
    $durations = $response['data']['durations'];
    $xfer_errs = $response['data']['xfer_errs'];