예제 #1
0
    exit;
}
// in case of failure, set errorStatus to 0 in order to display the edit form
$errorStatus = 0;
// edit form page starts here
$p = new PageGenerator($title);
$sidemenu->forceActiveItem($activeItem);
$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(){
예제 #2
0
파일: index.php 프로젝트: sebastiendu/mmc
    $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) {
        $moduleObj = $MMCApp->getModule($module_name);
        if ($moduleObj) {
            $f->add(new TrFormElement($moduleObj->getDescription(), new ReportModule($module_name, $sections)), array());
        }
    }
    $f->pop();
    $f->addButton("generate_report", _T('Generate Report', 'report'));
} else {
    if (isset($_POST['generate_report'])) {
        $ts_from = intval($_POST['period_from_timestamp']);
        $ts_to = intval($_POST['period_to_timestamp']);
        $datediff = $ts_to + 86400 - $ts_from;
        $nb_days = floor($datediff / (60 * 60 * 24));
        $nb_periods = min($nb_days, 7);
        $interval = $nb_days > 7 ? $nb_days / 7 : 1;
        $periods = array(date('Y-m-d', $ts_from));
        for ($i = 1; $i < $nb_periods - 1; $i++) {
            $periods[] = date('Y-m-d', strtotime("+" . round($interval * $i) . " days", $ts_from));
        }
        $periods[] = date('Y-m-d', $ts_to);
        $items = array();
        foreach ($_POST['indicators'] as $name => $status) {
예제 #3
0
파일: tabs.php 프로젝트: neoclust/mmc
            $p->setSideMenu($sidemenu);
            $p->display();
            $a_href_open = "<a href=''>";

            $msg = sprintf(_T("The synchro is currently running, please wait or reload the page %shere%s.<br/>", "imaging"), $a_href_open, '</a>');
            $t1 = new TitleElement($msg, 3);
            $t1->display();
            $msg = sprintf(_T("If the synchro runs since more than 5 minutes, please reset the synchro state of this computer's menu.", "imaging"));
            $t2 = new TitleElement($msg, 3);
            $t2->display();

            $f = new ValidatingForm();
            $f->add(new HiddenTpl("gid"),                    array("value" => $params['target_uuid'],            "hide" => True));
            $f->add(new HiddenTpl("groupname"),                    array("value" => $params['target_name'],            "hide" => True));
            $f->add(new HiddenTpl("type"),                           array("value" => $params['type'],                   "hide" => True));
            $f->addButton("bresetsynchrostate", _T("Reset Synchro state", "imaging"));
            $f->display();

        } else {
            # do nothing special if $SYNCHROSTATE_DONE
            $p = new TabbedPageGenerator();
            $sidemenu->forceActiveItem("list_profiles");
            $p->setSideMenu($sidemenu);
            global $stateid;
            $stateid = $ret['id'];

            $params['groupname'] = $group->getName();
            $params['target_name'] = $params['groupname'];
            $p->addTop(sprintf(_T("%s's profile imaging", 'imaging'), $group->getName()),
                "modules/imaging/imaging/header.php");
            $p->addTab("grouptabbootmenu", _T("Boot menu", 'imaging'), _T("Current boot menu", "imaging"),
예제 #4
0
if (isset($_POST["bunregister"])) {
    $type = $_POST["type"];
    $target_uuid = $_POST['target_uuid'];
    $target_name = $_POST['target_name'];
    $params['target_uuid'] = $target_uuid;
    $params['target_name'] = $target_name;
    $msg = _T("You are going to unregister this computer from the imaging module, are you sure you want to do that?", "imaging");
    $f = new ValidatingForm();
    $f->add(new TitleElement($msg, 3));
    $f->push(new Table());
    $f->add(new TrFormElement(_T("Do you want a backup to be done ?", "imaging"), new CheckBoxTpl("backup")), array("value" => ''));
    $f->add(new HiddenTpl("target_uuid"), array("value" => $target_uuid, "hide" => True));
    $f->add(new HiddenTpl("target_name"), array("value" => $target_name, "hide" => True));
    $f->add(new HiddenTpl("type"), array("value" => $type, "hide" => True));
    $f->pop();
    $f->addButton("bunregister2", _T("Unregister this computer", 'imaging'));
    $f->addButton("cancel", _T("Cancel", "imaging"), 'btnSecondary');
    $f->display();
} else {
    if (isset($_POST["bunregister2"])) {
        $type = $_POST["type"];
        $target_uuid = $_POST['target_uuid'];
        $target_name = $_POST['target_name'];
        $params['target_uuid'] = $target_uuid;
        $params['target_name'] = $target_name;
        $params['backup'] = $_POST['backup'];
        $ret = xmlrpc_delComputersImaging(array($target_uuid), $params['backup'] ? true : false);
        if ($ret[0] and !isXMLRPCError()) {
            new NotifyWidgetSuccess(sprintf(_T("The computer %s has correctly been unregistered from imaging", 'imaging'), $target_name));
            unset($_SESSION["imaging.isComputerRegistered_" . $target_uuid]);
            header("Location: " . urlStrRedirect("base/computers/register_target", $params));
예제 #5
0
    $f->addValidateButton("bconfirm");
    $f->addCancelButton("bback");
    $f->display();
}
### /Advanced actions handling ###
/* single target: form display */
if (!isset($_GET['badvanced']) && $_GET['uuid'] && !isset($_POST['launchAction'])) {
    $machine = new Machine(array('uuid' => $_GET['uuid'], 'hostname' => array('0' => $_GET['hostname']), 'displayName' => $_GET['hostname']));
    if (strlen(web_probe_order()) > 0) {
        $msc_host = new RenderedMSCHost($machine, web_probe_order());
        $msc_host->ajaxDisplay();
    } else {
        // nothing set : do not probe
        if (!isset($_POST["bprobe"])) {
            $fprobe = new ValidatingForm();
            $fprobe->addButton("bprobe", _T("Probe status", "msc"));
            $fprobe->display();
            print "<br/>";
        } else {
            $msc_host = new RenderedMSCHost($machine, web_probe_order_on_demand());
            $msc_host->ajaxDisplay();
        }
    }
    $msc_actions = new RenderedMSCActions(msc_script_list_file(), $machine->hostname, array('uuid' => $_GET['uuid']));
    $msc_actions->display();
    $ajax = new AjaxFilter(urlStrRedirect("base/computers/ajaxPackageFilter"), "container", array("uuid" => $machine->uuid, "hostname" => $machine->hostname));
    $ajax->display();
    $ajax->displayDivToUpdate();
}
/* group display */
if (!isset($_GET['badvanced']) && isset($_GET['gid']) && !isset($_POST['launchAction']) && !isset($_GET['uuid'])) {
예제 #6
0
</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)));
$f->pop();
$f->push(new DivExpertMode());
$f->add(new TitleElement(_T("Default menu parameters", "imaging")));
$f->push(new Table());
$f->add(new TrFormElement(_T('Default menu label', 'imaging'), new InputTpl("default_m_label")), array("value" => $default_menu['default_name']));
$f->add(new TrFormElement(_T('Default menu timeout', 'imaging'), new InputTpl("default_m_timeout")), array("value" => $default_menu['timeout']));
if ($default_menu["hidden_menu"]) {
    $hidden_menu_value = 'CHECKED';
} else {
    $hidden_menu_value = '';
}
$f->add(new TrFormElement(_T('Hide menu', 'imaging'), new CheckBoxTpl("default_m_hidden_menu")), array("value" => $hidden_menu_value));
$f->pop();
$f->add(new TitleElement(_T("Boot options", "imaging")));
$f->push(new Table());
$f->add(new TrFormElement(_T("Full path to the XPM displayed at boot", "imaging"), new InputTpl("boot_xpm")), array("value" => $default_menu['background_uri']));
$f->add(new TrFormElement(_T("Message displayed during backup/restoration", "imaging"), new TextareaTpl("boot_msg")), array("value" => $default_menu['message']));
$f->pop();
$f->pop();
/* Closes expert mode div */
$_GET["action"] = "save_configuration";
$f->addButton("bvalid", _T("Validate"));
$f->pop();
$f->display();
require "../includes/ajaxcommon_bottom.inc.php";
예제 #7
0
파일: edit.php 프로젝트: psyray/mmc
    list($name, $description, $enabled) = _parseEditMachineForm();
    $editSuccess = editMachine($name, array($name, $description, $enabled));
    if (!isXMLRPCError() and $editSuccess) {
        new NotifyWidgetSuccess(_T("Computer successfully modified."));
        header("Location: " . urlStrRedirect("samba4/machines/index"));
        exit;
    }
}
/* Showing the edit machine details form */
if ($name) {
    $machineDetails = getMachine($name);
    $form = new ValidatingForm();
    $form->push(new Table());
    $tr = new TrFormElement(_T("Computer name", "samba4"), new HiddenTpl("name"));
    $form->add($tr, array("value" => $machineDetails["name"], "required" => True));
    $tr = new TrFormElement(_T("Computer description", "samba4"), new InputTpl("description"));
    $form->add($tr, array("value" => $machineDetails["description"], "required" => True));
    $tr = new TrFormElement(_T("Computer account is enabled", "samba4"), new CheckboxTpl("enabled"), array("tooltip" => _T("If checked, the computer account is enabled", "samba4")));
    $form->add($tr, array("value" => $machineDetails["enabled"] ? "checked" : ""));
    $form->addButton("bmachineedit", _("Confirm"));
    $form->display();
}
/* Private functions */
function _parseEditMachineForm()
{
    $FH = new FormHandler("editMachineFH", $_POST);
    $name = $FH->getPostValue("name");
    $description = $FH->getPostValue("description");
    $enabled = $FH->getPostValue("shareEnabled") == "on" ? True : "";
    return array($name, $description, $enabled);
}
예제 #8
0
}
if (isset($_POST['cn'])) {
    $name = strtolower(substr($_POST['cn'], 0, -1));
    $displayName = $_POST['displayName'];
    $disable = false;
    if (isset($_POST['disable']) && $_POST['disable'] == "on") {
        $disable = true;
    }
    $params = array("displayName" => $displayName, "disable" => $disable);
    change_machine($name, $params);
    if (!isXMLRPCError()) {
        new NotifyWidgetSuccess(_T("Computer successfully modified."));
        header("Location: " . urlStrRedirect("samba/machines/index"));
        exit;
    }
}
if ($name) {
    $ldapArr = get_machine($name);
    $f = new ValidatingForm();
    $f->push(new Table());
    $f->add(new TrFormElement(_T("Name"), new HiddenTpl("cn")), array("value" => $ldapArr["cn"][0], "required" => true));
    $f->add(new TrFormElement(_T("Comment"), new InputTpl("displayName")), array("value" => $ldapArr["displayName"][0]));
    if (strpos($ldapArr["sambaAcctFlags"][0], "D")) {
        $value = "checked";
    } else {
        $value = "";
    }
    $f->add(new TrFormElement(_T("Disable computer account"), new CheckBoxTpl("disable")), array("value" => $value));
    $f->addButton("bedit", _("Confirm"));
    $f->display();
}
예제 #9
0
            }
        }
    }
    $a = array("value" => $network, "required" => True);
    $a["zone"] = $zone;
    $a["ajaxurl"] = "ajaxDnsGetZoneFreeIp";
    $formElt = new GetFreeIPInputTpl();
} else {
    if ($_GET["action"] == "addhost") {
        $a = array("value" => "", "required" => True);
        $formElt = new IPInputTpl("ipaddress");
    } else {
        $a = array("value" => $ipaddress);
        $formElt = new HiddenTpl("ipaddress");
    }
}
$f->add(new TrFormElement(_T("Network address"), $formElt), $a);
$f->pop();
if ($_GET["action"] == "addhost") {
    $f->addButton("badd", _("Create"));
} else {
    /* On edit mode, the user can setup host aliases */
    $m = new MultipleInputTpl("hostalias", _T("Hostname alias"));
    $m->setRegexp('/^[a-z][a-z0-9-]*[a-z0-9]$/');
    if (empty($cnames)) {
        $cnames = array("");
    }
    $f->add(new FormElement(_T("Hostname alias"), $m), $cnames);
    $f->addValidateButton("bedit");
}
$f->display();
예제 #10
0
파일: dnat_rules.php 프로젝트: neoclust/mmc
    $sourcesTpl->setElements($sources);
    $sourcesTpl->setElementsVal($sourcesVals);
    $f->add(new TrFormElement(_T("Source zone"), $sourcesTpl));
} else {
    $tr = new TrFormElement(_T("Source zone"), new HiddenTpl("source"));
    $tr->setStyle("display: none");
    $f->add($tr, array("value" => $zones[0][0]));
}
$f->add(new TrFormElement(_T("Source IP(s)"), new InputTpl("src_ip"), array("tooltip" => _T("Allow connection from IP(s) address(es) (separate IPs with ',')."))), array("value" => ""));
$zones = getZonesInterfaces($dst);
if (count($zones) > 1) {
    $destinations = array();
    $destinationsVals = array();
    foreach ($zones as $zone) {
        $destinations[] = sprintf("%s (%s)", $zone[0], $zone[1]);
        $destinationsVals[] = $zone[0];
    }
    $destinationsTpl = new SelectItem("destination");
    $destinationsTpl->setElements($destinations);
    $destinationsTpl->setElementsVal($destinationsVals);
    $f->add(new TrFormElement(_T("Destination zone"), $destinationsTpl));
} else {
    $tr = new TrFormElement(_T("Destination zone"), new HiddenTpl("destination"));
    $tr->setStyle("display: none");
    $f->add($tr, array("value" => $zones[0][0]));
}
$f->add(new TrFormElement(_T("Destination IP"), new InputTpl("dest_ip"), array("tooltip" => _T("The computer IP in the internal network where the request will be transfered."))), array("value" => "", "required" => true));
$f->add(new TrFormElement(_T("Destination port(s)"), new InputTpl("dest_port", "/^[0-9]+\$/"), array("tooltip" => _T("If not specified, destination port(s) will be the same as the incoming port(s)"))), array("value" => ""));
$f->pop();
$f->addButton("brule", _T("Add rule"));
$f->display();
예제 #11
0
파일: bootmenu.php 프로젝트: neoclust/mmc
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;
    }
}
예제 #12
0
파일: edit.php 프로젝트: neoclust/mmc
    } else {
        $f->add($selectpapi, array("value" => $p_api_id, "hide" => True));
    }
    $f->add(new HiddenTpl("id"), array("value" => $package['id'], "hide" => True));
    $f->add(new HiddenTpl("filename"), array("value" => $_FILES['filepackage']['name'], "hide" => True));
    $f->add(new HiddenTpl("random_dir"), array("value" => $_POST['random_dir'], "hide" => True));
    if ($_GET["action"] == "add") {
        $f->add(new HiddenTpl("mode"), array("value" => "creation", "hide" => True));
    }
    $fields = array(array("label", _T("Package label", "pkgs"), array("required" => True)), array("version", _T("Package version", "pkgs"), array("required" => True)), array('description', _T("Description", "pkgs"), array()));
    $cmds = array(array('command', _T('Command\'s name : ', 'pkgs'), _T('Command : ', 'pkgs')));
    $options = array(array('reboot', _T('Need a reboot ?', 'pkgs')));
    foreach ($fields as $p) {
        $f->add(new TrFormElement($p[1], new InputTpl($p[0])), array_merge(array("value" => $package[$p[0]]), $p[2]));
    }
    foreach ($options as $p) {
        $op = $package[$p[0]] == 1 || $package[$p[0]] == '1' || $package[$p[0]] === 'enable';
        $f->add(new TrFormElement($p[1], new CheckboxTpl($p[0])), array("value" => $op ? 'checked' : ''));
    }
    foreach ($cmds as $p) {
        $f->add(new HiddenTpl($p[0] . 'name'), array("value" => $package[$p[0]]['name'], "hide" => True));
        $f->add(new TrFormElement($p[2], new TextareaTpl($p[0] . 'cmd')), array("value" => htmlspecialchars($package[$p[0]]['command'])));
    }
    $f->pop();
    if ($_GET["action"] == "add") {
        $f->addButton('bassoc', _T("Associate files", "pkgs"), "btnPrimary");
    } else {
        $f->addValidateButton("bcreate");
    }
}
$f->display();
예제 #13
0
}
$f->add(new TrFormElement(_T("File size", "backuppc"), $sel, array()));
/*
 $f->add(
 new TrFormElement(_T('Minimum file size','backuppc'), new InputTpl('minsize')),
 array("value" => isset($_POST['minsize'])?$_POST['minsize']:'',"required" => True)
 );

 $f->add(
 new TrFormElement(_T('Maximum file size','backuppc'), new InputTpl('maxsize')),
 array("value" => isset($_POST['maxsize'])?$_POST['maxsize']:'',"required" => True)
 );
*/
// =====================================================================
$f->pop();
$f->addButton("bsearch", _T('Search', 'backuppc'));
$f->display();
// ===== AJAX FILE TABLE ==============================================
$ajax = new AjaxFilterLocation(urlStrRedirect("backuppc/backuppc/ajaxFileSearch"), 'container', 'location', $_POST);
$fils = array('.');
$fils_v = array('.');
$ajax->setElements($fils);
$ajax->setElementsVal($fils_v);
$ajax->display();
echo "<br/><br/>";
$ajax->displayDivToUpdate();
?>

<script type="text/javascript">

    jQuery(function() {
예제 #14
0
파일: configure.php 프로젝트: neoclust/mmc
            );
            $f->add(
                new TrFormElement(_T("Image parameters", "imaging"),
                new InputTpl("target_opt_image")), array("value" => $local_image_parameters)
            );

            $f->add(
                new TrFormElement(_T("Force raw backup mode", "imaging"),
                new CheckboxTpl("target_opt_raw_mode")),
                array("value" => $rawmode)
            );
        } else {
            $f->add(new HiddenTpl('target_opt_kernel'),       array("value" => ($target != null?$target['kernel_parameters']:web_def_kernel_parameters()),            "hide" => True));
            $f->add(new HiddenTpl('target_opt_image'),        array("value" => ($target != null?$target['image_parameters']:web_def_image_parameters()),              "hide" => True));
            $f->add(new HiddenTpl('target_opt_raw_mode'),     array("value" => ($target != null?$target['raw_mode']:''),                                              "hide" => True));
        }

        $f->pop();

        $f->addValidateButton("bvalid");
        if ($type == '' && !$has_profile && ($whose && $whose[0] == $target['uuid'])) {
            $f->addButton("bunregister", _T("Unregister this computer", 'imaging'), 'btnSecondary');
        }

        $f->pop(); // Div expert mode

        $f->display();
    }
}
?>
예제 #15
0
$tooltip .= "%s";
$tooltip .= _T("(DHCP option number 66)");
$tooltip = sprintf($tooltip, "<br/>");
$f->add(new TrFormElement(_T("TFTP server name"), new IA5InputTpl("tftp-server-name"), array("tooltip" => $tooltip)), array("value" => $options["tftp-server-name"]));
$f->pop();
$f->push(new Table());
$f->add(new TrFormElement(_T("DHCP client lease time (in seconds)"), new HiddenTpl("")));
$f->add(new TrFormElement(_T("Minimum lease time"), new NumericInputTpl("min-lease-time"), array("tooltip" => _T("Minimum length in seconds that will be assigned to a lease."))), array("value" => $statements["min-lease-time"]));
$f->add(new TrFormElement(_T("Default lease time"), new NumericInputTpl("default-lease-time"), array("tooltip" => _T("Lengh in seconds that will be assigned to a lease if the client requesting the lease does not ask for a specific expiration time."))), array("value" => $statements["default-lease-time"]));
$f->add(new TrFormElement(_T("Maximum lease time"), new NumericInputTpl("max-lease-time"), array("tooltip" => _T("Maximum length in seconds that will be assigned to a lease."))), array("value" => $statements["max-lease-time"]));
$f->pop();
$f->push(new Table());
$f->add(new TrFormElement(_T("Dynamic pool(s) for non-registered DHCP clients", "network"), new CheckboxTpl("hassubnetpools")), array("value" => $hasSubnetPools, "extraArg" => 'onclick="toggleVisibility(\'poolsdiv\');"'));
$f->pop();
$poolsdiv = new Div(array("id" => "poolsdiv"));
$poolsdiv->setVisibility($hasSubnetPools);
$f->push($poolsdiv);
$f->push(new Table());
$f->add(new TrFormElement(_T("Dynamic pools"), new MultipleRangeInputTpl("subnetpools")), array("value" => $poolsRanges));
$f->pop();
// pop table
$f->pop();
// pop div
$f->pop();
// pop the form
if ($_GET["action"] == "subnetadd") {
    $f->addButton("badd", _("Create"));
} else {
    $f->addButton("bedit", _("Confirm"));
}
$f->display();
예제 #16
0
파일: index.php 프로젝트: sebastiendu/mmc
$f->pop();
$pathdiv = new Div(array("id" => "profilespath"));
$pathdiv->setVisibility($hasProfiles);
$f->push($pathdiv);
$f->push(new Table());
# default value for profile path
$value = "\\\\%N\\profiles\\%U";
if ($hasProfiles) {
    $value = $smb['logon path'];
}
$f->add(new TrFormElement(_T("Network path for profiles"), new InputTpl("logon path"), array("tooltip" => _T("The share must exist and be world-writable.", "samba"))), array("value" => $value));
$f->pop();
$f->pop();
$f->push(new DivExpertMode());
$f->push(new Table());
$syncTpl = new SelectItem("ldap passwd sync");
$labels = array(_T('Yes'), _T('No'), _T('Only (for smbk5pwd)'));
$values = array('yes', 'no', 'only');
$syncTpl->setElements($labels);
$syncTpl->setElementsVal($values);
$f->add(new TrFormElement(_T("LDAP password sync"), $syncTpl), array("value" => $smb["ldap passwd sync"]));
$d = array(_T("Opening script session") => "logon script", _T("Base directory path") => "logon home", _T("Connect base directory on network drive") => "logon drive");
foreach ($d as $description => $field) {
    $f->add(new TrFormElement($description, new IA5InputTpl($field)), array("value" => $smb[$field]));
}
$f->pop();
$f->pop();
$f->addValidateButton("bsave");
$f->addExpertButton("brestart", _T("Restart SAMBA"));
$f->addButton("breload", _T("Reload SAMBA configuration"));
$f->display();
예제 #17
0
파일: header.php 프로젝트: sebastiendu/mmc
global $CUSTOM_MENU;
global $IN_GROUP;
if ($stateid == $SYNCHROSTATE_TODO) {
    print "<table><tr><td><b>";
    print _T('You have modified this target\'s boot menu, if you are done please click on "Generate Menu" to update the computer boot menu.', 'imaging');
    print "</b></td><td>";
    $f = new ValidatingForm();
    $f->addButton("bsync", _T("Generate Menu", "imaging"));
    $f->display();
    print "</td></tr></table>";
} elseif (isset($_GET['tab']) && ($_GET['tab'] == 'tabbootmenu' || $_GET['tab'] == 'grouptabbootmenu') && isExpertMode()) {
    print "<table><tr><td>";
    print _T('Click on "Force Generation" if you want to force the update of the boot menu', 'imaging');
    print "</td><td>";
    $f = new ValidatingForm();
    $f->addButton("bsync", _T("Force Generation", "imaging"));
    $f->display();
    print "</td></tr></table>";
} else {
    print "<table><tr><td>";
    print _T('This target\'s boot menu is up-to-date.', 'imaging');
    print "</td></tr></table>";
}
if ($CUSTOM_MENU == 1) {
    /* This is a machine custom menu, so we propose to restore default location
     * menu */
    print "<table><tr><td>";
    printf(_T('This computer has a <u>custom boot menu</u>. <a href="%s">Click here</a> to get back the default one.', 'imaging'), $_SERVER['REQUEST_URI'] . '&reset_defaultMenu=1');
    print "</td></tr></table>";
}
if ($IN_GROUP == 1) {
예제 #18
0
파일: manager.php 프로젝트: sebastiendu/mmc
//New page with side menu, create and show
$p = new PageGenerator($main_title);
$p->setSideMenu($sidemenu);
$p->display();
//Create a list of informations
$n = new ListInfos($arrB, $title_datagrid);
$n->first_elt_padding = 1;
$n->disableFirstColumnActionLink();
$n->setName(_T("List"));
//Add action on list and show list
$n->addActionItem(new ActionPopupItem(_T("Delete"), $del_page, "delete", "eltdata"));
$n->display();
//Create Title and show
$t = new TitleElement($sub_title, 2);
$t->display();
//Create Form to get informations
$f = new ValidatingForm();
//Create table inside Form
$f->push(new Table());
//Add element input in table
$f->add(new TrFormElement($elt_label, new InputTpl("eltdata"), array("tooltip" => $elt_help)), array("value" => "", "required" => true));
//Add Botton in Form and show
$f->pop();
$f->addButton("btAdd", _T("Add"));
$f->display();
if (!servicesModuleEnabled()) {
    echo '<br/>';
    $f = new ValidatingForm(array("id" => "service"));
    $f->addButton("btApply", _T("Apply configuration"));
    $f->display();
}
예제 #19
0
    $f->add($tr, array("value" => $zones[0][0]));
}
$f->add(new TrFormElement(_T("Source IP(s)"), new InputTpl("src_ip"), array("tooltip" => _T("Allow connection from IP(s) address(es) (separate IPs with ',')."))), array("value" => ""));
$zones = getZonesInterfaces($dst);
if (count($zones) > 1) {
    $destinations = array();
    $destinationsVals = array();
    foreach ($zones as $zone) {
        $destinations[] = sprintf("%s (%s)", $zone[0], $zone[1]);
        $destinationsVals[] = $zone[0];
    }
    $destinationsTpl = new SelectItem("destination");
    $destinationsTpl->setElements($destinations);
    $destinationsTpl->setElementsVal($destinationsVals);
    $f->add(new TrFormElement(_T("Destination zone"), $destinationsTpl));
} else {
    $tr = new TrFormElement(_T("Destination zone"), new HiddenTpl("destination"));
    $tr->setStyle("display: none");
    $f->add($tr, array("value" => $zones[0][0]));
}
$f->add(new TrFormElement(_T("Destination IP"), new InputTpl("dest_ip"), array("tooltip" => _T("The computer IP in the internal network where the request will be transfered."))), array("value" => "", "required" => true));
$f->add(new TrFormElement(_T("Destination port(s)"), new InputTpl("dest_port", "/^[0-9]+\$/"), array("tooltip" => _T("If not specified, destination port(s) will be the same as the incoming port(s)"))), array("value" => ""));
$f->pop();
$f->addButton("brule", _T("Add rule"));
$f->display();
if (!servicesModuleEnabled()) {
    echo '<br/>';
    $f = new ValidatingForm(array("id" => "service"));
    $f->addButton("brestart", _T("Restart service"));
    $f->display();
}
예제 #20
0
파일: masquerade.php 프로젝트: neoclust/mmc
$t = new TitleElement(_T("Add NAT rule"), 2);
$t->display();
$f = new ValidatingForm();
$f->push(new Table());
$zones_types = getZonesTypes();
$external = array();
$externalVals = array();
foreach (getZonesInterfaces($zones_types["external"]) as $zone) {
    $external[] = sprintf("%s (%s)", $zone[0], $zone[1]);
    $externalVals[] = $zone[1];
}
$externalTpl = new SelectItem("external_if");
$externalTpl->setElements($external);
$externalTpl->setElementsVal($externalVals);
$f->add(new TrFormElement(_T("External network (Internet)"), $externalTpl));
$internal = array();
$internalVals = array();
foreach (getZonesInterfaces($zones_types["internal"]) as $zone) {
    $internal[] = sprintf("%s (%s)", $zone[0], $zone[1]);
    $internalVals[] = $zone[1];
}
$internalTpl = new SelectItem("internal_if");
$internalTpl->setElements($internal);
$internalTpl->setElementsVal($internalVals);
$f->add(new TrFormElement(_T("Internal network"), $internalTpl));
$f->pop();
$f->addButton("badd", _T("Add NAT rule"));
$f->display();
?>