$editAction = new ActionItem(_T("edit static host", "network"), "subnetedithost", "edit", "ipaddress", "network", "network"); $emptyAction = new EmptyActionItem(); foreach ($lines as $ipaddress => $infos) { $hosts[] = $infos["hostname"]; $ipaddresses[] = long2ip($ipaddress); $macaddresses[] = $infos["macaddress"]; $types[] = $infos["type"]; $params[] = array("host" => $infos["hostname"], "macaddress" => $infos["macaddress"], "subnet" => $subnet); if ($infos["type"] == _T("Static", "network")) { $actionsAdd[] = $emptyAction; $actionsDel[] = $deleteAction; $actionsEdit[] = $editAction; } else { $actionsAdd[] = $addAction; $actionsDel[] = $emptyAction; $actionsEdit[] = $emptyAction; } } $n = new ListInfos($ipaddresses, _T("IP address", "network")); $n->setNavBar(new AjaxNavBar(count($ipaddresses), $filter)); $n->disableFirstColumnActionLink(); $n->setTableHeaderPadding(1); $n->addExtraInfo($hosts, _T("Host name", "network")); $n->addExtraInfo($macaddresses, _T("MAC address", "network")); $n->addExtraInfo($types, _T("Type", "network")); $n->setName(_T("Host", "network")); $n->setParamInfo($params); $n->addActionItemArray($actionsAdd); $n->addActionItemArray($actionsEdit); $n->addActionItemArray($actionsDel); $n->display();
<? $arrayTMP = getStatutProxy(); foreach($arrayTMP as $key => $value) { $info[]=$key; if ($value) $extraInfo[]=_T("enabled"); else $extraInfo[]=_T("disabled"); } $p = new PageGenerator(); $p->setSideMenu($sidemenu); $p->displaySideMenu(); $n = new ListInfos($info,_T("Services")); $n->setName(_T("Proxy status")); $n->addExtraInfo($extraInfo,_T("Status")); $n->display(0); ?> <form method="post" action="main.php?module=proxy&submod=blacklist&action=restart"> <input name="goto" type="hidden" value="<?php echo $root; ?> main.php" /> <input name="brestart" type="submit" class="btnPrimary" value="<?php echo _T('Restart service'); ?> " /> </form>
* 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, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require "modules/samba/includes/machines.inc.php"; $filter = $_GET['filter']; $computers = search_machines($filter); //print_r($computers); $names = array(); $desc = array(); $active = array(); foreach ($computers as $computer) { $names[] = $computer[0]; $desc[] = $computer[1]; $active[] = $computer[2]; } $l = new ListInfos($names, _T("Computer name", "samba")); $l->disableFirstColumnActionLink(); $l->setCssClass("machineName"); $l->setNavBar(new AjaxNavBar(count($computers), $filter)); $l->addExtraInfo($desc, _T("Description", "samba")); $l->addExtraInfo($active, _T("Active", "samba")); $l->addActionItem(new ActionItem(_T("Edit"), "edit", "edit", "machine")); $l->addActionItem(new ActionPopupItem(_T("Delete"), "delete", "delete", "machine")); $l->setName(_("Computers")); $l->display();
} else { $status[] = _T("Stopped"); $actionsStart[] = $startAction; $actionsStop[] = $emptyAction; $actionsRestart[] = $emptyAction; } $actionsLog[] = $logAction; $actionsReload[] = $reloadAction; if (dnsService("status")) { $status[] = _T("Started"); $actionsStart[] = $emptyAction; $actionsStop[] = $stopAction; $actionsRestart[] = $restartAction; } else { $status[] = _T("Stopped"); $actionsStart[] = $startAction; $actionsStop[] = $emptyAction; $actionsRestart[] = $emptyAction; } $l = new ListInfos(array("DHCP", "DNS"), _T("Services")); $l->setName(_T("Network services status")); $l->addExtraInfo($status, _T("Status")); $l->setParamInfo(array(array("service" => "DHCP"), array("service" => "DNS"))); $l->setTableHeaderPadding(1); $l->disableFirstColumnActionLink(); $l->addActionItemArray($actionsStart); $l->addActionItemArray($actionsStop); $l->addActionItemArray($actionsRestart); $l->addActionItemArray($actionsReload); $l->addActionItemArray($actionsLog); $l->display(0);
* * 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, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require "modules/base/includes/groups.inc.php"; $filter = $_GET["filter"]; $groups = search_groups($filter); $groupcount = count($groups); $arrGroup = array(); $arrComment = array(); for ($idx = 0; $idx < count($groups); $idx++) { $arrGroup[] = $groups[$idx][0]; $arrComment[] = $groups[$idx][1]; $arrNb[] = '<span style="font-weight: normal;">(' . $groups[$idx][2] . ')</span>'; } $n = new ListInfos($arrGroup, _("Groups")); $n->setCssClass("groupName"); $n->addExtraInfo($arrComment, _("Comments")); $n->setAdditionalInfo($arrNb); $n->setNavBar(new AjaxNavBar($groupcount, $filter)); $n->addActionItem(new ActionItem(_("Edit members"), "members", "display", "group")); $n->addActionItem(new ActionItem(_("Edit group"), "edit", "edit", "group")); $n->addActionItem(new ActionPopupItem(_("Delete"), "delete", "delete", "group")); $n->setName(_("Groups management")); $n->display();
<h2><?php echo _T("Blacklist management"); ?> </h2> <div class="fixheight"></div> <?php $arrB = get_nonIndexBlackList(); $p = new PageGenerator(); $p->setSideMenu($sidemenu); $p->displaySideMenu(); $n = new ListInfos($arrB); $n->addActionItem(new ActionPopupItem(_("Delete"), "delete", "delete", "blacklist")); $n->setName(_T("Blacklist entries")); $n->display(); ?> </form> </form> <form method="post" action="main.php?module=proxy&submod=blacklist&action=restart"> <input name="goto" type="hidden" value="<?php echo $root; ?> main.php" /> <input name="brestart" type="submit" class="btnPrimary" value="<?php echo _T("Restart service"); ?> " />
// restart service button if (isset($_POST["btApply"])) { include 'restart.php'; } } // Get keywords and Domain list from /etc/squid/rules/group_internet/normal_blacklist.txt $arrB = get_list($list); //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"));
$zones[$zonename]["description"] .= $value . " "; } } } ksort($zones); $descriptions = array(); $reverses = array(); $count = array(); foreach ($zones as $zone => $infos) { $count[] = '<span style="font-weight: normal;">(' . getZoneObjectsCount($zone) . ')</span>'; $descriptions[] = $infos["description"]; $reverse = getZoneNetworkAddress($zone); if (!$reverse) { $reverses[] = "None"; } else { $reverses[] = $reverse[0] . "."; } } $n = new ListInfos(array_keys($zones), _T("DNS zones", "network")); $n->setNavBar(new AjaxNavBar(count($zones), $filter)); $n->setAdditionalInfo($count); $n->first_elt_padding = 1; $n->addExtraInfo($reverses, _T("Network prefix", "network")); $n->addExtraInfo($descriptions, _T("Description", "network")); $n->setName(_T("DNS zones", "network")); $n->addActionItem(new ActionItem(_T("View zone members", "network"), "zonemembers", "zonemembers", "zone", "network", "network")); $n->addActionItem(new ActionItem(_T("View zone records", "network"), "zonerecords", "display", "zone", "network", "network")); $n->addActionItem(new ActionItem(_T("Edit zone", "network"), "edit", "edit", "zone", "network", "network")); $n->addActionItem(new ActionItem(_T("Add host", "network"), "addhost", "addhost", "zone", "network", "network")); $n->addActionItem(new ActionPopupItem(_T("Delete zone", "network"), "delete", "delete", "zone", "network", "network")); $n->display();
$inventoriesDates = array(); $inventoriesId = array(); $detailsParams = array(); $detailsButtons = array(); $i = 0; // Call the methods to get the inventory history $count = countMachineInventoryHistory($params); $inventory_history = getMachineInventoryHistory($params); // Loop through the inventory history to extract infos foreach ($inventory_history as $inventory) { $inventoriesDates[] = _toDate($inventory[1]); // Add the details link (unless we are on the last line) if ($i < count($inventory_history) - 1) { $detailsButtons[] = new ActionItem(_T("View differences since previous inventory", "inventory"), "invdiff", "display"); } else { $detailsButtons[] = new EmptyActionItem(); } $detailsParams[$i]['inventoryId'] = $inventory[0]; $detailsParams[$i++]['uuid'] = $params['uuid']; } // Create a ListInfos that will display the inventories dates $list = new ListInfos($inventoriesDates, _T("Inventory Date", "inventory")); // Add extra params in the "details" link $list->setParamInfo($detailsParams); $list->disableFirstColumnActionLink(); $list->setName(_T("Inventory", "inventory")); $list->addActionItemArray($detailsButtons); $list->setTableHeaderPadding(0); $list->start = 0; $list->end = count($inventoriesDates); $list->display();
} // Loop through the added elements parts to display it foreach ($removed_elems as $part => $removed_part) { if (!empty($removed_part)) { // Loop through each element of the part foreach ($removed_part as $elem) { // Loop through elems to change arrays into dates foreach ($elem as $k => $v) { if (is_array($v)) { $elem[$k] = _toDate($v); } } // Create a ListInfos to display the infos of the element in a list $list = new ListInfos(array_keys($elem), _T("Element", "inventory")); $list->addExtraInfo(array_values($elem), _T("Value", "inventory")); $list->setName(_T($part)); $list->setTableHeaderPadding(0); // Append the ListInfo in an array, to display all ListInfos together at the end of the page loading $removed_part_lists[] = $list; } } } // Display the page $p->display(); // Display the added elements (without navbar) print "<h3>" . _T("Added elements", "inventory") . "</h3>"; foreach ($added_part_lists as $list) { print '<h4>' . $list->name . '</h4>'; $list->display($navbar = 0, $header = 0); } print "<br/><br/><br/>";
/** * (c) 2004-2007 Linbox / Free&ALter Soft, http://linbox.com * (c) 2007-2008 Mandriva, http://www.mandriva.com/ * * $Id$ * * This file is part of Mandriva Management Console (MMC). * * MMC is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ function list_computers($names, $filter, $count = 0, $delete_computer = false, $remove_from_result = false, $is_group = false, $msc_can_download_file = false, $msc_vnc_show_icon = false) { /* $pull_list is an array with UUIDs of pull machines */ $pull_list = in_array("pulse2", $_SESSION["modulesList"]) ? get_pull_targets() : array(); $emptyAction = new EmptyActionItem(); $inventAction = new ActionItem(_("Inventory"), "invtabs", "inventory", "inventory", "base", "computers"); $glpiAction = new ActionItem(_("GLPI Inventory"), "glpitabs", "inventory", "inventory", "base", "computers"); $logAction = new ActionItem(_("Read log"), "msctabs", "logfile", "computer", "base", "computers", "tablogs"); $mscAction = new ActionItem(_("Software deployment"), "msctabs", "install", "computer", "base", "computers"); $imgAction = new ActionItem(_("Imaging management"), "imgtabs", "imaging", "computer", "base", "computers"); $downloadFileAction = new ActionItem(_("Download file"), "download_file", "download", "computer", "base", "computers"); $vncClientAction = new ActionPopupItem(_("Remote control"), "vnc_client", "vncclient", "computer", "base", "computers"); $profileAction = new ActionItem(_("Show Profile"), "computersgroupedit", "logfile", "computer", "base", "computers"); $actionInventory = array(); $actionLogs = array(); $actionMsc = array(); $actionImaging = array(); $actionDownload = array(); $actionVncClient = array(); $actionProfile = array(); $params = array(); $cssClasses = array(); $headers = getComputersListHeaders(); $columns = array(); foreach ($headers as $header) { $columns[$header[0]] = array(); } function getUUID($machine) { return $machine['objectUUID']; } $uuids = array_map("getUUID", $names); /*if (in_array("dyngroup", $_SESSION["modulesList"])) { $profiles = xmlrpc_getmachinesprofiles($uuids); $h_profiles = array(); $i = 0; foreach ($uuids as $uuid) { $h_profiles[$uuid] = $profiles[$i++]; } }*/ foreach ($names as $value) { $cssClasses[] = in_array($value['objectUUID'], $pull_list) ? 'machinePull' : 'machineName'; foreach ($headers as $header) { if (!empty($value[$header[0]])) { $v = $value[$header[0]]; } else { $v = ''; } $columns[$header[0]][] = $v; } if (isset($filter['gid'])) { $value['gid'] = $filter['gid']; } if (in_array("inventory", $_SESSION["supportModList"])) { $actionInventory[] = $inventAction; } else { $actionInventory[] = $glpiAction; } if (in_array("msc", $_SESSION["supportModList"])) { $actionMsc[] = $mscAction; $actionLogs[] = $logAction; } if (in_array("imaging", $_SESSION["supportModList"])) { $actionImaging[] = $imgAction; } /* if (in_array("dyngroup", $_SESSION["modulesList"])) { $profile = $h_profiles[$value['objectUUID']]; if ($profile) { $actionProfile[] = $profileAction; $value['id'] = $profile; } else { $actionProfile[] = $emptyAction; } } */ if ($msc_can_download_file) { $actionDownload[] = $downloadFileAction; } if ($msc_vnc_show_icon) { $actionVncClient[] = $vncClientAction; } $params[] = $value; } if (isset($filter['location'])) { $filter = $filter['hostname'] . '##' . $filter['location']; } else { $filter = $filter['hostname'] . '##'; } $n = null; if ($count) { foreach ($headers as $header) { if ($n == null) { if (in_array("glpi", $_SESSION["modulesList"])) { $n = new OptimizedListInfos($columns[$header[0]], _T($header[1], 'glpi')); } else { $n = new OptimizedListInfos($columns[$header[0]], _($header[1])); } } else { if (in_array("glpi", $_SESSION["modulesList"])) { $n->addExtraInfo($columns[$header[0]], _T($header[1], 'glpi')); } else { $n->addExtraInfo($columns[$header[0]], _($header[1])); } } } $n->setItemCount($count); $n->setNavBar(new AjaxNavBar($count, $filter)); $n->start = 0; $n->end = $count - 1; } else { foreach ($headers as $header) { if ($n == null) { $n = new ListInfos($columns[$header[0]], _($header[1])); } else { $n->addExtraInfo($columns[$header[0]], _($header[1])); } } $n->setNavBar(new AjaxNavBar(count($columns[$headers[0][0]]), $filter)); } $n->setName(_("Computers list")); $n->setParamInfo($params); //$n->setCssClass("machineName"); $n->setMainActionClasses($cssClasses); $n->addActionItemArray($actionInventory); if ($msc_can_download_file) { $n->addActionItemArray($actionDownload); } if (in_array("backuppc", $_SESSION["supportModList"])) { $n->addActionItem(new ActionItem(_("Backup status"), "hostStatus", "backuppc", "backuppc", "backuppc", "backuppc")); } if ($msc_vnc_show_icon) { $n->addActionItemArray($actionVncClient); } /*if (in_array("dyngroup", $_SESSION["modulesList"])) { $n->addActionItemArray($actionProfile); }*/ if (in_array("msc", $_SESSION["supportModList"])) { $n->addActionItemArray($actionLogs); $n->addActionItemArray($actionMsc); } if (in_array("imaging", $_SESSION["supportModList"])) { $n->addActionItemArray($actionImaging); } if ($delete_computer && canDelComputer()) { // set popup window to 400px width $n->addActionItem(new ActionPopupItem(_("Delete computer"), "delete", "delete", "computer", "base", "computers", null, 400)); } if ($remove_from_result) { $n->addActionItem(new ActionPopupItem(_("Remove machine from group"), "remove_machine", "remove_machine", "name", "base", "computers")); } $n->display(); }
*/ require "modules/samba4/includes/machines-xmlrpc.inc.php"; $filter = $_GET['filter']; $domainMembers = listDomainMembers(); if (!isset($domainMembers) or !$domainMembers) { $domainMembers = array(); } $names = array(); $descriptions = array(); $computersEnabled = array(); foreach ($domainMembers as $computer) { $name = $computer["name"]; if (!$computer["enabled"]) { $computersEnabled[] = "disabledRow"; $name .= " (" . _T("Disabled") . ") "; } else { $computersEnabled[] = "enabledRow"; } $names[] = $name; $descriptions[] = $computer["description"]; } $list = new ListInfos($names, _T("Computer name", "samba4")); $list->disableFirstColumnActionLink(); $list->setCssClass("machineName"); $list->setCssClasses($computersEnabled); $list->setNavBar(new AjaxNavBar(count($domainMembers), $filter)); $list->addExtraInfo($descriptions, _T("Description", "samba4")); $list->addActionItem(new ActionItem(_T("Edit"), "edit", "edit", "machine")); //$list->addActionItem(new ActionPopupItem(_T("Delete"),"delete","delete","machine")); $list->setName(_("Computers")); $list->display();
if ($i < $rangesCount - 1){ if ($i == $showedRangesCount - 1) $rangesStr .= " <a href=\"#\" class=\"tooltip\">" . _T("More...","network") . "<span>"; else $rangesStr .= "<br>"; } } if ($rangesCount > $showedRangesCount) $rangesStr .= "</span></a>"; $ranges[] = ($rangesCount) ? $rangesStr : _T("No dynamic address pool", "network"); } $n = new ListInfos(array_keys($subnets), _T("DHCP subnets", "network")); $n->setNavBar(new AjaxNavBar(count($subnets), $filter)); $n->setAdditionalInfo($count); $n->first_elt_padding = 1; $n->addExtraInfo($netmasks, _T("Netmask", "network")); $n->addExtraInfo($names, _T("Description", "network")); $n->addExtraInfo($ranges, _T("Dynamic pool range(s)", "network")); $n->setName(_T("DHCP subnets", "network")); $n->addActionItem(new ActionItem(_T("View DHCP static host", "network"),"subnetmembers","display", "subnet", "network", "network")); $n->addActionItem(new ActionItem(_T("Edit subnet", "network"),"subnetedit","edit","subnet", "network", "network")); $n->addActionItem(new ActionItem(_T("Add static host to subnet", "network"),"subnetaddhost","addhost","subnet", "network", "network")); $n->addActionItem(new ActionPopupItem(_T("Delete zone", "network"),"subnetdelete","delete","subnet", "network", "network")); $n->display(); ?>
<?php require_once "modules/mail/includes/mail-xmlrpc.php"; if (isset($_GET["filter"])) { $filter = $_GET["filter"]; } else { $filter = ""; } $domains = array(); $count = array(); foreach (getVDomains($filter) as $dn => $entry) { $domains[$entry[1]["virtualdomain"][0]] = $entry[1]["virtualdomaindescription"][0]; } ksort($domains); foreach ($domains as $domain => $info) { $count[] = '<span style="font-weight: normal;">(' . getVDomainUsersCount($domain) . ')</span>'; } $n = new ListInfos(array_keys($domains), _T("Mail domain", "mail")); $n->setNavBar(new AjaxNavBar(count($domains), $filter)); $n->setAdditionalInfo($count); $n->first_elt_padding = 1; $n->setCssClass("domainName"); $n->addExtraInfo(array_values($domains), _T("Description", "mail")); $n->setName(_T("Mail domain", "mail")); $n->addActionItem(new ActionItem(_T("View domain members", "mail"), "members", "display", "domain", "mail", "domains")); $n->addActionItem(new ActionItem(_T("Edit domain", "mail"), "edit", "edit", "domain", "mail", "domains")); $n->addActionItem(new ActionPopupItem(_T("Delete domain", "mail"), "delete", "delete", "domain", "mail", "domains")); $n->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/>. */ require_once "modules/mail/includes/mail.inc.php"; if (isset($_GET["filter"])) { $filter = $_GET["filter"]; } else { $filter = ""; } $aliases = array(); $count = array(); $active = array(); foreach (getVAliases($filter) as $dn => $entry) { $aliases[$entry[1]["mailalias"][0]] = $entry[1]["mailalias"][0]; $active[] = $entry[1]["mailenable"][0] == "OK" ? true : false; $count[] = ' (' . (count($entry[1]["mailaliasmember"]) + count($entry[1]["mail"])) . ')'; } $n = new ListInfos(array_keys($aliases), _T("Virtual alias", "mail")); $n->setNavBar(new AjaxNavBar(count($aliases), $filter)); $n->setAdditionalInfo($count); $n->addExtraInfo($active, _T("Enabled", "mail")); $n->first_elt_padding = 1; $n->setCssClass("virtualAlias"); $n->setName(_T("Virtual alias", "mail")); $n->addActionItem(new ActionItem(_T("Edit alias", "mail"), "edit", "edit", "alias", "mail", "aliases")); $n->addActionItem(new ActionPopupItem(_T("Delete alias", "mail"), "delete", "delete", "alias", "mail", "aliases")); $n->display();