Exemple #1
0
'<cpi:offlineImage cpi:source="catalog:d:/sources/install_windows 81 ultimate.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />',
'</unattend>',
].join('\r\n');

</script>
<?php 
require "../../../includes/config.inc.php";
require "../../../includes/i18n.inc.php";
require "../../../includes/acl.inc.php";
require "../../../includes/session.inc.php";
require "../../../includes/PageGenerator.php";
require "../includes/data_Windows_Answer_File_Generator.inc.php";
$f = new ValidatingForm();
$f->add(new HiddenTpl("codeToCopy"), array("value" => "", "hide" => True));
$tableformAWFG = new Table();
$f->push($tableformAWFG);
//------------------
//------------------
$f->add(new TrFormElement("", new multifieldTpl(array(new SpanElement(_T("Installation Notes", "imaging")), new Iconereply('Installation_Notes', $InfoBule_Installation_Notes)))));
//_____________
$f->add(new TrFormElement(_T('Title', 'imaging'), new InputTplTitle('Location', "name file xml")), array("required" => True));
//_____________
$f->add(new TrFormElement("Notes" . ":", new TextareaTpl('Comments')));
//------------------
//------------------
$f->add(new TrFormElement("", new multifieldTpl(array(new SpanElement(_T("General Settings", "imaging")), new Iconereply('General_Settings', $InfoBule_General_Settings)))));
//_____________
$key1 = new InputTplTitle('ProductKey1', $InfoBule_ProductKey);
$key1->setSize(5);
$key2 = new InputTplTitle('ProductKey2', $InfoBule_ProductKey);
$key2->setSize(5);
Exemple #2
0
    if (isAuthoritative($subnetInfos)) {
        $authoritative = "CHECKED";
    } else {
        $authoritative = "";
    }
    $poolsRanges = getPoolsRanges($subnet);
    $hasSubnetPools = count($poolsRanges) ? "checked" : "";
}
if ($_GET["action"] == "subnetadd") {
    $formElt = new IPInputTpl("subnet");
    $authoritative = "";
} else {
    $formElt = new HiddenTpl("subnet");
}
$f = new ValidatingForm();
$f->push(new Table());
$f->add(new TrFormElement(_T("DHCP subnet address"), $formElt), array("value" => $subnet, "required" => True));
$f->add(new TrFormElement(_T("Netmask"), new NetmaskInputTpl("netmask")), array("value" => $netmask, "required" => True, "extra" => _T("(e.g. 24 for a /24 network)")));
$f->add(new TrFormElement(_T("Description"), new IA5InputTpl("description")), array("value" => $description));
$f->add(new TrFormElement(_T("Authoritative"), new CheckboxTpl("authoritative")), array("value" => $authoritative));
$f->pop();
$f->push(new Table());
$f->add(new TrFormElement(_T("DHCP options related to clients network parameters"), new HiddenTpl("")));
$f->add(new TrFormElement(_T("Broadcast address"), new IPInputTpl("broadcast-address")), array("value" => $options["broadcast-address"]));
$f->add(new TrFormElement(_T("Domain name"), new IA5InputTpl("domain-name"), array("tooltip" => _T("Domain name that will be appended to the client's hostname to form a fully-qualified domain-name (FQDN).") . "<br/>" . _T("If the domain name is a registered DNS domain, the subnet will be associated to the DNS domain.") . "<br/>" . _T("You can set more than one domain, separated by spaces. They will be added to the DHCP client DNS domain search path."))), array("value" => $options["domain-name"], "extra" => _T("Links the subnet to a DNS zone")));
$f->add(new TrFormElement(_T("Routers"), new HostIpListInputTpl("routers"), array("tooltip" => _T("List of routers (gateways) on client's subnet."))), array("value" => $options["routers"]));
$f->add(new TrFormElement(_T("Domain name servers"), new HostIpListInputTpl("domain-name-servers"), array("tooltip" => _T("DNS name servers available to the client. Separate servers addresses with ','."))), array("value" => $options["domain-name-servers"]));
$f->add(new TrFormElement(_T("NTP servers"), new HostIpListInputTpl("ntp-servers"), array("tooltip" => _T("Network Time Protocol servers available to the client. Separate servers addresses with ','."))), array("value" => $options["ntp-servers"]));
$f->add(new TrFormElement(_T("Proxy auto config URL"), new IA5InputTpl("local-pac-server"), array("tooltip" => _T("Automatic proxy configuration URL (PAC)."))), array("value" => $options["local-pac-server"]));
$f->add(new TrFormElement(_T("WINS servers"), new HostIpListInputTpl("netbios-name-servers"), array("tooltip" => _T("Netbios name servers available to Windows clients, listed in order of preference. Separate servers addresses with ','."))), array("value" => $options["netbios-name-servers"]));
$winsclient = new SelectItem("netbios-node-type");
Exemple #3
0
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/samba/includes/machines.inc.php";
require "modules/samba/includes/samba.inc.php";
require "modules/samba/mainSidebar.php";
require "graph/navbar.inc.php";
if (isset($_POST["baddmach"])) {
    $machine = $_POST["machine"];
    $comment = stripslashes($_POST["comment"]);
    add_machine($machine, $comment);
    if (!isXMLRPCError()) {
        new NotifyWidgetSuccess(sprintf(_T("Computer %s successfully added"), $machine));
        header("Location: " . urlStrRedirect("samba/machines/index"));
        exit;
    }
}
$p = new PageGenerator(_T("Add a computer"));
$p->setSideMenu($sidemenu);
$p->display();
$f = new ValidatingForm();
$f->addSummary(_T("The computer name can only contains letters lowercase and numbers, and must begin with a letter."));
$f->push(new Table());
$f->add(new TrFormElement(_T("Computer name"), new NetbiosInputTpl("machine")), array("value" => $machine, "required" => True));
$f->add(new TrFormElement(_T("Comment"), new InputTpl("comment")), array("value" => $comment));
$f->pop();
$f->pop();
$f->addValidateButton("baddmach");
$f->display();
Exemple #4
0
}
if (isset($_POST["bsave"])) {
    $ret = save_smbconf();
    if (!isXMLRPCError()) {
        new NotifyWidgetSuccess(sprintf(_T("SAMBA configuration saved. You may need to reload or restart the SAMBA service.")));
    }
}
require "modules/samba4/mainSidebar.php";
require "graph/navbar.inc.php";
$p = new PageGenerator(_T("General options"));
$p->setSideMenu($sidemenu);
$p->display();
$smb = get_smbconf();
#print $smb;
$f = new ValidatingForm();
$f->push(new Table());
#if ($smb["pdc"])
#    $workgroupTpl = new HiddenTpl("workgroup");
#else
$workgroupTpl = new HiddenTpl("realm");
$f->add(new TrFormElement(_T("Domain name"), $workgroupTpl), array("value" => $smb["realm"], "required" => True));
$f->add(new TrFormElement(_T("Server name"), new HiddenTpl("netbios name")), array("value" => $smb["netbios name"], "required" => True));
$value = "";
#if ($smb["pdc"]) $value = "checked";
#$f->add(
#        new TrFormElement(_T("This server is a PDC"),new CheckboxTpl("pdc")),
#        array("value" => $value)
#);
#$f->add(
#        new TrFormElement(_T("This server is a WINS server"),new CheckboxTpl("wins support")),
#        array("value" => getCheckedState($smb, "wins support"))
 function display_ordered($orders)
 {
     $f = new ValidatingForm();
     $f->push(new Table());
     foreach ($this->members as $pid => $plabel) {
         $select = new SelectItem($this->input_pre . base64_encode($pid));
         $select->setElements($this->c);
         $select->setElementsVal($this->c);
         $select->setSelected($orders[$pid]);
         $f->add(new TrFormElement($plabel, $select, array()));
     }
     foreach ($this->getHidden() as $w) {
         $f->add($w[0], $w[1]);
     }
     $this->display_options($f);
     $f->pop();
     foreach ($this->buttons as $b) {
         $f->addButton($b[0], $b[1], $b[2]);
     }
     $f->display();
 }
Exemple #6
0
    function create_form($is_image, $image, $target_uuid, $label, $desc) {
        if ($is_image) {
            printf("<h3>"._T("Edition of image", "imaging")." : <em>%s</em></h3>", $label);
        } else {
            printf("<h3>"._T("Edition of master", "imaging")." : <em>%s</em></h3>", $label);
        }

        $f = new ValidatingForm();
        $f->add(new HiddenTpl('target_uuid'),                   array("value" => $target_uuid,                   "hide" => True));
        $f->add(new HiddenTpl("itemlabel"),                     array("value" => $label,                         "hide" => True));
        $f->add(new HiddenTpl('target_uuid'),                   array("value" => $target_uuid,                   "hide" => True));
        $f->push(new Table());
        $f->add(
            new TrFormElement(_T("Label", "imaging"), new InputTpl("image_label")),
            array("value" => $label)
        );
        $f->add(
            new TrFormElement(_T("Description", "imaging"), new InputTpl("image_description")),
            array("value" => $desc)
        );

        $f->pop();
        if (!$is_image) {
            list($a, $post_installs) = xmlrpc_getAllTargetPostInstallScript($target_uuid);
            $f = get_post_install_scripts($f, $image['post_install_scripts'], $post_installs);
        }
        return $f;
    }
Exemple #7
0
$p->setSideMenu($sidemenu);
$p->display();
// create the form
$f = new ValidatingForm(array('method' => 'POST', 'enctype' => 'multipart/form-data'));
// add submit button
$f->addValidateButton("buser");
// enable/disable buttons
if ($mode == 'edit') {
    $f->addButton("enableAccount", _("Enable account"), "btnSecondary");
    $f->addButton("disableAccount", _("Disable account"), "btnSecondary");
}
// add reset form button
$f->addCancelButton("breset");
// add all modules forms to the edit form
$modules = callPluginFunction("baseEdit", array($FH, $mode));
foreach ($modules as $module => $editForm) {
    $f->push($editForm);
    $f->pop();
}
// display the form
$f->display();
?>
<script type="text/javascript">
jQuery(function(){
    var $ = jQuery;
    $('input.btnPrimary').click(function () {
        $('select#secondary.list option').prop('selected', true);
    });
});
</script>
    }
    // add info messages
    if ($result) {
        $services = getServicesNames();
        $resultPopup->add('<div class="alert alert-success">' . $result . '</div>');
        handleServicesModule($resultPopup, array($services[1] => "DHCP"));
    }
    if (!$error) {
        header("Location: " . urlStrRedirect("network/network/services"));
        exit;
    }
}
$f = new ValidatingForm();
$f->addValidateButton("bdhcpfailover");
$f->addCancelButton("breset");
$f->push(new Table());
$f->add(new TrFormElement(_T("Enable DHCP failover"), new CheckboxTpl("dhcp_failover")), array("value" => $show ? "checked" : "", "extraArg" => 'onclick="toggleVisibility(\'dhcpfailoverdiv\');"'));
$f->pop();
$dhcpfailoverdiv = new Div(array("id" => "dhcpfailoverdiv"));
$dhcpfailoverdiv->setVisibility($show);
$f->push($dhcpfailoverdiv);
$f->push(new Table());
$f->add(new TrFormElement(_T("Primary DHCP server name"), new HiddenTpl("primary")), array("value" => $FH->getArrayOrPostValue("primary")));
$f->add(new TrFormElement(_T("Primary DHCP IP address"), new IPInputTpl("primaryIp")), array("value" => $FH->getArrayOrPostValue("primaryIp"), "required" => true));
$f->pop();
$f->push(new DivExpertMode());
$f->push(new Table());
$f->add(new TrFormElement(_T("Primary DHCP failover port"), new InputTpl("primaryPort"), array("tooltip" => _T("TCP port where the server listen to failover messages", "network"))), array("value" => $FH->getArrayOrPostValue("primaryPort"), "required" => true));
$f->pop();
$f->pop();
$f->push(new Table());
Exemple #9
0
            new NotifyWidgetSuccess(_T("SSH public keys updated.", "sshlpk"));
        }
    } else {
        if (!$showSshkeys && hasSshKeyObjectClass($uid)) {
            delSSHKeyObjectClass($uid);
            if (!isXMLRPCError()) {
                new NotifyWidgetSuccess(_T("SSH public keys attributes deleted.", "sshlpk"));
            }
        }
    }
    redirectTo(urlStrRedirect('base/users/sshkeys'));
}
$p = new PageGenerator(_T("Change your SSH keys", "sshlpk"));
$p->setSideMenu($sidemenu);
$p->display();
$show = hasSshKeyObjectClass($uid);
$f = new ValidatingForm();
$f->push(new Table());
$f->add(new TrFormElement(_T("Enable SSH keys management", "sshlpk"), new CheckboxTpl("showusersshkey")), array("value" => $show ? "checked" : "", "extraArg" => 'onclick="toggleVisibility(\'sshkeydiv\');"'));
$f->pop();
$sshkeydiv = new Div(array("id" => "sshkeydiv"));
$sshkeydiv->setVisibility($show);
$f->push($sshkeydiv);
if ($show) {
    $sshkeys = getAllSshKey($uid);
} else {
    $sshkeys = array("0" => "");
}
$f->add(new TrFormElement('', new MultipleInputTpl("sshuserkeys", _T("Public SSH Key", "sshlpk"))), $sshkeys);
$f->addValidateButton("bssh");
$f->display();
Exemple #10
0
    if (isXMLRPCError()) {
        $FH->isError(true);
    } else {
        $FH->isError(false);
        if ($result) {
            new NotifyWidgetSuccess($result);
        }
        header("Location: " . urlStrRedirect("base/users/editppolicy", array("ppolicy" => $name)));
        exit;
    }
}
$p = new PageGenerator($title);
$p->setSideMenu($sidemenu);
$p->display();
$f = new ValidatingForm();
$f->push(new Table());
if ($mode == "add") {
    $nameTpl = new InputTpl("cn", '/^[0-9a-zA-Z_ -]*$/');
} else {
    $nameTpl = new HiddenTpl("cn");
}
$f->add(new TrFormElement(_T("Name", "ppolicy"), $nameTpl), array("value" => $FH->getArrayOrPostValue("cn"), "required" => true));
$f->add(new TrFormElement(_T("Description", "ppolicy"), new InputTpl("description")), array("value" => $FH->getArrayOrPostValue("description")));
$f->add(new TrFormElement(_T("Minimum length", "ppolicy"), new InputTpl("pwdMinLength", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdMinLength"))), array("value" => $FH->getArrayOrPostValue("pwdMinLength")));
$f->add(new TrFormElement(_T("Password quality check", "ppolicy"), new InputTpl("pwdCheckQuality", '/^[012]$/'), array("tooltip" => ppolicyTips("pwdCheckQuality"))), array("value" => $FH->getArrayOrPostValue("pwdCheckQuality")));
$f->add(new TrFormElement(_T("Minimum age (seconds)", "ppolicy"), new InputTpl("pwdMinAge", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdMinAge"))), array("value" => $FH->getArrayOrPostValue("pwdMinAge")));
$f->add(new TrFormElement(_T("Maximum age (seconds)", "ppolicy"), new InputTpl("pwdMaxAge", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdMaxAge"))), array("value" => $FH->getArrayOrPostValue("pwdMaxAge")));
$f->add(new TrFormElement(_T("Number of grace authentications", "ppolicy"), new InputTpl("pwdGraceAuthNLimit", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdGraceAuthNLimit"))), array("value" => $FH->getArrayOrPostValue("pwdGraceAuthNLimit")));
if ($FH->getArrayOrPostValue("pwdMustChange") == 'TRUE' || $FH->getArrayOrPostValue("pwdMustChange") == 'on') {
    $pwdMustChange = "checked";
} else {
Exemple #11
0
function item_edit() {

    $params = getParams();
    $item_uuid = $_GET['itemid'];
    $label = urldecode($_GET['itemlabel']);

    $item = xmlrpc_getMenuItemByUUID($item_uuid);

    if(count($_POST) == 0) {

        $name = (isset($item['boot_service']) ? $item['boot_service']['default_name'] : $item['image']['default_name']);
        printf("<h3>"._T("Edition of item", "imaging")." : <em>%s</em></h3>", $name);

        $is_selected = '';
        $is_displayed = 'CHECKED';
        $is_wol_selected = '';
        $is_wol_displayed = 'CHECKED';
        // get current values
        if($item['default'] == true)
            $is_selected = 'CHECKED';
        if($item['hidden'] == true)
            $is_displayed = '';
        if($item['default_WOL'] == true)
            $is_wol_selected = 'CHECKED';
        if($item['hidden_WOL'] == true)
            $is_wol_displayed = '';

        $f = new ValidatingForm();
        $f->push(new Table());
        $f->add(new HiddenTpl("itemid"),                        array("value" => $item_uuid,                     "hide" => True));
        $f->add(new HiddenTpl("itemlabel"),                     array("value" => $label,                         "hide" => True));
        $f->add(new HiddenTpl("gid"),                           array("value" => $_GET['gid'],                   "hide" => True));
        $f->add(new HiddenTpl("uuid"),                          array("value" => $_GET['uuid'],                  "hide" => True));
        $f->add(new HiddenTpl("default_name"),                  array("value" => $name,                          "hide" => True));

        $f->add(
            new TrFormElement(_T("Selected by default", "imaging"),
            new CheckboxTpl("default")),
            array("value" => $is_selected)
        );
        $f->add(
            new TrFormElement(_T("Displayed", "imaging"),
            new CheckboxTpl("displayed")),
            array("value" => $is_displayed)
        );
        $f->add(
            new TrFormElement(_T("Selected by default on WOL", "imaging"),
            new CheckboxTpl("default_WOL")),
            array("value" => $is_wol_selected)
        );
        $f->add(
            new TrFormElement(_T("Displayed on WOL", "imaging"),
            new CheckboxTpl("displayed_WOL")),
            array("value" => $is_wol_displayed)
        );
        $f->pop();
        $f->addButton("bvalid", _T("Validate"));
        $f->pop();
        $f->display();
    } else {
        // set new values
        if(isset($_GET['gid'])) {
            $type = 'group';
            $target_uuid = $_GET['gid'];
        } else {
            $type = '';
            $target_uuid = $_GET['uuid'];
        }

        $bs_uuid = $item['boot_service']['imaging_uuid'];
        $im_uuid = $item['image']['imaging_uuid'];

        $params['default'] = ($_POST['default'] == 'on'?True:False);
        $params['default_WOL'] = ($_POST['default_WOL'] == 'on'?True:False);
        $params['hidden'] = ($_POST['displayed'] == 'on'?False:True);
        $params['hidden_WOL'] = ($_POST['displayed_WOL'] == 'on'?False:True);
        $params['default_name'] = $_POST['default_name'];

        if (isset($bs_uuid) && $bs_uuid != '') {
            $ret = xmlrpc_editServiceToTarget($bs_uuid, $target_uuid, $params, $type);
        } else {
            $ret = xmlrpc_editImageToTarget($im_uuid, $target_uuid, $params, $type);
        }
        if ($ret) 
        { 
            // generate menu
            $ret = xmlrpc_synchroComputer($target_uuid);
        }
        // goto menu boot list
        header("Location: " . urlStrRedirect("base/computers/".$type."imgtabs", $params));
        exit;
    }
}
Exemple #12
0
    if (!isXMLRPCError()) {
        $n = new NotifyWidgetSuccess(sprintf(_T("SAMBA configuration saved. You may need to reload or restart the SAMBA service.", "samba4")));
        handleServicesModule($n, array("samba" => "SAMBA"));
    }
}
require "modules/samba4/mainSidebar.php";
require "graph/navbar.inc.php";
$p = new PageGenerator(_T("General options", "samba4"));
$p->setSideMenu($sidemenu);
$p->display();
$smb = get_smbconf();
// foreach($smb as $key => $i){
//      print("$key=$i<br>");
//  }
$f = new ValidatingForm();
$f->push(new Table());
#if ($smb["pdc"])
#    $workgroupTpl = new HiddenTpl("workgroup");
#else
$workgroupTpl = new HiddenTpl("realm");
$f->add(new TrFormElement(_T("Domain name", "samba4"), $workgroupTpl), array("value" => $smb["realm"], "required" => True));
$f->add(new TrFormElement(_T("Server name", "samba4"), new HiddenTpl("netbios name")), array("value" => $smb["netbios name"], "required" => True));
$value = "";
#if ($smb["pdc"]) $value = "checked";
#$f->add(
#        new TrFormElement(_T("This server is a PDC"),new CheckboxTpl("pdc")),
#        array("value" => $value)
#);
#$f->add(
#        new TrFormElement(_T("This server is a WINS server"),new CheckboxTpl("wins support")),
#        array("value" => getCheckedState($smb, "wins support"))
Exemple #13
0
    $checked = "checked";
    $params["only_new"] = 'on';
}
else {
    $checked = isset($_POST['only_new']) ? "checked" : "";
}

// Create the page with its title and sidemenu
$p = new PageGenerator(_T("Incoming Inventories"));
$p->setSideMenu($sidemenu);
// Display the PageGenerator
$p->display();

// Create a form with a list of options and a checkbox
$form = new ValidatingForm();
$form->push(new Table());

// The list of options is put in an array, and the listbox is configured with this array
$periodList = array(_T("Last week") => 7, _T("Last month")=>30, _T("Last quarter")=>90, _T("Last semester")=>180, _T("Last year")=>356);
$listbox = new SelectItem("period", "validateForm");
$listbox->setElements(array_keys($periodList));
$listbox->setElementsVal(array_values($periodList));
// Check the value to put by default in the list
if(isset($_POST['period']))
    $listbox->setSelected($_POST['period']);
else
    $listbox->setSelected(7); // must match with the default value in ajaxIncoming.php (7 for a week here)

// Put the element in a Tr elemet to align it
$listboxTr = new TrFormElement(_T("Period"), $listbox);
Exemple #14
0
if ($_GET["action"] == "editrecord" && !isset($_POST["bedit"])) {
    $record = getZoneRecordById($curzone, $recordId);
    if ($record) {
        $hostname = $record["hostname"];
        $type = $record["type"];
        $value = $record["value"];
        $typeToLoad = in_array(strtoupper($type), $recordTypes) ? strtolower($type) : "custom";
        require_once "dnsrecords/" . $typeToLoad . ".php";
        $RecordClass = $typeToLoad . "Record";
        $r = new $RecordClass(array("zone" => $zone, "type" => strtolower($type), "hostname" => $hostname));
        $r->initValuesFromString($value);
        $recordUiContainers = $r->createUiContainers(true);
    }
}
$f = new ValidatingForm();
$f->push(new Table());
if ($_GET["action"] == "addrecord") {
    $typeComboBox = new ExtendedSelectItem("recordtype", "onRecordTypeChanged");
    $typeComboBox->setJsFuncParams(array("'" . $zone . "'"));
    $typeComboBox->setAdditionalParams("onkeyup=\"this.blur();this.focus();\"");
    $typeComboBox->setElements(array_values($recordTypes));
    $typeComboBox->setElementsVal(array_keys($recordTypes));
    $f->add(new TrFormElement(_T("Record type"), $typeComboBox), array("value" => $typeIndex));
} else {
    $f->add(new TrFormElement(_T("Record type"), new HiddenTpl("recordtype")), array("value" => $type));
}
$f->pop();
$typeContentDiv = new Div(array("id" => "typecontentdiv"));
$f->push($typeContentDiv);
if (isset($recordUiContainers)) {
    foreach ($recordUiContainers as $cnt) {
$lang = xmlrpc_getAllKnownLanguages();
$lang_choices = array();
$lang_values = array();
$lang_id2uuid = array();
foreach ($lang as $l) {
    $lang_choices[$l['imaging_uuid']] = $l['label'];
    $lang_values[$l['imaging_uuid']] = $l['imaging_uuid'];
    $lang_id2uuid[$l['id']] = $l['imaging_uuid'];
}
$language = new SelectItem("language");
$language->setElements($lang_choices);
$language->setElementsVal($lang_values);
if ($imaging_server['fk_language']) {
    $language->setSelected($lang_id2uuid[$imaging_server['fk_language']]);
}
$f->push(new Table());
$f->add(new TrFormElement(_T("Menu language", "imaging"), $language));
$pxe_password_label = _T('PXE Password', 'imaging');
$pxe_password_label_desc = _T('Leave this field empty to unset PXE Password', 'imaging');
$pxe_password_label = <<<EOS
<a href="#" class="tooltip">
    {$pxe_password_label}
    <span><p>
        {$pxe_password_label_desc}
    </p></span>

</a>
EOS;
$f->add(new TrFormElement($pxe_password_label, new PasswordTpl('pxe_password')), array("value" => xmlrpc_getPXEPasswordHash($location) == '' ? '' : '.......'));
$f->add(new TrFormElement(_T('Clonezilla parameters for saving images', 'imaging'), new InputTpl('clonezilla_saver_params')), array("value" => xmlrpc_getClonezillaSaverParams($location)));
$f->add(new TrFormElement(_T('Clonezilla parameters for restoring images', 'imaging'), new InputTpl('clonezilla_restorer_params')), array("value" => xmlrpc_getClonezillaRestorerParams($location)));
Exemple #16
0
$p->setSideMenu($sidemenu);
$p->display();
$t = new TitleElement(_T("Report creation", 'report'));
$t->display();
$f = new ValidatingForm();
/*
 * $_SESSION['report_files']
 * Used to store datas for PDF/XLS reports
 * $_SESSION['report_files'][mmc_plugin_name][report_name]
 */
if (!isset($_SESSION['report_files'])) {
    $_SESSION['report_files'] = array();
}
// first step, display selectors
if (!array_intersect_key($_POST, array('generate_report' => '', 'get_xls' => '', 'get_pdf' => ''))) {
    $f->push(new Table());
    /* Period */
    $f->add(new TrFormElement(_T('Period', 'report'), new periodInputTpl(_T('from', 'report'), 'period_from', _T('to', 'report'), 'period_to')), array("value" => $values, "required" => True));
    /* Entities */
    $entities = new SelectMultiTpl('entities[]');
    list($list, $values) = getEntitiesSelectableElements();
    $entities->setElements($list);
    $entities->setElementsVal($values);
    if (count($list) > 15) {
        $entities->setHeight(15);
    } else {
        $entities->setFullHeight();
    }
    $f->add(new TrFormElement(_T('Entities', 'report'), $entities), array("required" => true));
    /* Modules indicators */
    foreach ($report as $module_name => $sections) {
Exemple #17
0
$f->pop();
$f->addButton("bpolicy", _T("Save"));
$f->display();
print '<br />';
// Rules list display
$ajax = new AjaxFilter(urlStrRedirect("shorewall/shorewall/ajax_" . $page));
$ajax->display();
$t = new TitleElement(_T("Port forwarding rules"), 2);
$t->display();
$ajax->displayDivToUpdate();
// Add rule form
print '<script type="text/javascript" src="modules/shorewall/includes/functions.js"></script><br />';
$t = new TitleElement(_T("Add port forwarding rule"), 2);
$t->display();
$f = new ValidatingForm(array("id" => "rule"));
$f->push(new Table());
$macros = getServices();
$services = array("", _T("Custom...")) + $macros;
$servicesVals = array("", "custom") + $macros;
$serviceTpl = new SelectItem("service", "toggleCustom");
$serviceTpl->setElements($services);
$serviceTpl->setElementsVal($servicesVals);
$f->add(new TrFormElement(_T("Service"), $serviceTpl));
$f->pop();
$customDiv = new Div(array("id" => "custom"));
$customDiv->setVisibility(false);
$f->push($customDiv);
$f->push(new Table());
$protoTpl = new SelectItem("proto");
$protoTpl->setElements(array("", "TCP", "UDP"));
$protoTpl->setElementsVal(array("", "tcp", "udp"));
Exemple #18
0
 if (!empty($inventory)) {
     $f->add(new TitleElement(_T("Hard disks and partitions selection to backup", "imaging")));
 }
 ksort($inventory);
 foreach($inventory as $disk => $parts) {
     $disk = $disk + 1;
     $msg = sprintf(_T("Hard disk number: %d", "imaging"), $disk);
     $inputvar = "check_disk[$disk][0]";
     if (isset($parts["exclude"])) {
         $value = "";
         unset($parts["exclude"]);
     } else {
         $value = "CHECKED";
     }
     $divid = "disk_div$disk";
     $f->push(new DivForModule($msg, "#FFF"));
     $f->push(new Table());
     $f->add(new TrFormElement(_T("Select this hard disk", "imaging"), new CheckboxTpl($inputvar)),
             array("value" => $value,
                   "extraArg"=>'onclick="toggleVisibility(\''. $divid .'\');"'));
     $f->pop();
     $diskdiv = new Div(array("id" => $divid));
     $diskdiv->setVisibility($value == "CHECKED");
     $f->push($diskdiv);
     $f->push(new Table());
     ksort($parts);
     foreach($parts as $part) {
         $partnum = $part['num'] + 1;
         $ptype = $parttype[$part['type']];
         $length = humanSize($part['length'] * 512);
         $msg = sprintf(_T("Partition number: %d", "imaging"),