Exemple #1
0
    }
    return $ret;
}
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/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 = "";
Exemple #2
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();
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC.  If not, see <http://www.gnu.org/licenses/>.
 */
/* 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']]);
 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 #5
0
    $statements = getSubnetStatements($subnetInfos);
    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"]));
Exemple #6
0
 *
 * 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));
    /* 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(
Exemple #7
0
        $is_wol_displayed = '';
    }
    $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']) {
Exemple #8
0
    $f->pop();
    $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 */
Exemple #9
0
require "localSidebar.php";
require "graph/navbar.inc.php";
$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);
Exemple #10
0
         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));
         exit;
     } else {
         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
Exemple #11
0
<?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";
?>
<!--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
Exemple #12
0
        $list = array_map(format, $list);
    } else {
        $list = $group->members();
    }
    /* all computers of the group */
    $machines = array();
    foreach ($list as $machine) {
        $machines[$machine['hostname'] . "##" . $machine['uuid']] = $machine['hostname'];
    }
    $right = array();
}
reset($right);
ksort($machines);
$left = array_diff_assoc($machines, $right);
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"])) {
Exemple #13
0
//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();
}
Exemple #14
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 #15
0
$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();
Exemple #16
0
<?php 
require "graph/navbar.inc.php";
require "localSidebar.php";
require_once "modules/report/includes/xmlrpc.inc.php";
require_once "modules/report/includes/html.inc.php";
require_once "modules/report/includes/report.inc.php";
require_once "modules/pulse2/includes/utilities.php";
$MMCApp =& MMCApp::getInstance();
$report = get_report_sections($_SESSION['lang']);
$p = new PageGenerator();
$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[]');
Exemple #17
0
 $p_api_id = $res[0]['uuid'];
 $list_val = $list = array();
 if (!isset($_SESSION['PACKAGEAPI'])) {
     $_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());
Exemple #18
0
        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();
Exemple #19
0
            $exitrule = True;
        }
    }
} 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));
Exemple #20
0
    $resultPopup->add('<div class="alert alert-success">' . $result . '</div>');
}
// in case of modification/creation success, redirect to the edit page
if ($redirect) {
    header('Location: ' . urlStrRedirect("base/users/edit", array("user" => $uid)));
    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();
}
Exemple #21
0
    $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>";
}
Exemple #22
0
     //$p->addTab("tabdyn", _T("Result imaging group", "dyngroup"), "", "modules/dyngroup/dyngroup/creator.php", $params);
     //$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");
Exemple #23
0
            $result = _T("The mail domain has been modified.", "mail") . "<br />";
            if (isset($_POST["breset"])) {
                resetUsersVDomainQuota($domainname);
                $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"));
Exemple #24
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 = '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>&nbsp;&nbsp;', urlStrRedirect("base/computers/get_file", array('path' => $result['xls_path'])), _T("Get XLS Report", "inventory")));
    $f->add($link);
    $f->pop();
    $f->display();
}
Exemple #25
0
global $SYNCHROSTATE_TODO;
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>";
}
Exemple #26
0
    return $ret;
}
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")),
Exemple #27
0
'<RestartEnabled>true</RestartEnabled>',
'</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);
Exemple #28
0
}
$p = new PageGenerator();
if ($_GET["action"] == "add") {
    $title = _("Add a computer");
} else {
    $title = _("Edit a computer");
    $sidemenu->forceActiveItem("index");
}
$p->setTitle($title);
$p->setSideMenu($sidemenu);
$p->display();
if ($err) {
    $err->display();
}
$formfields = array("computername", "computerdescription");
$f = new ValidatingForm();
$f->push(new Table());
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"] : '';
Exemple #29
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();
}
    if ($error) {
        $resultPopup->add('<div class="alert alert-error">' . $error . '</div>');
        $resultPopup->setLevel(5);
    }
    // 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));