Пример #1
0
function display_submod($submod, $mod)
{
    if (!$submod->hasVisible()) {
        return;
    }
    echo '<div class="submod">';
    ?>
 <img src="<?php 
    echo $submod->_img;
    ?>
_select.png" alt="" style="float:right;" /><?php 
    /*if (!$submod->_visibility) { //if submod not visible
          return;
      }*/
    echo '<h3>';
    $url = urlStr($submod->_defaultpage);
    echo "<a style=\"text-decoration: none;\" href=\"{$url}\">" . $submod->getDescription() . "</a><br/>";
    echo "</h3>";
    print "<ul>";
    foreach ($submod->getPages() as $page) {
        display_page($page, $submod, $mod);
    }
    print "</ul>";
    echo '</div>';
}
Пример #2
0
    $_SESSION['request'] = $r->toS();
    header("Location: " . urlStrRedirect("base/computers/tmpdisplay", array('id' => $id, 'request' => 'stored_in_session', 'is_group' => $is_group, 'equ_bool' => $bool, 'name' => urlencode($name), 'save_type' => $save_type, 'visible' => $visible, 'imaging_server' => $imaging_server)));
    exit;
}
$name_exists = xmlrpc_group_name_exists($name, $group->id);
if (!isset($_POST['btnPrimary']) || $name_exists || !$check || isset($_POST['checkBool']) || isset($_POST['displayTmp']) || $name == '') {
    if ($id) {
        $name = $group->getName();
        $visible = $group->canShow();
    }
    $r->displayReqListInfos(false, array('gid' => $id));
    // TODO : put in class
    print "<hr/><table><tr>";
    if (hasCorrectAcl("base", "computers", "save")) {
        $_SESSION['request'] = $request;
        print "<form method='POST' action='" . urlStr("base/computers/save", array('request' => 'stored_in_session', 'id' => $id, 'is_group' => $is_group, 'imaging_server' => $imaging_server)) . "' >" . "<td>" . _T('Name :', 'dyngroup') . " <input name='name' type='text' value=\"" . htmlspecialchars($name) . "\" /></td>";
        if ($is_group) {
            print "<td>" . _T('save as', 'dyngroup') . " <select name='save_type'><option value='1' " . ($save_type == 1 ? 'selected' : '') . ">" . _T("query", "dyngroup") . "</option><option value='2' " . ($save_type == 2 ? 'selected' : '') . ">" . _T('result', 'dyngroup') . "</option></select></td>";
        } else {
            print "<td><input name='save_type' type='hidden' value='2'/></td>";
        }
        print "<td colspan='2'>" . _T("it should be", "dyngroup") . " <select name='visible'><option value='2' " . ($visible == 2 ? 'selected' : '') . ">" . _T("hidden", "dyngroup") . "</option><option value='1' " . ($visible == 1 ? 'selected' : '') . ">" . _T("visible", "dyngroup") . "</option></select></td>";
    }
    if ($r->countPart() > 0) {
        drawBoolEquation($bool);
    }
    if (hasCorrectAcl("base", "computers", "tmpdisplay")) {
        drawTemporaryButton();
    }
    if (hasCorrectAcl("base", "computers", "save")) {
        print "<td><input name='btnPrimary' value='" . _T('Save', 'dyngroup') . "' class='btnPrimary' type='submit'/></td>";
Пример #3
0
    $hosts[] = $r["hostname"];
    //rtrim($r[1],".");
    $types[] = $r["type"];
    $values[] = getRecordValueDescription($zone, $r["type"], $r["value"]);
    $params[] = array("zone" => $zone, "reverse" => $reverse, "id" => $r["id"], "serial" => $serial);
    $actionsMod[] = $editAction;
    if ($r["hostname"] === $curzone . "." && $r["type"] === "TXT" || $r["type"] == "SOA") {
        $actionsDel[] = $emptyAction;
    } else {
        $actionsDel[] = $delAction;
    }
}
//print_r($values);
$typeAsc = $sortby == "type" ? intval(!$asc) : "1";
$hostnameAsc = $sortby == "hostname" ? intval(!$asc) : "1";
$typeUrl = urlStr("network/network/zonerecords", array("zone" => $zone, "reverse" => $reverse, "sortby" => "type", "asc" => $typeAsc));
$hostnameUrl = urlStr("network/network/zonerecords", array("zone" => $zone, "reverse" => $reverse, "sortby" => "hostname", "asc" => $hostnameAsc));
$n = new OptimizedListInfos($hosts, "<a href='" . $hostnameUrl . "'>" . _T("Host name", "network") . "</a>");
$n->setTableHeaderPadding(1);
$n->setNavBar(new AjaxNavBar(count($records), $filter));
$n->setItemCount(count($records));
$n->start = 0;
$n->end = count($recordsatpage) - 1;
$n->addExtraInfo($types, "<a href='" . $typeUrl . "'>" . _T("Record type", "network")) . "</a>";
$n->addExtraInfo($values, _T("Record parameters", "network"));
$n->setName(_T("Host", "network"));
$n->setParamInfo($params);
$n->disableFirstColumnActionLink();
$n->addActionItemArray($actionsMod);
$n->addActionItemArray($actionsDel);
$n->display();
Пример #4
0
 else { $icons = state_tmpl($current_state); }
 $tab = 'tablogs';
 if ($icons['play'] == '' && $icons['stop'] == '' && $icons['pause'] == '') { $tab = 'tabhistory'; }
     
 if ($target_uuid && $target_uuid != '') {
     $param = array('uuid'=>$target_uuid, 'cmd_id'=>$cmd_id, 'bundle_id'=>$bid);
     if (!isset($gid) || $gid == '') {
         $param['coh_id'] = $coh_id;
     } else {
         $param['gid'] = $gid;
     }
     $linkdetail = urlStr("base/computers/msctabs/$tab", $param);
     $linklogs = urlStr("base/computers/msctabs/$tab", array('uuid'=>$target_uuid, 'gid'=>$gid));
 } else {
     $linkdetail = urlStr("base/computers/groupmsctabs/group$tab", array('uuid'=>$target_uuid, 'cmd_id'=>$cmd_id, 'bundle_id'=>$bid, 'gid'=>$gid));
     $linklogs = urlStr("base/computers/groupmsctabs/group$tab", array('uuid'=>$target_uuid, 'gid'=>$gid));
 }
 $a_date[] = $creation_date;
 $a_creator[] = $creator;
 $param = array('cmd_id'=>$cmd_id, 'title'=>$label, 'bundle_id'=>$bid, 'from'=>'msc|logs|consult');
 $no_actions = False;
 if (!isset($bid) || $bid == '') {
     $img = draw_image("modules/msc/graph/images/install_package.png", _T('Package', 'msc'));
 } else {
     $img = draw_image("modules/msc/graph/images/install_bundle.png", _T('Bundle', 'msc'));
 }
 if ($target == 'UNVISIBLEMACHINE') {
     $target = _T('Unavailable computer', 'msc');
     $a_cmd[] = $img." ".$label;
     $a_target[] = draw_image("img/machines/icn_machinesList.gif", _T('Machine', 'msc'))." ".$target;
     $no_actions = True;
Пример #5
0
    exit;
}
if ($_GET['bshow'] || $_POST['bshow']) {
    $group->show();
    header("Location: " . urlStrRedirect("base/computers/list"));
    exit;
}
if ($_GET['bhide'] || $_POST['bhide']) {
    $group->hide();
    header("Location: " . urlStrRedirect("base/computers/list"));
    exit;
}
//$group->prettyDisplay();
?>
 <form action="<?php 
echo urlStr("base/computers/details", array('id' => $id));
?>
" method="post"> <?php 
?>
 <input name="bback" type="submit" class="btnPrimary" value="<?php 
echo _T("Close", "dyngroup");
?>
" onClick="closePopup();
        return false;"/> <?php 
if ($group->isDyn() && $group->isGroup()) {
    print '<input name="bregen" type="submit" class="btnSecondary" value="' . _T("Regenerate", "dyngroup") . '"/>';
}
if ($group->canShow()) {
    print '<input name="bhide" type="submit" class="btnSecondary" value="' . _T("Hide", "dyngroup") . '"/>';
} else {
    print '<input name="bshow" type="submit" class="btnSecondary" value="' . _T("Show", "dyngroup") . '"/>';
Пример #6
0
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/squid/includes/squid.inc.php";
if (isset($_POST["btdell"])) {
    delElementInList($list, $_POST["eltdata"]);
    $serviceName = getServiceName();
    $n = new NotifyWidgetSuccess(_T("Item deleted.", "squid"));
    handleServicesModule($n, array($serviceName => _T("Proxy", "squid")), "reload");
    redirectTo(urlStrRedirect($page));
}
if (isset($_GET["eltdata"])) {
    $data = urldecode($_GET["eltdata"]);
    ?>
	<form action="<?php 
    echo urlStr($page_delete);
    ?>
" method="post">
		<p><?php 
    printf(_T("You will remove  <b>%s</b>"), $data);
    ?>
</p><br />
	    <p><?php 
    echo _T("Are you sure ?");
    ?>
</p>
		<input name="eltdata" type="hidden" value="<?php 
    echo $data;
    ?>
" />
		<input name="btdell" type="submit" class="btnPrimary" value="<?php 
Пример #7
0
            }
            return True;
        }
    }
    return False;
}
echo "<ul class='action'>";
foreach ($actions as $action) {
    if (is_array($paramArray)) {
        $paramArray['mod'] = $action->mod;
        if ($action->action == "vnc_client") {
            $paramArray['establishproxy'] = "yes";
        }
    }
    echo "<li class=\"" . $action->classCss . "\" style=\"list-style-type: none; border: none; float:left; \" >";
    if (is_array($paramArray) & !empty($paramArray)) {
        $urlChunk = $action->buildUrlChunk($paramArray);
    } else {
        $urlChunk = "&amp;" . $action->paramString . "=" . rawurlencode($paramArray);
    }
    if (modIsActive($action->action)) {
        if ($action->action == "vnc_client") {
            echo "<a title=\"" . $action->desc . "\" onclick=\"window.open('" . urlStr($action->path) . $urlChunk . "','mywin','left=20,top=20,width=300,height=150,toolbar=1,resizable=0');\">&nbsp;</a>";
        } else {
            $url = in_array('glpi', $_SESSION['supportModList']) && $action->path == 'base/computers/invtabs' ? 'base/computers/glpitabs' : $action->path;
            echo "<a title=\"" . $action->desc . "\" href=\"" . urlStr($url) . $urlChunk . "\">&nbsp;</a>";
        }
    }
    echo "</li>";
}
echo "</ul>";
Пример #8
0
 function getLink()
 {
     return urlStr($_GET["module"] . "/" . $_GET["submod"] . "/" . $_GET["action"], array_merge(array("tab" => $this->id), $this->params));
 }
Пример #9
0
                $head = _T($head, 'inventory');
            }
            if ($n == null) {
                $n = new OptimizedListInfos($vals, $head);
            } else {
                $n->addExtraInfo($vals, $head);
            }
        }
    }

    print "<div style=\"overflow: auto\">";
    if ($n != null) {
        $n->addActionItem(new ActionItem(_T("View", "inventory"),"invtabs","display","inventory", "base", "computers"));
        $n->addActionItem(new ActionPopupItem(_T("Informations", "inventory"),"infos","info","inventory", "inventory", "inventory"));
        $n->setParamInfo($params);
        $n->setTableHeaderPadding(1);
        $n->setItemCount($count);
        $n->setNavBar(new AjaxNavBar($count, $filter));
        $n->start = 0;
        $n->end = $maxperpage;
        $n->display();
    }
    print "</div>";
    ?><a href='<?php echo  urlStr("inventory/inventory/csv", array('table'=>$display, 'gid'=>$_GET["gid"], 'filter' => $_GET['filter'])) ?>'><img src='modules/inventory/graph/csv.png' alt='export csv'/></a><?php
}

?>

</table>

Пример #10
0
    print "<div style=\"overflow: auto\">";
    if ($n != null) {
        $n->addActionItem(new ActionItem(_T("View", "inventory"), "invtabs", "display", "inventory", "base", "computers"));
        $n->addActionItem(new ActionPopupItem(_T("Information", "inventory"), "infos", "info", "inventory", "inventory", "inventory"));
        $n->setParamInfo($params);
        $n->setTableHeaderPadding(1);
        $n->setItemCount($count);
        $n->setNavBar(new AjaxNavBar($count, $filter));
        $n->start = 0;
        $n->end = $maxperpage;
        $n->display();
    }
    print "</div>";
    ?>
<a href='<?php 
    echo urlStr("inventory/inventory/csv", array('table' => $display, 'gid' => $_GET["gid"], 'filter' => $_GET['filter']));
    ?>
'><img src='modules/inventory/graph/csv.png' alt='export csv'/></a><?php 
}
?>

</table>

<script type="text/javascript">
    /* ==> CODE TO DISABLE
     jQuery('tbody tr td:not(.action)').click(function() {
     jQuery('#param').val(jQuery(this).text());
     pushSearch();
     });
     */
</script>
Пример #11
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, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/network/includes/network2.inc.php";
require "localSidebar.php";
require "graph/navbar.inc.php";
$reverse = isset($_GET["reverse"]) && $_GET["reverse"] == 1;
$zone = $_GET["zone"];
$sortby = $_GET["sortby"];
$asc = $_GET["asc"];
$options = array('zone' => $zone, 'reverse' => $reverse, 'sortby' => $sortby, 'asc' => $asc);
$ajax = new AjaxFilter(urlStrRedirect('network/network/ajaxZoneRecordsFilter', $options));
$ajax->display();
$title = $reverse ? sprintf(_T("Records of reverse zone for zone %s"), $zone) : sprintf(_T("Records of zone %s"), $zone);
$p = new PageGenerator($title);
$sidemenu->forceActiveItem("index");
$p->setSideMenu($sidemenu);
$p->display();
$ajax->displayDivToUpdate();
$f = new Form();
if ($reverse || count(getReverseZone($zone))) {
    $linktext = $reverse ? _T("Manage zone records") : _T("Manage reverse zone records");
    $f->addSummary("<a href='" . urlStr("network/network/zonerecords", array("zone" => $zone, "reverse" => !$reverse)) . "'>" . $linktext . "</a>");
}
$f->addOnClickButton(_T("Add a record"), urlStr("network/network/addrecord", array("zone" => $zone, "reverse" => $reverse)));
$f->display();
Пример #12
0
 $canReg = xmlrpc_canIRegisterThisComputer($params['target_uuid']);
 if (!$canReg[0] && $canReg[1]) {
     $p = new PageGenerator(sprintf(_T("%s's computer imaging", 'imaging'), $hostname));
     $sidemenu->forceActiveItem("index");
     $p->setSideMenu($sidemenu);
     $p->display();
     # when the computer is in a profile, but the profile is not registered
     # display an information message
     $msg = _T("This computer can't be declared in the imaging module: it's already part of a broken imaging group.", "imaging");
     $t1 = new TitleElement($msg, 3);
     $t1->display();
     # give a link to the profile registering
     if (count($canReg) == 2 and $canReg[1] != '') {
         $group = new Group($canReg[1], true);
         $params = array("id" => $canReg[1], "gid" => $canReg[1], "groupname" => $group->getName());
         $url = urlStr("imaging/manage/groupimgtabs", $params);
         $msg = sprintf(_T("Please declare the imaging group first %shere%s.", "imaging"), "<a href='{$url}'>", "</a>");
         $t2 = new TitleElement($msg, 3);
         $t2->display();
     }
 } else {
     $ret = xmlrpc_getComputerSynchroState($params['target_uuid']);
     if (isset($_POST["bresetsynchrostate"])) {
         if (xmlrpc_resetSynchroState($params['uuid'], '')) {
             new NotifyWidgetSuccess(sprintf(_T("Reset synchronisation state for %s (%s) succeed", "imaging"), $params['target_name'], $params['uuid']));
             header("Location: " . urlStrRedirect("base/computers/imgtabs", $params));
             exit;
         } else {
             new NotifyWidgetFailure(sprintf(_T("Failed to reset synchronise state.", "imaging")));
         }
     }
Пример #13
0
/**
 * Form on user edit page
 * @param $FH FormHandler of the page
 * @param $mode add or edit mode
 */
function _base_baseEdit($FH, $mode)
{
    $uid = $FH->getArrayOrPostValue("uid");
    $f = new DivForModule(_("User attributes"), "#F4F4F4");
    $f->push(new Table());
    if ($mode == "add") {
        $loginTpl = new InputTpl("uid", '/^[a-zA-Z0-9][A-Za-z0-9_.\\-]*$/');
    } else {
        $loginTpl = new HiddenTpl("uid");
    }
    $f->add(new TrFormElement(_("Login"), $loginTpl), array("value" => $uid));
    if ($mode == "edit") {
        $lastlog = get_last_log_user($uid);
        if ($lastlog[0] != 0) {
            $f->add(new LinkTrFormElement(_("Last action"), new HiddenTpl("lastaction")), array("value" => urlStr("base/users/loguser", array("user" => $uid)), "name" => $lastlog[1][0]["date"]));
        }
    }
    $f->add(new TrFormElement(_("Password"), new PasswordTpl("pass")), array("value" => ""));
    $f->add(new TrFormElement(_("Confirm password"), new PasswordTpl("confpass")), array("value" => ""));
    $f->add(new TrFormElement(_("Photo"), new ImageTpl("jpegPhoto")), array("value" => $FH->getArrayOrPostValue("jpegPhoto"), "action" => $mode));
    $f->add(new TrFormElement(_("Last name"), new InputTpl("sn")), array("value" => $FH->getArrayOrPostValue("sn")));
    $f->add(new TrFormElement(_("First name"), new InputTpl("givenName")), array("value" => $FH->getArrayOrPostValue("givenName")));
    $f->add(new TrFormElement(_("Title"), new InputTpl("title")), array("value" => $FH->getArrayOrPostValue("title")));
    $f->add(new TrFormElement(_("Email address"), new MailInputTpl("mail")), array("value" => $FH->getArrayOrPostValue("mail")));
    $f->pop();
    $phoneregexp = "/^[a-zA-Z0-9(/ +\\-]*\$/";
    $tn = new MultipleInputTpl("telephoneNumber", _("Telephone number"));
    $tn->setRegexp($phoneregexp);
    $f->add(new FormElement(_("Telephone number"), $tn), $FH->getArrayOrPostValue("telephoneNumber", "array"));
    $f->push(new Table());
    $f->add(new TrFormElement(_("Mobile number"), new InputTpl("mobile", $phoneregexp)), array("value" => $FH->getArrayOrPostValue("mobile")));
    $f->add(new TrFormElement(_("Fax number"), new InputTpl("facsimileTelephoneNumber", $phoneregexp)), array("value" => $FH->getArrayOrPostValue("facsimileTelephoneNumber")));
    $f->add(new TrFormElement(_("Home phone number"), new InputTpl("homePhone", $phoneregexp)), array("value" => $FH->getArrayOrPostValue("homePhone")));
    $languages = new SelectItem("preferredLanguage");
    $labels = array(_("Choose language")) + array_values(getLanguages());
    $values = array("") + array_keys(getLanguages());
    $languages->setElements($labels);
    $languages->setElementsVal($values);
    $f->add(new TrFormElement(_("Preferred language"), $languages), array("value" => $FH->getArrayOrPostValue("preferredLanguage")));
    $checked = "checked";
    if ($FH->getArrayOrPostValue("loginShell") != '/bin/false') {
        $checked = "";
    }
    $f->add(new TrFormElement(_("User is disabled, if checked"), new CheckboxTpl("isBaseDesactive"), array("tooltip" => _("A disabled user can't log in any UNIX services. <br/>\n                                Her/his login shell command is replaced by /bin/false"))), array("value" => $checked));
    /* Primary group */
    $groupsTpl = new SelectItem("primary");
    $all_groups = search_groups();
    $groups = array();
    foreach ($all_groups as $key => $infos) {
        $groups[] = $infos[0];
    }
    $groupsTpl->setElements($groups);
    if ($mode == "add") {
        $primary = getUserDefaultPrimaryGroup();
    } else {
        if ($mode == "edit") {
            /* In case of error, display the POST values */
            if ($FH->isUpdated("primary")) {
                $primary = $FH->getValue("primary");
            } else {
                $primary = getUserPrimaryGroup($uid);
                /* If the group is not an LDAP group */
                if (!in_array($primary, $groups)) {
                    $primaryGroups = $groups;
                    $primaryGroups[] = $primary;
                    $groupsTpl->setElements($primaryGroups);
                }
            }
        }
    }
    $f->add(new TrFormElement(_("Primary group"), $groupsTpl), array("value" => $primary));
    /* Secondary groups */
    $groupsTpl = new MembersTpl("secondary");
    $groupsTpl->setTitle(_("User's groups"), _("All groups"));
    // get the user's groups
    /* In case of error, display the POST values */
    if ($FH->getPostValue("secondary")) {
        $user_groups = $FH->getPostValue("secondary");
    } else {
        if ($mode == 'edit') {
            $user_groups = getUserSecondaryGroups($uid);
        } else {
            $user_groups = array();
        }
    }
    $member = array();
    foreach ($user_groups as $group) {
        $member[$group] = $group;
    }
    // get all groups
    $available = array();
    foreach ($groups as $group) {
        if (!in_array($group, $member)) {
            $available[$group] = $group;
        }
    }
    $f->add(new TrFormElement(_("Secondary groups"), $groupsTpl), array("member" => $member, "available" => $available));
    $f->pop();
    $f->push(new DivExpertMode());
    $f->push(new Table());
    $f->add(new TrFormElement(_("Home directory"), new InputTpl("homeDirectory")), array("value" => $FH->getArrayOrPostValue("homeDirectory")));
    if ($mode == "add") {
        $f->add(new TrFormElement(_("Create home directory on filesystem"), new CheckboxTpl("createHomeDir")), array("value" => "checked"));
        $f->add(new TrFormElement(_("Force to use the home directory if it exists"), new CheckboxTpl("ownHomeDir"), array("tooltip" => _("Warning: an existing directory may belong to another user !"))), array("value" => ""));
    }
    $f->add(new TrFormElement(_("Login shell"), new InputTpl("loginShell")), array("value" => $FH->getArrayOrPostValue("loginShell")));
    $f->add(new TrFormElement(_("Common name"), new InputTpl("cn"), array("tooltip" => _("This field is used by some LDAP clients (for example Thunderbird address book) to display user entries."))), array("value" => $FH->getArrayOrPostValue("cn")));
    $f->add(new TrFormElement(_("Preferred name to be used"), new InputTpl("displayName"), array("tooltip" => _("This field is used by SAMBA (and other LDAP clients) to display user name."))), array("value" => $FH->getArrayOrPostValue("displayName")));
    if ($mode == "edit") {
        $f->add(new TrFormElement(_("UID"), new HiddenTpl("uidNumber")), array("value" => $FH->getArrayOrPostValue("uidNumber")));
        $f->add(new TrFormElement(_("GID"), new HiddenTpl("gidNumber")), array("value" => $FH->getArrayOrPostValue("gidNumber")));
    }
    $f->pop();
    $f->pop();
    return $f;
}
Пример #14
0
 $tab = 'tablogs';
 if ($icons['play'] == '' && $icons['stop'] == '' && $icons['pause'] == '') {
     $tab = 'tabhistory';
 }
 if ($target_uuid && $target_uuid != '') {
     $param = array('uuid' => $target_uuid, 'cmd_id' => $cmd_id, 'bundle_id' => $bid, 'commands' => $command_type);
     if (!isset($gid) || $gid == '') {
         $param['coh_id'] = $coh_id;
     } else {
         $param['gid'] = $gid;
     }
     $linkdetail = urlStr("msc/logs/viewLogs", $param);
     $linklogs = urlStr("msc/logs/viewLogs", array('uuid' => $target_uuid, 'gid' => $gid));
 } else {
     $linkdetail = urlStr("msc/logs/viewLogs", array('uuid' => $target_uuid, 'cmd_id' => $cmd_id, 'bundle_id' => $bid, 'gid' => $gid, 'commands' => $command_type));
     $linklogs = urlStr("msc/logs/viewLogs", array('uuid' => $target_uuid, 'gid' => $gid));
 }
 $a_date[] = $creation_date;
 $start_dates[] = _toDate($start_date);
 $end_dates[] = _toDate($end_date);
 $a_deployment_intervals[] = $deployment_intervals;
 $a_creator[] = $creator;
 $param = array('cmd_id' => $cmd_id, 'title' => $label, 'bundle_id' => $bid, 'from' => 'msc|logs|consult');
 $no_actions = False;
 if (!isset($bid) || $bid == '') {
     $a_donepercent[] = $done_percent;
     $img = draw_image("modules/msc/graph/images/install_package.png", _T('Package', 'msc'));
 } else {
     $img = draw_image("modules/msc/graph/images/install_bundle.png", _T('Bundle', 'msc'));
     $a_donepercent[] = '-';
 }
Пример #15
0
    }
}
$params = getParams();
$id = $_GET['itemid'];
$tid = $_GET['target_uuid'];
$label = urldecode($_GET['itemlabel']);
if (isset($_GET['gid'])) {
    $type = 'group';
} else {
    $type = '';
}
$ret = xmlrpc_areImagesUsed(array(array($id, $tid, $type)));
$ret = $ret[$id];
?>
<form name="showTarget" action="<?php 
echo urlStr("base/computers/showtarget", $params);
?>
" method="post">
    <p><?php 
printf(_T("Show all targets that use that image in their boot menu", "imaging"));
?>
</p>
<?php 
foreach ($ret as $target) {
    /*
     * $target = array(
     *      [0] => UUID of the target
     *      [1] => 1 or -1 // if -1: target is an imaging server else it is a computer
     *      [2] => target name
     *  );
     */
Пример #16
0
$machine = quickGet('hostname');
$uuid = quickGet('objectUUID');
if (quickGet('valid')) {
    $group->delMember(array("{$uuid}" => array("uuid" => $uuid)));
    header("Location: " . urlStrRedirect("base/computers/display", array('gid' => $gid)));
    exit;
}
?>
 <h2><?php 
echo _T("Remove a computer", "dyngroup");
?>
</h2> <?php 
?>

<form action="<?php 
echo urlStr("base/computers/remove_machine", array('gid' => $gid, 'hostname' => $machine, 'objectUUID' => $uuid));
?>
" method="post">
<p>
<?
    printf(_T("You will remove computer <b>%s</b> from group <b>%s</b>.", "dyngroup"), $machine, $group->getName());
?>
</p>
<input name='valid' type="submit" class="btnPrimary" value="<?php 
echo _T("Remove Computer", "dyngroup");
?>
" />
<input name="bback" type="submit" class="btnSecondary" value="<?php 
echo _T("Cancel", "dyngroup");
?>
" onClick="new Effect.Fade('popup'); return false;"/>
Пример #17
0
 *   - if MSC is configured with file download capability
 *   - if MSC is configured with VNC client capability
 * */
$msc_can_download_file = False;
$msc_vnc_show_icon = False;
if (in_array("msc", $_SESSION["supportModList"])) {
    require_once("modules/msc/includes/scheduler_xmlrpc.php");
    require_once("modules/msc/includes/mscoptions_xmlrpc.php");
    $msc_can_download_file = msc_can_download_file();
    $msc_vnc_show_icon = web_vnc_show_icon();
}
list_computers($names, $filter, $count, $canbedeleted, $canbedeletedfromgroup, $is_group, $msc_can_download_file, $msc_vnc_show_icon);

function join_value($n) {
    $ret = array();
    foreach ($n[1] as $k=>$v) {
        if (is_array($v)) {
            $ret[$k] = join(", ", $v);
        } else {
            $ret[$k] = $v;
        }
    }
    return $ret;
}

if (in_array("dyngroup", $_SESSION["modulesList"]) and isset($_GET['gid'])) {
    ?><a href='<?php echo  urlStr("base/computers/csv", array('gid'=>$_GET['gid'], 'location' => $_GET['location'], 'groupname' => $_GET['groupname'])) ?>'><img src='modules/pulse2/graph/csv.png' alt='export csv'/></a><?php
}

?>
Пример #18
0
 * 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 "localSidebar.php";
require "graph/navbar.inc.php";
require_once "modules/inventory/includes/xmlrpc.php";
require_once "modules/inventory/includes/html.php";
$type = $_GET['type'];
$field = $_GET['field'];
$filter = $_GET['filter'];
$from = $_GET['from'];
$p = new PageGenerator(_T("Chart", 'inventory'));
$p->setSideMenu($sidemenu);
$p->display();
$img = new RenderedImage(urlStr("inventory/inventory/graph", array("gid" => $_GET['gid'], 'uuid' => $_GET['uuid'], "type" => $type, "field" => $field, "filter" => $filter)), 'graph', 'center');
$img->display();
$params = array();
foreach (array('uuid', 'hostname', 'gid', 'groupname', 'filter', 'tab', 'part') as $get) {
    $params[$get] = $_GET[$get];
}
$lnk = new RenderedLink(urlStr($from, $params), _T('back', 'inventory'));
//array('tab'=>$_GET['tab'], 'filter'=>$filter));
$lnk->display();
?>

Пример #19
0
 $canReg = xmlrpc_canIRegisterThisComputer($params['target_uuid']);
 if (!$canReg[0] && $canReg[1]) {
     $p = new PageGenerator(sprintf(_T("%s's computer imaging", 'imaging'), $hostname));
     $sidemenu->forceActiveItem("index");
     $p->setSideMenu($sidemenu);
     $p->display();
     # when the computer is in a profile, but the profile is not registered
     # display an information message
     $msg = _T("This computer can't be declared in the Imaging module, it's part of a profile, but the profile is not declared in the Imaging.", "imaging");
     $t1 = new TitleElement($msg, 3);
     $t1->display();
     # give a link to the profile registering
     if (count($canReg) == 2 and $canReg[1] != '') {
         $group = new Group($canReg[1], true);
         $params = array("id"=>$canReg[1], "gid"=>$canReg[1], "groupname"=>$group->getName());
         $url = urlStr("base/computers/groupimgtabs", $params);
         $msg = sprintf(_T("Please declare the profile first %shere%s.", "imaging"), "<a href='$url'>", "</a>");
         $t2 = new TitleElement($msg, 3);
         $t2->display();
     }
 } else {
     $ret = xmlrpc_getComputerSynchroState($params['target_uuid']);
     if (isset($_POST["bresetsynchrostate"])) {
         if (xmlrpc_resetSynchroState($params['uuid'], '')) {
             new NotifyWidgetSuccess(sprintf(_T("Reset synchronisation state for %s (%s) succeed", "imaging"), $params['target_name'], $params['uuid']));
             header("Location: ".urlStrRedirect("base/computers/imgtabs", $params));
             exit;
         } else {
             new NotifyWidgetFailure(sprintf(_T("Failed to reset synchronise state.", "imaging")));
         }
     }
Пример #20
0
    if ($edition) {
        $request->displayReqListInfos(true, array('id' => $id, 'gid' => $id, 'target' => $target, 'target_edit' => 'computersgroupsubedit', 'target_del' => 'computersgroupsubdel', 'request' => $request->toS()));
    } else {
        $request->displayReqListInfos(true, array('id' => $id, 'gid' => $id, 'target' => $target, 'target_edit' => 'computersgroupcreatesubedit', 'target_del' => 'computersgroupcreatesubdel', 'request' => $request->toS(), 'tab' => 'tabdyn'));
    }
}
// display action buttons in the bottom
//TODO put in class
if (!$request->isEmpty()) {
    # TODO check ACLs....
    print "<hr/>";
    print "<table>";
    print "<tr><td>";
    $b = new Button('base', 'computers', 'creator_step2');
    $_SESSION['request'] = $request->toS();
    $url = urlStr("base/computers/creator_step2", array('id' => $id, 'request' => 'stored_in_session', 'imaging_server' => $imaging_server, 'is_group' => $groupedit ? '1' : 0));
    print $b->getOnClickButton(_T("Go to save step", "dyngroup"), $url);
    print "</td><td>";
    print "</td></tr>";
    print "</table>";
}
_T('Identification', 'dyngroup');
_T('Computer name', 'dyngroup');
_T('Hostname of the computer', 'dyngroup');
_T('Description', 'dyngroup');
_T('Description of the computer', 'dyngroup');
_T('Inventory number', 'dyngroup');
_T('Your internal inventory number', 'dyngroup');
_T('Hardware', 'dyngroup');
_T('System type', 'dyngroup');
_T('Laptop, Desktop, Rack Mount Chassis ...', 'dyngroup');
Пример #21
0
            jQuery('#maxwaittime').val("NONE");
        }else
        {
            jQuery("#tableoptionmulticast tr.timewait" ).show(500);
            jQuery('#maxwaittime').val(defaultvalue);
        }
    });
</script>

<h2>
<?php 
echo sprintf(_T("deploy the master <strong>%s</strong> to this group <strong>%s</strong> in multicast", "imaging"), $label, $_GET[target_name]);
?>
</h2>
<form action="<?php 
echo urlStr("base/computers/multicast", $params);
?>
" method="post">

    <table id="tableoptionmulticast">
        <tr> 
            <td>
                <?php 
echo _T('Number of machines to wait for', 'imaging');
?>
            </td>
            <td>
                <input style="width:5em;" name="numbercomputer" type="text" value="" />
            </td>
        </tr>
        
Пример #22
0
    } else {
        // simple group
        header("Location: " . urlStrRedirect("base/computers/list{$stype}"));
        new NotifyWidgetSuccess(sprintf(_T("Group %s was successfully deleted", "imaging"), $group->getName()));
    }
    exit;
}
?>

<h2><?php 
echo $title;
?>
</h2>

<form action="<?php 
echo urlStr("base/computers/delete_group", array('gid' => $id, 'type' => $type));
?>
" method="post">
    <p>

<?php 
printf($popup, $_GET["groupname"]);
?>

    </p>
    <input name='valid' type="submit" class="btnPrimary" value="<?php 
echo $delete;
?>
" />
    <input name="bback" type="submit" class="btnSecondary" value="<?php 
echo _T("Cancel", "dyngroup");
Пример #23
0
}
foreach ($list as $group) {
    if ($group->id == $paramArray['id']) {
        if ($group->is_owner == 1) {
            $actions['delete'] = $delete;
        }
    }
}
$actions['csv'] = new ActionItem(_T("Csv export", "dyngroup"), "csv", "csv", "computer", "base", "computers");
echo "<ul class='action'>";
foreach ($actions as $action) {
    if (is_array($paramArray)) {
        $paramArray['mod'] = $action->mod;
    }
    echo "<li class=\"" . $action->classCss . "\" style=\"list-style-type: none; border: none; float:left; \" >";
    if (is_array($paramArray) & !empty($paramArray)) {
        $urlChunk = $action->buildUrlChunk($paramArray);
    } else {
        $urlChunk = "&amp;" . $action->paramString . "=" . rawurlencode($paramArray);
    }
    if ($action instanceof ActionPopupItem) {
        echo '<a title="' . $action->desc . '" onclick="PopupWindow(event, \'' . urlStr($action->path) . $urlChunk . '\'); return false;" href="#">&nbsp;</a>';
    } else {
        echo '<a title="' . $action->desc . '" href="' . urlStr($action->path) . $urlChunk . '">&nbsp;</a>';
    }
    echo "</li>";
}
echo "</ul>";
?>

Пример #24
0
 * $Id$
 *
 * This file is part of Management Console.
 *
 * 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
 */
require "localSidebar.php";
require "graph/navbar.inc.php";
$subnet = $_GET["subnet"];
$ajax = new AjaxFilter(urlStrRedirect("network/network/ajaxSubnetMembersFilter", array("subnet" => $subnet)));
$ajax->display();
$p = new PageGenerator(_T("Members of DHCP subnet") . "&nbsp;" . $subnet);
$sidemenu->forceActiveItem("subnetindex");
$p->setSideMenu($sidemenu);
$p->display();
$ajax->displayDivToUpdate();
$f = new Form();
$f->addOnClickButton(_T("Add a static host"), urlStr("network/network/subnetaddhost", array("subnet" => $subnet)));
$f->display();
Пример #25
0
                    <img src="<?php 
    echo $data['prods'][$indx]->getImageFile();
    ?>
" class="img-responsive" alt="<?php 
    echo $data['prods'][$indx]->getTitle();
    ?>
">
                    <div>
                      <a href="/Product/v/<?php 
    echo $data['prods'][$indx]->getProductId() . "/" . urlStr($data['prods'][$indx]->getTitle());
    ?>
" class="btn btn-default">View</a>
                    </div>
                  </div>
                  <h3><a href="/Product/v/<?php 
    echo $data['prods'][$indx]->getProductId() . "/" . urlStr($data['prods'][$indx]->getTitle());
    ?>
"><?php 
    echo $data['prods'][$indx]->getTitle();
    ?>
</a></h3>
                  <div class="pi-price">Rs. <?php 
    echo number_format($data['prods'][$indx]->getSalePrice() >= 1 ? $data['prods'][$indx]->getSalePrice() : $data['prods'][$indx]->getPrice(), 0);
    ?>
</div>
                  <?php 
    echo $data['prods'][$indx]->getSalePrice() >= 1 ? '<div class="sticker sticker-sale"></div>' : "";
    echo time() - 86400 * 7 < strtotime($data['prods'][$indx]->getInsertTime()) ? '<div class="sticker sticker-new"></div>' : "";
    ?>
                </div>
              </div>
Пример #26
0
  </ul>
</div>

<p class="path">
<?php 
/* Path automatic creation */
print '<span>' . $_SESSION["XMLRPC_server_description"] . '</span>&nbsp;:&nbsp;';
if ($_GET["submod"] != "main" && $_GET["action"] != "default") {
    print '<a href="' . urlStr("base/main/default") . '">' . _("Home") . '</a> &gt; ';
}
$MMCApp =& MMCApp::getInstance();
$mod = $MMCApp->_modules[$_GET['module']];
$submod = $mod->_submod[$_GET['submod']];
list($m, $s, $a) = split('/', $submod->_defaultpage, 3);
print '<a href="' . urlStr("{$m}/{$s}/{$a}") . '">' . $submod->getDescription() . '</a>';
$action = $submod->_pages[$_GET["action"]];
if (is_object($action)) {
    print ' &gt; ';
    print '<span>' . $action->getDescription() . "</span>";
}
?>
</p>
</div>

<div id="navbar">
<img src="<?php 
echo getMMCLogo();
?>
" alt="Mandriva" id="logo" />
    <ul>
Пример #27
0
    print "<h3>" . _T("The request is : ", "dyngroup") . "</h3>";
    if ($edition) {
        $request->displayReqListInfos(true, array('id' => $id, 'gid' => $id, 'target' => $target, 'target_edit' => 'computersgroupsubedit', 'target_del' => 'computersgroupsubdel', 'request' => $request->toS()));
    } else {
        $request->displayReqListInfos(true, array('id' => $id, 'gid' => $id, 'target' => $target, 'target_edit' => 'computersgroupcreatesubedit', 'target_del' => 'computersgroupcreatesubdel', 'request' => $request->toS(), 'tab' => 'tabdyn'));
    }
}
// display action buttons in the bottom
//TODO put in class
if (!$request->isEmpty()) {
    # TODO check ACLs....
    print "<hr/>";
    print "<table>";
    print "<tr><td>";
    $b = new Button('base', 'computers', 'creator_step2');
    $url = urlStr("base/computers/creator_step2", array('id' => $id, 'request' => $request->toS(), 'imaging_server' => $imaging_server, 'is_group' => $groupedit ? '1' : 0));
    print $b->getOnClickButton(_T("Go to save step", "dyngroup"), $url);
    print "</td><td>";
    print "</td></tr>";
    print "</table>";
}
?>
<style>
li.delete a {
        padding: 3px 0px 5px 20px;
        margin: 0 0px 0 0px;
        background-image: url("modules/msc/graph/images/actions/delete.png");
        background-repeat: no-repeat;
        background-position: left top;
        line-height: 18px;
        text-decoration: none;
Пример #28
0
    exit;
}

// show popup
$params['itemid'] = $item_uuid;
$params['mod'] = 'remove';
$params['bs_uuid'] = $bs_uuid;

?>
<h2><?php 
echo _T("Remove from boot menu", "imaging");
?>
</h2>

<form action="<?php 
echo urlStr("base/computers/bootmenu_remove", $params);
?>
" method="post">
    <p><?php 
printf(_T("Are you sure you want to remove <b>%s</b> from the boot menu ?", "imaging"), $label);
?>
</p>
    <input name='valid' type="submit" class="btnPrimary" value="<?php 
echo _T("Remove", "imaging");
?>
" />
    <input name="bback" type="submit" class="btnSecondary" value="<?php 
echo _T("Cancel", "imaging");
?>
" onClick="new Effect.Fade('popup'); return false;"/>
</form>
Пример #29
0
 * $Id$
 *
 * This file is part of Management Console.
 *
 * 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
 */
require "localSidebar.php";
require "graph/navbar.inc.php";
$zone = $_GET["zone"];
$ajax = new AjaxFilter(urlStrRedirect("network/network/ajaxZoneMembersFilter", array("zone" => $zone)));
$ajax->display();
$p = new PageGenerator(sprintf(_T("Members of zone %s"), $zone));
$sidemenu->forceActiveItem("index");
$p->setSideMenu($sidemenu);
$p->display();
$ajax->displayDivToUpdate();
$f = new Form();
$f->addOnClickButton(_T("Add a host"), urlStr("network/network/addhost", array("zone" => $zone)));
$f->display();
Пример #30
0
}
$status = getSmbStatus();
?>
    <br/>
    <h2><?php 
echo _T("Connections on shares", "samba");
?>
(<?php 
echo count($status);
?>
):</h2>
<?php 
if (count($status) != 0) {
    foreach ($status as $sharename => $connects) {
        if (!in_array($sharename, array("homes", "IPC\$", "netlogon", "archives"))) {
            $link = '<a href="' . urlStr('samba/shares/details', array('share' => $sharename)) . '">' . $sharename . '</a>';
        } else {
            $link = $sharename;
        }
        print "<h3>" . _T("Share", "samba") . " {$link}(" . count($connects) . "):</h3>";
        $connections = array();
        foreach ($connects as $connect) {
            if ($connect['ip']) {
                $cip = $connect['ip'];
            } else {
                $cip = "n/a";
            }
            $tstamp = strftime("%a, %d %b %Y %H:%M:%S", $connect['lastConnect']);
            $connections[$connect['useruid']][] = array($connect['machine'], $cip, $tstamp);
        }
        ksort($connections);