$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();
* 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();
$display = True; if ($filter) { /* Don't display a host if filtered */ if (strpos($host, $filter) === False && strpos($ipstr, $filter) === False) { $display = False; } } if ($display) { $ips[] = $ipstr; $params[] = array("host" => $host, "zone" => $zone); if (in_array($host, array_keys($cnames))) { $host = "{$host} " . sprintf(_T("(alias of %s)", "network"), $cnames[$host]); $actionsMod[] = $emptyAction; $actionsDel[] = $delAliasAction; } else { $actionsMod[] = $editAction; $actionsDel[] = $delHostAction; } $hosts[] = $host; } } $n = new ListInfos($ips, _T("IP address", "network")); $n->setTableHeaderPadding(1); $n->setNavBar(new AjaxNavBar(count($ips), $filter)); $n->addExtraInfo($hosts, _T("Host name", "network")); $n->setName(_T("Host", "network")); $n->setParamInfo($params); $n->disableFirstColumnActionLink(); $n->addActionItemArray($actionsMod); $n->addActionItemArray($actionsDel); $n->display();
$states[] = _T('Downloading', 'msc'); $flengths[] = ''; $actionsdl[] = new EmptyActionItem(); $actionsrm[] = new EmptyActionItem(); } else { if ($file[0] == '' && $file[3] == -1) { $states[] = _T('Error', 'msc'); $flengths[] = ''; $actionsdl[] = new EmptyActionItem(); $actionsrm[] = $actionRemove; } else { $states[] = _T('Ready', 'msc'); $flengths[] = $file[3]; $actionsdl[] = $actionDownload; $actionsrm[] = $actionRemove; } } } } $l = new ListInfos($ftimestamps, _T('Timestamp', 'msc')); $l->addExtraInfo($fcomputers, _T('From computer', 'msc')); $l->addExtraInfo($fnames, _T('File name', 'msc')); $l->addExtraInfo($flengths, _T('Length', 'msc')); $l->addExtraInfo($states, _T('Status', 'msc')); $l->addActionItemArray($actionsdl); $l->addActionItemArray($actionsrm); $l->setTableHeaderPadding(1); $l->disableFirstColumnActionLink(); $l->setParamInfo($finodes); $l->setNavBar(new AjaxNavBar(count($fnames), $filter)); $l->display();
function display() { $lines = array(); $errlines = array(); foreach ($this->logs as $line => $msg) { if (strpos($msg, "===") === 0) { $msg = "<b>" . "{$msg}" . "</b>"; } else { if (strpos($msg, $this->errstr) === 0) { $msg = "<span id=\"err{$line}\" class=\"LOG_ERR\">" . "{$msg}" . "</span>"; $errlines[] = $line; } } foreach ($this->colors as $pattern => $color) { if (strpos($msg, $pattern) > 0) { $msg = "<span id=\"err{$line}\" class=\"{$color}\">" . "{$msg}" . "</span>"; continue; } } $lines[] = sprintf("<span class=\"linenumber\">%04d:</span>", $line) . " " . $msg; } foreach ($errlines as $line) { print "<p class =\"LOG_ERR\" onClick=\"javascript:new Element.scrollTo('err{$line}');\">Click here to scroll to error on line {$line}.</p>"; } $l = new ListInfos($lines, _T("Backup log messages", "imaging")); $l->setCssClass("imagelogs"); $l->setRowsPerPage(count($lines)); $l->setNavBar(False); $l->display(0, 1); }
$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();
* * 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();
*/ 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();
/** * (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(); }
$rangesStr .= "$ipstart -> $ipend"; 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();
$filter = $_GET["filter"]; } else { $filter = ""; } $editActions = array(); $delActions = array(); $ppolicies = array(); foreach (listPPolicy($filter) as $dn => $entry) { $name = $entry[1]["cn"][0]; $desc = ''; if (isset($entry[1]["description"][0])) { $desc = $entry[1]["description"][0]; } # don't allow to remove the default password policy if ($name == getDefaultPPolicyName()) { $desc = _T($desc, "ppolicy"); $editActions[] = new ActionItem(_T("Edit password policy", "ppolicy"), "editppolicy", "edit", "ppolicy", "base", "users"); $delActions[] = new EmptyActionItem(); } else { $editActions[] = new ActionItem(_T("Edit password policy", "ppolicy"), "editppolicy", "edit", "ppolicy", "base", "users"); $delActions[] = new ActionPopupItem(_T("Delete password policy", "ppolicy"), "deleteppolicy", "delete", "ppolicy", "base", "users"); } $ppolicies[$name] = '(' . $desc . ')'; } $n = new ListInfos(array_keys($ppolicies), _T("Password policies", "ppolicy")); $n->setAdditionalInfo(array_values($ppolicies)); $n->setNavBar(new AjaxNavBar(count($ppolicies), $filter)); $n->setCssClass("groupName"); $n->addActionItemArray($editActions); $n->addActionItemArray($delActions); $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();
$logs = servicesLog($service, $filter); $dates = array(); $uids = array(); $gids = array(); $pids = array(); $messages = array(); $services = array(); foreach ($logs as $log) { if ($log["TIMESTAMP"]) { $dates[] = date('D j m/Y - H:i:s', $log["TIMESTAMP"]); } else { $dates[] = ""; } $uids[] = $log["_UID"]; $gids[] = $log["_GID"]; $pids[] = $log["_PID"]; $messages[] = $log["MESSAGE"]; $services[] = '<a href="' . urlStrRedirect('services/control/log', array("service" => $log["_SYSTEMD_UNIT"])) . '">' . substr($log["_SYSTEMD_UNIT"], 0, -8) . '</a>'; } $n = new ListInfos($dates, _T("Date"), "", "15em"); $n->first_elt_padding = 1; $n->disableFirstColumnActionLink(); if (!$service) { $n->addExtraInfo($services, _T("Service"), '4em'); } $n->addExtraInfo($uids, _T("UID"), '4em'); $n->addExtraInfo($gids, _T("GID"), '4em'); $n->addExtraInfo($pids, _T("PID"), '5em'); $n->addExtraInfo($messages, _T("Message")); $n->setNavBar(new AjaxPaginator(count($messages), $filter, "updateSearchParam", $maxperpage)); $n->display();