Example #1
0
$sharesName = array();
$sharesComment = array();
$editActions = array();
$delActions = array();
//$backupActions = array();
foreach ($shares as $share) {
    $sharesName[] = $share[0];
    if (isset($share[1])) {
        $sharesComment[] = $share[1];
    } else {
        $sharesComment[] = "";
    }
    if (!in_array($share[0], $protectedShare)) {
        $editActions[] = new ActionItem(_T("Edit"), "details", "edit", "share");
        $delActions[] = new ActionPopupItem(_T("Delete"), "delete", "delete", "share");
    } else {
        $editActions[] = new EmptyActionItem();
        $delActions[] = new EmptyActionItem();
    }
}
$p = new PageGenerator(_T("Shares"));
$p->setSideMenu($sidemenu);
$p->display();
$l = new ListInfos($sharesName, _T("Shares"));
$l->setCssClass("shareName");
$l->addExtraInfo($sharesComment, _T("Description"));
$l->addActionItemArray($editActions);
$l->addActionItemArray($delActions);
$l->addActionItem(new ActionPopupItem(_T("Archive"), "backup", "backup", "share"));
$l->disableFirstColumnActionLink();
$l->display();
Example #2
0
            $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();
Example #3
0
 */
require "graph/navbar.inc.php";
require "localSidebar.php";
require "modules/msc/includes/package_api.php";
$p = new PageGenerator(_T("Packages", 'msc'));
$p->setSideMenu($sidemenu);
$p->display();
$a_packages = array();
$a_pversions = array();
foreach (getAllPackages() as $package) {
    $a_packages[] = $package->label;
    $a_pversions[] = $package->version;
}
$n = new ListInfos($a_packages, _T("Package", 'msc'));
$n->addExtraInfo($a_pversions, _T("Version", 'msc'));
$n->addActionItem(new ActionItem(_T("Launch", "msc"), "start_command", "start", "msc", "base", "computers"));
$n->addActionItem(new ActionItem(_T("Details", "msc"), "package_detail", "detail", "msc", "base", "computers"));
$n->drawTable(0);
?>
<style>
li.detail a {
        padding: 3px 0px 5px 20px;
        margin: 0 0px 0 0px;
        background-image: url("modules/msc/graph/images/actions/info.png");
        background-repeat: no-repeat;
        background-position: left top;
        line-height: 18px;
        text-decoration: none;
        color: #FFF;
}
Example #4
0
        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"));
$f->display();
if (!servicesModuleEnabled()) {
Example #5
0
 * 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();
Example #6
0
        $shareDescription = "(" . _T("Hidden", "samba4") . ") ";
    }
    $shareDescription = isset($share[$shareComponent["description"]]) ? $shareDescription . $share[$shareComponent["description"]] : "";
    $sharesDescription[] = $shareDescription;
    $sharesGuestAccess[] = isset($share[$shareComponent["guest_access"]]) ? $share[$shareComponent["guest_access"]] : "";
    if (isset($protectedShares) and !in_array($share[$shareComponent["name"]], $protectedShares)) {
        $editActions[] = new ActionItem(_T("Edit", "samba4"), "edit", "edit", "share");
        $delActions[] = new ActionPopupItem(_T("Delete", "samba4"), "delete", "delete", "share");
    } else {
        $editActions[] = new EmptyActionItem();
        $delActions[] = new EmptyActionItem();
    }
}
$page = new PageGenerator(_T("Current list of shares", "samba4"));
$page->setSideMenu($sidemenu);
$page->display();
$list = new ListInfos($sharesName, _T("Share", "samba4"));
$list->setCssClass("shareName");
$list->setCssClasses($sharesEnabled);
$list->addExtraInfo($sharesPath, _T("Path", "samba4"));
$list->addExtraInfo($sharesDescription, _T("Description", "samba4"));
$list->addActionItemArray($editActions);
$list->addActionItemArray($delActions);
$list->addActionItem(new ActionPopupItem(_T("Archive", "samba4"), "backup", "backup", "share"));
$list->disableFirstColumnActionLink();
$list->display();
/* Private functions */
function _shareIsEnabled($share)
{
    return isset($share[2]) and $share[2];
}
Example #7
0
 */
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();
Example #8
0
<?php

$domain = $_GET["domain"];
if (isset($_GET["filter"])) {
    $filter = $_GET["filter"];
} else {
    $filter = "";
}
$uids = array();
foreach (getVDomainUsers($domain, $filter) as $dn => $entries) {
    $mail = htmlentities($entries[1]["mail"][0]);
    $uids[$entries[1]["uid"][0]] = array($entries[1]["givenName"][0] . " " . $entries[1]["sn"][0], '<a href="' . "mailto:" . $mail . '">' . $mail . "</a>");
}
ksort($uids);
$names = array();
$mails = array();
foreach ($uids as $uid) {
    $names[] = $uid[0];
    $mails[] = $uid[1];
}
$n = new ListInfos(array_keys($uids), _("Login"), "&mail={$domain}");
$n->setNavBar(new AjaxNavBar(count($uids), $filter));
$n->setCssClass("userName");
$n->addExtraInfo($names, _("Name"));
$n->addExtraInfo($mails, _("Mail address"));
$n->addActionItem(new ActionItem(_("Edit"), "edit", "edit", "user", "base", "users"));
$n->display();
Example #9
0
 function quickDisplay($actions = array(), $params = array())
 {
     if (!$this->db_cmd) {
         # user do not have the right permissions
         $widget = new RenderedMSCCommandDontExists();
         $widget->display();
         return false;
     }
     $n = null;
     foreach ($this->values as $col) {
         if ($col[2]) {
             if ($n) {
                 $n->addExtraInfo(array($col[1]), $col[0]);
             } else {
                 $n = new ListInfos(array($col[1]), $col[0]);
                 $n->first_elt_padding = 0;
             }
         }
     }
     $params = array_merge($params, array('cmd_id' => $_GET['cmd_id'], 'gid' => $_GET['gid'], 'from' => 'msc|logs|viewLogs'));
     $n->setParamInfo(array($params));
     foreach ($actions as $a) {
         $n->addActionItem($a);
     }
     // Start/Stop buttons
     $n->addActionItem(new ActionPopupItem(_T("Start", "msc"), "msctabsplay", "start", "msc", "base", "computers"));
     $n->addActionItem(new ActionPopupItem(_T("Stop", "msc"), "msctabsstop", "stop", "msc", "base", "computers"));
     $n->addActionItem(new ActionPopupItem(_T("Reschedule", "msc"), "reschedule", "reschedule", "msc", "base", "computers"));
     $n->disableFirstColumnActionLink();
     $n->drawTable(0);
     print '<br/>';
     return true;
 }
Example #10
0
    echo '<link rel="stylesheet" href="modules/imaging/graph/css/default.min.css">';
    echo '<script src="modules/imaging/graph/highlight/highlight.min.js"></script>';
    echo '<script>hljs.initHighlightingOnLoad();</script>';
    //$file must be existing
    if (!($file = xmlrpc_selectWindowsAnswerFile($_GET['display']))) {
        $file = array();
    }
    echo '<pre>';
    foreach ($file as $line) {
        echo htmlentities($line);
    }
    echo '</pre>';
} else {
    //Get the list of answer files
    $list = xmlrpc_Windows_Answer_list_File(0, -1);
    //Display sidemenu
    $page = new PageGenerator(_T("All Windows Answer Files", 'imaging'));
    $page->setSideMenu($sidemenu);
    $page->display();
    //Create list of sysprep answer file
    $table = new ListInfos($list['file'], _T("File name", "imaging"));
    //Add informations on each row
    $table->addExtraInfo($list['os'], _T("OS", "imaging"));
    $table->addExtraInfo($list['description'], _T("Description", "imaging"));
    //Add actions on each row
    $table->addActionItem(new ActionItem(_T("Display sysprep file", "imaging"), "sysprepView", "display", "display", "imaging", "manage"));
    $table->addActionItem(new ActionItem(_T("Edit sysprep file", "imaging"), "unattended", "edit", "edit", "imaging", "manage"));
    $table->addActionItem(new ActionConfirmItem(_T("Delete sysprep file", 'imaging'), "sysprepList", "delete", "deleteFile", "imaging", "manage", _T('Are you sure you want to unset this sysrep answer file?', 'imaging')));
    // Display the list
    $table->display();
}
Example #11
0
        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();

?>
Example #12
0
<?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();
Example #13
0
 function displayReqListInfos($canbedeleted = false, $default_params = array())
 {
     if (!$default_params['target']) {
         $default_params['target'] = 'creator';
     }
     if (!strlen($default_params['tab'])) {
         $default_params['tab'] = null;
     }
     $parameters = array();
     $parts = array();
     foreach ($this->subs as $id => $sub) {
         array_push($parts, $sub->display());
         $p = $default_params;
         $p['subedition'] = 1;
         #$p['delete'] = $id;
         $p['sub_id'] = $id;
         $p['request'] = $this->toS();
         array_push($parameters, $p);
     }
     $n = new ListInfos($parts, _T('Search part', 'dyngroup'), "&amp;id=" . $default_params['gid']);
     if ($canbedeleted) {
         $n->setParamInfo($parameters);
         $n->addActionItem(new ActionItem(_T("Edit", 'dyngroup'), $default_params['target_edit'], "edit", "params", null, null, $default_params['tab']));
         $n->addActionItem(new ActionItem(_T("Delete", 'dyngroup'), $default_params['target_del'], "delete", "params", null, null, $default_params['tab']));
     }
     $n->disableFirstColumnActionLink();
     $n->display();
     print "<br/>";
     // or the previous/next will be on the next line...
 }
Example #14
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();
Example #15
0
/**
 * (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();
}
Example #16
0
?>

<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&amp;submod=blacklist&amp;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");
?>
Example #17
0
        $a_desc[] = $entry['image']['desc'];
        $default_name = $entry['image']['name'];
        $kind = 'IM';
    } else {
        $a_desc[] = $entry['boot_service']['default_desc'];
        $default_name = $entry['boot_service']['default_name'];
        $kind = 'BS';
    }
    $list_params[$i]["itemlabel"] = urlencode($default_name);
    $a_label[] = sprintf("%s%s", $kind == 'IM' ? '<img src="modules/imaging/graph/images/imaging-action.png" style="vertical-align: middle" /> ' : '<img src="modules/imaging/graph/images/service-action.png" style="vertical-align: middle" /> ', $default_name);
    $a_default[] = $entry['default'];
    $a_display[] = $entry['hidden'] ? False : True;
    $a_defaultWOL[] = $entry['default_WOL'];
    $a_displayWOL[] = $entry['hidden_WOL'] ? False : True;
}
$t = new TitleElement(_T("Default boot menu configuration", "imaging"), 3);
$t->display();
$l = new ListInfos($a_label, _T("Label", "imaging"));
$l->setParamInfo($list_params);
$l->addExtraInfo($a_desc, _T("Description", "imaging"));
$l->addExtraInfo($a_default, _T("Default", "imaging"));
$l->addExtraInfo($a_display, _T("Displayed", "imaging"));
$l->addExtraInfo($a_defaultWOL, _T("Default on WOL", "imaging"));
$l->addExtraInfo($a_displayWOL, _T("Displayed on WOL", "imaging"));
$l->addActionItemArray($actionsUp);
$l->addActionItemArray($actionsDown);
$l->addActionItem(new ActionItem(_T("Edit"), "bootmenu_edit", "edit", "item", "imaging", "manage"));
$l->setTableHeaderPadding(19);
$l->disableFirstColumnActionLink();
$l->display();
require "../includes/ajaxcommon_bottom.inc.php";
Example #18
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/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();
Example #19
0
 function quickDisplay($actions = array(), $params = array())
 {
     if (!$this->db_cmd) {
         # user do not have the right permissions
         $widget = new RenderedMSCCommandDontExists();
         $widget->display();
         return false;
     }
     $n = null;
     foreach ($this->values as $col) {
         if ($col[2]) {
             if ($n) {
                 $n->addExtraInfo(array($col[1]), $col[0]);
             } else {
                 $n = new ListInfos(array($col[1]), $col[0]);
             }
         }
     }
     $n->setParamInfo(array($params));
     foreach ($actions as $a) {
         $n->addActionItem($a);
     }
     $n->drawTable(0);
     return true;
 }