// Rules list display $ajax = new AjaxFilter(urlStrRedirect("shorewall/shorewall/ajax_" . $page)); $ajax->display(); $t = new TitleElement(_T("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 rule"), 2); $t->display(); $f = new ValidatingForm(array("id" => "rule")); $f->push(new Table()); $decisionTpl = new SelectItem("decision"); $decisionTpl->setElements(array(_T("Accept"), _T("Drop"))); $decisionTpl->setElementsVal(array("ACCEPT", "DROP")); $f->add(new TrFormElement(_T("Decision"), $decisionTpl)); $src_zones = getZonesInterfaces($src); if (count($src_zones) > 1) { $sources = array("All"); $sourcesVals = array("all"); foreach ($src_zones as $zone) { $sources[] = sprintf("%s (%s)", $zone[0], $zone[1]); $sourcesVals[] = $zone[0]; } $sourcesTpl = new SelectItem("source"); $sourcesTpl->setElements($sources); $sourcesTpl->setElementsVal($sourcesVals); $f->add(new TrFormElement(_T("Source"), $sourcesTpl)); } else { $tr = new TrFormElement(_T("Source"), new HiddenTpl("source")); $tr->setStyle("display: none");
* * 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();
* 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/>. */ /* common ajax includes */ require "../includes/ajaxcommon.inc.php"; $t = new TitleElement(_T("Imaging server configuration", "imaging"), 3); $t->display(); $config = xmlrpc_getImagingServerConfig($location); $imaging_server = $config[0]; $default_menu = $config[1]; $f = new ValidatingForm(array("action" => urlStrRedirect("imaging/manage/save_configuration"))); $f->add(new HiddenTpl("is_uuid"), array("value" => $imaging_server['imaging_uuid'], "hide" => True)); $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']]); }
$ajax = new AjaxFilter(urlStrRedirect("shorewall/shorewall/ajax_" . $page)); $ajax->display(); $t = new TitleElement(_T("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 rule"), 2); $t->display(); $f = new ValidatingForm(array("id" => "rule")); $f->push(new Table()); $decisionTpl = new SelectItem("decision"); $decisionTpl->setElements(array(_T("Accept"), _T("Drop"))); $decisionTpl->setElementsVal(array("ACCEPT", "DROP")); $decisionTpl->setSelected(fromPOST("decisionTpl")); $f->add(new TrFormElement(_T("Decision"), $decisionTpl)); $src_zones = getZonesInterfaces($src); if (count($src_zones) > 1) { $sources = array("All"); $sourcesVals = array("all"); foreach ($src_zones as $zone) { $sources[] = sprintf("%s (%s)", $zone[0], $zone[1]); $sourcesVals[] = $zone[0]; } $sourcesTpl = new SelectItem("source"); $sourcesTpl->setElements($sources); $sourcesTpl->setElementsVal($sourcesVals); $sourcesTpl->setSelected(fromPOST("source")); $f->add(new TrFormElement(_T("Source zone"), $sourcesTpl)); } else { $tr = new TrFormElement(_T("Source zone"), new HiddenTpl("source"));
// Add NAT rule form $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(); if (!servicesModuleEnabled()) { echo '<br/>';
} } else { // add rule mode $rule[] = array("operand1" => "Network/IP", "operand2" => "/.*/", "entitie" => $entityroot, "aggregator" => "", "operator" => "match", "actif" => 1, "numRule" => $datarule['nb_regle'] + 1); } if (!isset($regle)) { $newnumRule = $datarule['nb_regle'] + 1; } else { $newnumRule = $regle; } $p = new PageGenerator(_T("Add rule", 'inventory')); $p->setSideMenu($sidemenu); $p->display(); $f = new ValidatingForm(); $f->push(new Table()); $f->add(new TrFormElement(_T("Active", "inventory"), new CheckboxTpl('active')), array("value" => $rule[0]['actif'] == 1 ? 'checked' : '')); $selectOperatorType = new SelectItemtitle("operator[]", _T('selection from this item', 'inventory') . "\n"); $selectOperatorType->setElements($operatorType); $selectOperatorType->setElementsVal($operatorType); $aggregator_select = new SelectItemtitle("aggregator", _T('aggregator a rule', 'inventory') . "\n" . _T('AND all rules TRUE select entitie', 'inventory') . "\n" . _T('OR one rule TRUE select entitie', 'inventory') . "\n" . _T('NONE rule TRUE select entitie', 'inventory')); $aggregator_select->setElements(array('AND', 'OR', 'NONE')); $aggregator_select->setElementsVal(array('AND', 'OR', '')); $f->add(new TrFormElement(_T('Aggregator', 'inventory'), $aggregator_select), array("value" => $rule[0]['aggregator'])); // or sans aggregator //$f->add(new HiddenTpl("aggregator"), array("value" => "", "hide" => True)); $operator_select = new SelectItemtitle("operators[]", _T('Match', 'inventory') . ":\n" . _T(' regular expression', 'inventory') . "\n" . _T(' special characters must be escaped in regular expressions', 'inventory') . "\n" . _T(' .^$*+?()[{\\|') . "\n" . _T(' not start with word /^(?!my string).*$/', 'inventory') . "\n" . _T(' start with my string /^my string.*$/', 'inventory') . "\n" . _T(' does not contain /^((?!my string).)*$/', 'inventory') . "\n" . _T(' egal to or contains', 'inventory') . "/my string/" . "\n" . _T(' finishes by /.*(my string)$/', 'inventory') . "\n\n" . _T('Equal or noequal', 'inventory') . ":\n" . _T(' strictly equal or inequality', 'inventory') . "\n\n" . _T('Contains or NoContains', 'inventory') . ":\n" . _T(' has value or not', 'inventory') . "\n\n" . _T('Starts by or Finishes', 'inventory') . ":\n" . _T(' begins or ends with value', 'inventory')); $operators = array("match" => _T('matches (regex)', 'inventory'), "equal" => _T('equal', 'inventory'), "noequal" => _T('not equal', 'inventory'), "contains" => _T('contains', 'inventory'), "nocontains" => _T('not contains', 'inventory'), "starts" => _T('starts by', 'inventory'), "finishes" => _T('finishes by', 'inventory')); $operator_select->setElements(array_values($operators)); $operator_select->setElementsVal(array_keys($operators)); $locations_select = new SelectItemtitle("target_location[]", _T('entities list', 'inventory')); $location_list = array();
$a_href_open = "<a href=''>"; print "<p>"; print sprintf(_T("Boot menu generation is still in progress for the following items : %s. Please wait or reload the page %shere%s.", "imaging"), join($running_on, ', '), $a_href_open, '</a>'); print "</p>"; } if (count($initerror_on) > 0) { print "<p>"; print _T("The registering in the imaging server has failed.", "imaging"); print "</p>"; exit; } if (count($todo_on) > 0) { # DISPLAY the sync link print "<table><tr><td><b>"; print sprintf(_T('You have modified the boot menu for the following items : %s. If you are done please click on "Generate Menu" to update the computer boot menu.', 'imaging'), join($todo_on, ', ')); print "</b></font></td><td>"; $f = new ValidatingForm(); $f->add(new HiddenTpl("location_uuid"), array("value" => $location, "hide" => True)); $f->addButton("bsync", _T("Generate Menu", "imaging")); $f->display(); print "</td></tr></table>"; } elseif (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->add(new HiddenTpl("location_uuid"), array("value" => $location, "hide" => True)); $f->addButton("bsync", _T("Force Generation", "imaging")); $f->display(); print "</td></tr></table>"; }
$p_api->fromURI(quick_get("papi")); $name = quick_get('ltitle'); if (!isset($name) || $name == '') { $name = getPackageLabel($p_api, quick_get('pid')); } // form design $f = new ValidatingForm(); // display top label if (isset($_GET['uuid']) && $_GET['uuid']) { $hostname = $_GET['hostname']; $uuid = $_GET['uuid']; $machine = getMachine(array('uuid' => $uuid), True); $hostname = $machine->hostname; $label = new RenderedLabel(3, sprintf(_T('Single advanced launch : action "%s" on "%s"', 'msc'), $name, $machine->hostname)); $f->push(new Table()); $f->add(new HiddenTpl("uuid"), array("value" => $uuid, "hide" => True)); $f->add(new HiddenTpl("name"), array("value" => $hostname, "hide" => True)); } else { $gid = $_GET['gid']; $group = new Group($gid, true); if ($group->exists != False) { if (quick_get('convergence')) { $label = new RenderedLabel(3, sprintf(_T('Software Convergence: action "%s" on "%s"', 'msc'), $name, $group->getName())); } else { $label = new RenderedLabel(3, sprintf(_T('Group Advanced launch : action "%s" on "%s"', 'msc'), $name, $group->getName())); } $f->push(new Table()); $f->add(new HiddenTpl("gid"), array("value" => $gid, "hide" => True)); } } $label->display();
$services = array(array('Start computer', 'Boot on system hard drive', true), array('Create rescue image', 'Backup system hard drive', true), array('Create master', 'Backup system hard drive as a master', true), array('Memtest', 'Launch RAM checking utility', false)); $id = $_GET['itemid']; if (count($_POST) == 0) { // get current values if ($services[$id][2] == true) { $in_bootmenu = 'CHECKED'; } $label = $services[$id][0]; $desc = $services[$id][1]; $p = new PageGenerator(_T("Edit service : ", "imaging") . $label); $sidemenu->forceActiveItem("service"); $p->setSideMenu($sidemenu); $p->display(); $f = new ValidatingForm(); $f->push(new Table()); $f->add(new TrFormElement(_T("Label", "imaging"), new InputTpl("service_label")), array("value" => $label)); $f->add(new TrFormElement(_T("Description", "imaging"), new InputTpl("service_desc")), array("value" => $desc)); $f->add(new TrFormElement(_T("In default bootmenu", "imaging"), new CheckboxTpl("service_bootmenu")), array("value" => $in_bootmenu)); $f->pop(); $f->addButton("bvalid", _T("Validate")); $f->pop(); $f->display(); } else { // set new values foreach ($_POST as $key => $value) { } $label = $_POST['service_label']; $str = sprintf(_T("Service <strong>%s</strong> modified with success", "imaging"), $label); new NotifyWidgetSuccess($str); // goto menu boot list header("Location: " . urlStrRedirect("imaging/manage/service"));
new NotifyWidgetFailure(sprintf(_T("Failed to unregister the computer %s", 'imaging'), $target_name)); } $is_unregistering = True; } else { /* * type: 'group' for a profile, '' for a single computer */ $type = $_GET["type"]; $target_uuid = $_GET['target_uuid']; $target_name = $_GET['target_name']; $f = new ValidatingForm(); // Set title if ($type == '') { // Computer if (!xmlrpc_isComputerRegistered($target_uuid) && !xmlrpc_isComputerInProfileRegistered($target_uuid)) { $f->add(new TitleElement(sprintf(_T("Register computer '%s'", "imaging"), $target_name))); } } else { // Profile if (!xmlrpc_isProfileRegistered($target_uuid)) { $f->add(new TitleElement(sprintf(_T("Imaging activation for group '%s'", "imaging"), $target_name))); } } // Get boot menu if ($type == '') { // Computer $ret = xmlrpc_getMyMenuComputer($target_uuid); } else { // Profile $ret = xmlrpc_getMyMenuProfile($target_uuid); }
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"; ?> <!--Click on to validate disposed of the response file .on smb: // ipPulse / postinst / sysprep /--> <?php if (isset($_SESSION['parameters'])) { //If this session exists : editing file, else creating file $parameters = $_SESSION['parameters']; } $f = new ValidatingForm(array("id" => "formxml")); $f->add(new HiddenTpl("codeToCopy"), array("value" => "", "hide" => True)); $f->add(new HiddenTpl("infobulexml"), array("value" => '', "hide" => True)); //==== NEW SECTION ==== // Installation Notes //===================== //Add section title $f->add(new TitleElement(_T("Installation Notes", "imaging"))); $f->add(new TrFormElement("", new Iconereply('Installation_Notes', $InfoBule_Installation_Notes))); $f->push(new Table()); //_____________ $f->add(new TrFormElement(_T('Title', 'imaging'), new InputTplTitle('Location', "name file xml")), array("required" => True, 'value' => isset($parameters) ? $parameters['Title'] : '')); //_____________ $f->add(new TrFormElement("Notes" . ":", new OptTextareaTpl(array('name' => 'Comments', 'value' => isset($parameters) ? $parameters['Notes'] : 'Enter your comments here...')))); $f->pop(); //Add empty line for separation $f->add(new SepTpl());
natcasesort($left); $f = new ValidatingForm(); $f->push(new Table()); $trOptions = array('firstColWidth' => '200px'); $rb = new RadioTpl("proxy_mode"); $rb->setChoices(array(_T('Single with fallback', 'msc'), _T('Multiple', 'msc'))); $rb->setvalues(array('single', 'multiple')); if (!empty($_POST["proxy_mode"])) { $proxy_mode = $_POST["proxy_mode"]; unset($_POST["proxy_mode"]); // to prevent hidden field setting below } else { $proxy_mode = web_local_proxy_mode(); } $rb->setSelected($proxy_mode); $f->add(new TrFormElement(_T('Local Proxy Mode', 'msc'), $rb, $trOptions)); if (!empty($_POST["max_clients_per_proxy"])) { $max_clients_per_proxy_value = $_POST["max_clients_per_proxy"]; unset($_POST["max_clients_per_proxy"]); // to prevent hidden field setting below } else { $max_clients_per_proxy_value = web_max_clients_per_proxy(); } $f->add(new TrFormElement(_T('Maximum number of simultaneous connections to a proxy', 'msc'), new MyNumericInputTpl("max_clients_per_proxy"), $trOptions), array("value" => $max_clients_per_proxy_value, "required" => True)); if (!empty($_POST["proxy_number"])) { $proxy_number = $_POST["proxy_number"]; unset($_POST["proxy_number"]); // to prevent hidden field setting below } else { $proxy_number = web_proxy_number(); }
//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(); }
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();
$_SESSION['PACKAGEAPI'] = array(); } foreach ($res as $mirror) { $list_val[$mirror['uuid']] = $mirror['uuid']; $list[$mirror['uuid']] = $mirror['mountpoint']; $_SESSION['PACKAGEAPI'][$mirror['uuid']] = $mirror; } $span = new SpanElement(_T("Choose package source", "pkgs"), "pkgs-title"); $selectpapi = new SelectItem('p_api'); $selectpapi->setElements($list); $selectpapi->setElementsVal($list_val); $_SESSION['pkgs_selected'] = array_values($list_val)[0]; $f = new ValidatingForm(); $f->push(new Table()); // Step title $f->add(new TrFormElement("", $span), array()); $r = new RadioTpl("package-method"); $vals = array("package", "upload", "empty"); $keys = array(_T("Already uploaded on the server", "pkgs"), _T("Upload from this web page", "pkgs"), _T("Make an empty package", "pkgs")); $r->setValues($vals); $r->setChoices($keys); // Package API $f->add(new TrFormElement("<div id=\"p_api_label\">" . _T("Package API", "pkgs") . "</div>", $selectpapi), array("value" => $p_api_id, "required" => True)); $f->add(new TrFormElement(_T("Package source", "pkgs"), $r), array()); $f->add(new TrFormElement("<div id='directory-label'>" . _T("Files directory", "pkgs") . "</div>", new Div(array("id" => "package-temp-directory"))), array()); $f->add(new HiddenTpl("mode"), array("value" => "creation", "hide" => True)); $span = new SpanElement(_T("Package Creation", "pkgs"), "pkgs-title"); $f->add(new TrFormElement("", $span), array()); // fields $fields = array(array("label", _T("Name", "pkgs"), array("required" => True, 'placeholder' => _T('<fill_package_name>', 'pkgs'))), array("version", _T("Version", "pkgs"), array("required" => True)), array('description', _T("Description", "pkgs"), array())); $command = _T('Command:', 'pkgs') . '<br /><br />';
$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) { $moduleObj = $MMCApp->getModule($module_name); if ($moduleObj) {
* along with MMC. If not, see <http://www.gnu.org/licenses/>. */ /* common ajax includes */ require("../includes/ajaxcommon.inc.php"); $t = new TitleElement(_T("Imaging server configuration", "imaging"), 3); $t->display(); $config = xmlrpc_getImagingServerConfig($location); $imaging_server = $config[0]; $default_menu = $config[1]; $f = new ValidatingForm(array("action"=>urlStrRedirect("imaging/manage/save_configuration"),)); $f->add(new HiddenTpl("is_uuid"), array("value" => $imaging_server['imaging_uuid'], "hide" => True)); /* We dont have this information right now in the database schema $f->add(new TitleElement(_T("Traffic control", "imaging"))); $f->push(new Table()); $interfaces = array("eth0" => "eth0", "eth1" => "eth1"); $ifaces = new SelectItem("net_int"); $ifaces->setElements($interfaces); $ifaces->setElementsVal($interfaces); $f->add( new TrFormElement(_T("Network interface on which traffic shaping is done", "imaging"), $ifaces) ); $f->add( new TrFormElement(_T("Network interface theorical throughput (Mbit)", "imaging"), new InputTpl("net_output")), array("value" => "1000")
if ($ret['id'] == $SYNCHROSTATE_RUNNING) { $p = new PageGenerator(sprintf(_T("%s's profile imaging", 'imaging'), $group->getName())); $sidemenu->forceActiveItem("index"); $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'];
$ro = False; if ($is_image) { $default_name = $item['image']['default_name']; } else { $default_name = $item['boot_service']['default_name']; if (!isset($item['is_local'])) { $ro = True; } } $p = new PageGenerator(sprintf(_T("Edit : %s", "imaging"), $label)); $sidemenu->forceActiveItem("bootmenu"); $p->setSideMenu($sidemenu); $p->display(); $f = new ValidatingForm(); $f->push(new Table()); $f->add(new HiddenTpl("location"), array("value" => $location, "hide" => True)); $input = new TrFormElement(_T('Default menu item label', 'imaging'), new InputTpl("default_name")); $f->add($input, array("value" => $default_name, "disabled" => $ro ? 'disabled' : '')); $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 { $is_image = True; if ($item['boot_service']) { $bs_uuid = $item['boot_service']['imaging_uuid']; $is_image = False;
//$p->addTab("tabfromfile", _T("Static imaging group from import", "dyngroup"), "", "modules/dyngroup/dyngroup/import_from_file.php", $params); echo '<style type="text/css">'; echo '.tabselector { display: none;}'; echo '</style>'; if (!isset($_GET['tab'])) { $params['tab'] = 'tabsta'; header("Location: " . urlStrRedirect("imaging/manage/computersprofilecreator", $params)); } $p->addTab("tabsta", _T("Static imaging group", "dyngroup"), "", "modules/dyngroup/dyngroup/add_groups.php", $params); $p->display(); } else { $p = new PageGenerator(_T('Imaging server selection', 'dyngroup')); $p->setSideMenu($sidemenu); require_once "modules/pulse2/includes/profiles_xmlrpc.inc.php"; $f = new ValidatingForm(); $f->add(new HiddenTpl("id"), array("value" => $gid, "hide" => True)); $f->push(new Table()); $imss = xmlrpc_getAllImagingServersForProfiles(true); $elt = array(); $elt_values = array(); foreach ($imss as $uuid => $imaging_server) { $elt[$uuid] = $imaging_server['name']; $elt_values[$uuid] = $uuid; } $imss = new SelectItem("imaging_server"); $imss->setElements($elt); $imss->setElementsVal($elt_values); $f->add(new TrFormElement(_T("Select an imaging server for this group", "dyngroup"), $imss)); $f->pop(); $f->addValidateButton("bvalid"); $p->display();
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(); }
$p->addTab($prefix . "tab{$i}", _T($tab, 'inventory'), "", "modules/inventory/inventory/view_part.php", array('uuid' => $_GET['uuid'], 'hostname' => $_GET['hostname'], 'part' => $tab, 'gid' => $gid, 'groupname' => $groupname)); $tab = 'Hardware'; $i = 0; $p->addTab($prefix . "tab{$i}", _T($tab, 'inventory'), "", "modules/inventory/inventory/view_part.php", array('uuid' => $_GET['uuid'], 'hostname' => $_GET['hostname'], 'part' => $tab, 'gid' => $gid, 'groupname' => $groupname)); $tab = 'Storage'; $i = 8; $p->addTab($prefix . "tab{$i}", _T($tab, 'inventory'), "", "modules/inventory/inventory/view_part.php", array('uuid' => $_GET['uuid'], 'hostname' => $_GET['hostname'], 'part' => $tab, 'gid' => $gid, 'groupname' => $groupname)); /* $tab = 'Bios'; $i = 5; $p->addTab($prefix . "tab$i", _T($tab, 'inventory'), "", "modules/inventory/inventory/view_part.php", array('uuid' => $_GET['uuid'], 'hostname' => $_GET['hostname'], 'part' => $tab, 'gid' => $gid, 'groupname' => $groupname)); */ $i = 1; foreach (array('Network', 'Software', 'Registry') as $tab) { // , 'Administrative' $p->addTab($prefix . "tab{$i}", _T($tab, 'inventory'), "", "modules/inventory/inventory/view_part.php", array('uuid' => $_GET['uuid'], 'hostname' => $_GET['hostname'], 'part' => $tab, 'gid' => $gid, 'groupname' => $groupname)); $i++; } $tab = 'History'; $i++; $p->addTab($prefix . "tab{$i}", _T('History', 'inventory'), "", "modules/inventory/inventory/history.php", array('uuid' => $_GET['uuid'], 'hostname' => $_GET['hostname'], 'part' => $tab, 'gid' => $gid, 'groupname' => $groupname)); $p->display(); $uuid = $_GET['uuid']; if (isset($uuid)) { $f = new ValidatingForm(); print "<br><br>"; $result['xls_path'] = getReport($uuid, $_SESSION['lang']); $link = new SpanElement(sprintf('<br /><a class="btn btn-primary" href="%s">%s</a> ', urlStrRedirect("base/computers/get_file", array('path' => $result['xls_path'])), _T("Get XLS Report", "inventory"))); $f->add($link); $f->pop(); $f->display(); }
$result .= _T(" The quota of all users of this mail domain have been reset.") . "<br />"; } // Display result message if ($result && !isXMLRPCError()) { new NotifyWidgetSuccess($result); } } } } $p = new PageGenerator($title); $p->setSideMenu($sidemenu); $p->display(); $f = new ValidatingForm(); $f->push(new Table()); if ($mode == "add") { $domainTpl = new DomainInputTpl("domainname"); } else { $domainTpl = new HiddenTpl("domainname"); } $f->add(new TrFormElement(_T("Mail domain"), $domainTpl), array("value" => $domainname, "required" => true)); $f->add(new TrFormElement(_T("Description"), new InputTpl("description")), array("value" => $description)); $f->add(new TrFormElement(_T("Default mail quota for users created in this domain (in kB)"), new QuotaTpl("domainquota", '/^[0-9]*$/')), array("value" => $domainquota)); $f->pop(); if ($mode == "add") { $f->addButton("badd", _("Create")); } else { $f->addExpertButton("breset", _T("Reset users quota to default", "mail")); $f->addButton("bedit", _("Confirm")); } $f->pop(); $f->display();
} } 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")) #); $value = ""; #if ($smb["hashomes"]) $value = "checked"; $f->add(new TrFormElement(_T("Share user's homes"), new CheckboxTpl("hashomes")), array("value" => $value)); $value = "";
$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"); $types = array("" => "Auto", "1" => _T("Broadcast only"), "2" => _T("WINS only"), "4" => _T("Broadcast, then WINS"), "8" => _T("WINS, then broadcast"));
if ($_GET["action"] == "add") { if (in_array("pulse2", $_SESSION["modulesList"])) { /* Be more permissive for Pulse 2 computer name, as it will be checked internally. */ $formElt = new InputTpl("computername"); } else { $formElt = new DomainInputTpl("computername"); } } else { $formElt = new HiddenTpl("computername"); } $computername = isset($_POST["computername"]) ? $_POST["computername"] : ''; $computerdescription = isset($_POST["computerdescription"]) ? $_POST["computerdescription"] : ''; $f->add(new TrFormElement(_("Computer name"), $formElt), array("value" => $computername, "required" => True)); $f->add(new TrFormElement(_("Description"), new InputTpl("computerdescription")), array("value" => $computerdescription)); $addParams = neededParamsAddComputer(); foreach ($addParams as $p) { if ($p[1] == 'string') { /* Protect input fields according to the field type */ switch ($p[0]) { case "computerip": $input = new IPInputTpl($p[0]); break; case "computermac": $input = new MACInputTpl($p[0]); break; case "computernet": $input = new IPInputTpl($p[0]); break;
'</component>', '</settings>', '<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);
$ID = intval(@max($_GET['id'], $_POST['id'])); $NAME = $_GET['Label']; $PARENTID = intval(@max($_GET['parentId'], $_POST['parentId'])); if (isset($_POST['bconfirm'])) { $cfg = array('name' => $_POST['name'], 'id' => $_POST['id'], 'parentId' => $_POST['parentId']); if ($ID && $ID != 1) { deleteEntities($cfg['id'], $cfg['name'], $cfg['parentId']); if (!isXMLRPCError()) { header('location: main.php?module=base&submod=computers&action=entityList'); } else { new NotifyWidgetFailure(_T("The entity has not been deleted.", "inventory")); } } } $p = new PageGenerator(_T("Delete entity", "inventory")); $p->setSideMenu($sidemenu); $p->display(); if ($ID == 1) { header('location: main.php?module=base&submod=computers&action=entityList'); exit(0); } $f = new ValidatingForm(); $f->push(new Table()); $f->add(new TrFormElement(_T('Name', 'inventory'), new InputTpl('name')), array("value" => $NAME, "required" => True)); if ($ID) { $f->add(new HiddenTpl("id"), array("value" => $ID, "hide" => True)); $f->add(new HiddenTpl("parentId"), array("value" => $PARENTID, "hide" => True)); } $f->pop(); $f->addValidateButton("bconfirm"); $f->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")); $f->add(new TrFormElement(_T("Protocol"), $protoTpl)); $f->add(new TrFormElement(_T("Port(s)"), new InputTpl("port", "/^[0-9:,]+\$/"), array("tooltip" => _T("You can specify multiple ports using ',' as separator (eg: 22,34,56). Port ranges can be defined with ':' (eg: 3400:3500 - from port 3400 to port 3500)."))), array("value" => "")); $f->pop(); $f->pop(); $f->push(new Table()); $zones = getZonesInterfaces($src); if (count($zones) > 1) {
} } require "modules/samba/mainSidebar.php"; require "graph/navbar.inc.php"; $p = new PageGenerator(_T("General options")); $p->setSideMenu($sidemenu); $p->display(); $smb = get_smbconf(); $f = new ValidatingForm(); $f->push(new Table()); if ($smb["pdc"]) { $workgroupTpl = new HiddenTpl("workgroup"); } else { $workgroupTpl = new NetbiosUppercaseInputTpl("workgroup"); } $f->add(new TrFormElement(_T("Domain name"), $workgroupTpl), array("value" => $smb["workgroup"], "required" => True)); $f->add(new TrFormElement(_T("Server name"), new NetbiosUppercaseInputTpl("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"))); $value = ""; if ($smb["hashomes"]) { $value = "checked"; } $f->add(new TrFormElement(_T("Share user's homes"), new CheckboxTpl("hashomes")), array("value" => $value)); $value = ""; $hasProfiles = false; if ($smb['logon path']) {