Пример #1
0
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
global $stateid;
global $SYNCHROSTATE_TODO;
global $CUSTOM_MENU;
global $IN_GROUP;
if ($stateid == $SYNCHROSTATE_TODO) {
    print "<table><tr><td><b>";
    print _T('You have modified this target\'s boot menu, if you are done please click on "Generate Menu" to update the computer boot menu.', 'imaging');
    print "</b></td><td>";
    $f = new ValidatingForm();
    $f->addButton("bsync", _T("Generate Menu", "imaging"));
    $f->display();
    print "</td></tr></table>";
} elseif (isset($_GET['tab']) && ($_GET['tab'] == 'tabbootmenu' || $_GET['tab'] == 'grouptabbootmenu') && isExpertMode()) {
    print "<table><tr><td>";
    print _T('Click on "Force Generation" if you want to force the update of the boot menu', 'imaging');
    print "</td><td>";
    $f = new ValidatingForm();
    $f->addButton("bsync", _T("Force Generation", "imaging"));
    $f->display();
    print "</td></tr></table>";
} else {
    print "<table><tr><td>";
    print _T('This target\'s boot menu is up-to-date.', 'imaging');
    print "</td></tr></table>";
}
if ($CUSTOM_MENU == 1) {
    /* This is a machine custom menu, so we propose to restore default location
     * menu */
Пример #2
0
}
echo "<br/><br/>";
/* display everything else in separated tables */
foreach ($display as $table) {
    $n = null;
    $h = array();
    $index = 0;
    foreach ($inv[$table] as $def) {
        foreach ($def as $k => $v) {
            $h[$k][$index] = $v;
        }
        $index += 1;
    }
    $max = 0;
    $conf["global"]["maxperpage"] = $index;
    $disabled_columns = isExpertMode() ? array() : getInventoryEM($table);
    foreach ($h as $k => $v) {
        if ($k != 'id' && $k != 'timestamp' && !in_array($k, $disabled_columns)) {
            if ($n == null) {
                $n = new ListInfos($h[$k], $k);
            } else {
                $n->addExtraInfo($h[$k], $k);
            }
            if (count($h[$k]) > $max) {
                $max = count($h[$k]);
            }
        }
    }
    if ($max > 0 && $n != null) {
        echo "<h3>{$table} ({$max})</h3>";
        $n->drawTable(0);
Пример #3
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
 */
$sidemenu = new SideMenu();
$sidemenu->setClass("inventory");
$sidemenu->addSideMenuItem(new SideMenuItem(_T("Incoming", 'inventory'), "inventory", "inventory", "incoming"));
$sidemenu->addSideMenuItem(new SideMenuItem(_T("Bios", 'inventory'), "inventory", "inventory", "index"));
$sidemenu->addSideMenuItem(new SideMenuItem(_T("Hardware", 'inventory'), "inventory", "inventory", "hardware"));
$sidemenu->addSideMenuItem(new SideMenuItem(_T("Software", 'inventory'), "inventory", "inventory", "software"));
$sidemenu->addSideMenuItem(new SideMenuItem(_T("Network", 'inventory'), "inventory", "inventory", "network"));
$sidemenu->addSideMenuItem(new SideMenuItem(_T("Controller", 'inventory'), "inventory", "inventory", "controller"));
$sidemenu->addSideMenuItem(new SideMenuItem(_T("Registry", 'inventory'), "inventory", "inventory", "registry"));
if (isExpertMode()) {
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("Drive", 'inventory'), "inventory", "inventory", "drive"));
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("Input", 'inventory'), "inventory", "inventory", "input"));
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("Memory", 'inventory'), "inventory", "inventory", "memory"));
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("Monitor", 'inventory'), "inventory", "inventory", "monitor"));
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("Port", 'inventory'), "inventory", "inventory", "port"));
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("Printer", 'inventory'), "inventory", "inventory", "printer"));
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("Sound", 'inventory'), "inventory", "inventory", "sound"));
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("Storage", 'inventory'), "inventory", "inventory", "storage"));
    $sidemenu->addSideMenuItem(new SideMenuItem(_T("VideoCard", 'inventory'), "inventory", "inventory", "videocard"));
}
Пример #4
0
 function begin()
 {
     $str = '<div id="expertMode" ';
     if (isExpertMode()) {
         $str .= ' style="display: inline;"';
     } else {
         $str .= ' style="display: none;"';
     }
     return $str . ' >';
 }
Пример #5
0
    $a_href_open = "<a href=''>";
    print "<p>";
    print sprintf(_T("Boot menu generation is still in progress for the following items : %s. Please wait or reload the page %shere%s.", "imaging"), join($running_on, ', '), $a_href_open, '</a>');
    print "</p>";
}
if (count($initerror_on) > 0) {
    print "<p>";
    print _T("The registering in the imaging server has failed.", "imaging");
    print "</p>";
    exit;
}
if (count($todo_on) > 0) {
    # DISPLAY the sync link
    print "<table><tr><td><b>";
    print sprintf(_T('You have modified the boot menu for the following items : %s. If you are done please click on "Generate Menu" to update the computer boot menu.', 'imaging'), join($todo_on, ', '));
    print "</b></font></td><td>";
    $f = new ValidatingForm();
    $f->add(new HiddenTpl("location_uuid"), array("value" => $location, "hide" => True));
    $f->addButton("bsync", _T("Generate Menu", "imaging"));
    $f->display();
    print "</td></tr></table>";
} elseif (isExpertMode()) {
    print "<table><tr><td>";
    print _T('Click on "Force Generation" if you want to force the update of the boot menu', 'imaging');
    print "</td><td>";
    $f = new ValidatingForm();
    $f->add(new HiddenTpl("location_uuid"), array("value" => $location, "hide" => True));
    $f->addButton("bsync", _T("Force Generation", "imaging"));
    $f->display();
    print "</td></tr></table>";
}
Пример #6
0
 /**
  * Return true if the page can be displayed in the current mode
  */
 function inCurrentMode()
 {
     if (isset($this->_options["expert"])) {
         $ret = $this->_options["expert"] && isExpertMode();
     } else {
         $ret = true;
     }
     return $ret;
 }
Пример #7
0
                 $elements = array();
                 $values = array();
                 foreach (range(0, count($networks['macAddress']) - 1) as $i) {
                     $elements[] = sprintf("%s / %s", $networks['ipHostNumber'][$i], $networks['macAddress'][$i]);
                     $values[] = $networks['networkUuids'][$i];
                 }
                 $macs_choice->setElements($elements);
                 $macs_choice->setElementsVal($values);
                 $f->add(new TrFormElement(_T("Choose the MAC address you want to use", "imaging"), $macs_choice));
                 $f->pop();
             } elseif (count($networks['macAddress']) == 1) {
                 $f->add(new HiddenTpl("choose_network"), array("value" => $networks['networkUuids'][0], "hide" => True));
             }
         }
     }
     if (!isExpertMode()) {
         $f->add(new TitleElement(_T("Please switch to expert mode now if you want to change more parameters.", "imaging"), 3));
     } else {
         $f->add(new TitleElement(_T("You can switch to standard mode now if you want less parameters.", "imaging"), 3));
     }
     $f->push(new DivExpertMode());
     expertModeDisplay($f, $has_profile, $type, $menu, $opts, $target, $real_target);
     $f->pop();
     $f->addValidateButton("bvalid");
     if ($type == '' && !$has_profile && ($whose && $whose[0] == $target['uuid'])) {
         $f->addButton("bunregister", _T("Unregister this computer", 'imaging'), 'btnSecondary');
     }
     $f->pop();
     // Div expert mode
     $f->display();
 }
Пример #8
0
function displayExpertCss()
{
    if (isExpertMode()) {
        print ' style="display: inline;"';
    } else {
        print ' style="display: none;"';
    }
}
Пример #9
0
         $index += 1;
     }
     foreach ($machine[1] as $element) {
         $result['Machine'][$index] = $name;
         foreach ($element as $head => $val) {
             if ($head != 'id' && $head != 'timestamp') {
                 $result[$head][$index] = $val;
             }
         }
         $index += 1;
     }
     $params[] = array('hostname'=>$machine[0], 'uuid'=>$machine[2]);
 }
 $n = null;
     
 $disabled_columns = (isExpertMode() ? array() : getInventoryEM($display));
 $disabled_columns[] = 'id';
 $disabled_columns[] = 'timestamp';
 $disabled_columns[] = 'Icon';
 
 /* Delete these both lines because Type and Application columns will be removed from database */
 $disabled_columns[] = 'Type';
 $disabled_columns[] = 'Application';
 
 /*Generate icon => <img src="data:image/jpg;base64,DATA">*/
 if (isset($result['Icon'])) {
     $index = 0;
     foreach ($result['Icon'] as $v) {
         if ($v != '') {
             $result['Icon'][$index] = '<IMG src="data:image/jpeg;base64,'.$v.'">';
         }
Пример #10
0
function _mail_baseGroupEdit($ldapArr, $postArr)
{
    if (!isset($ldapArr["cn"][0])) {
        return;
    }
    print "<div class=\"formblock\" style=\"background-color: #FFD;\">";
    print "<h3>" . _T("Mail plugin", "mail") . "</h3>\n";
    $mail = "";
    $maildomain = "";
    if (hasGroupMailObjectClass($ldapArr['cn'][0])) {
        $hasMail = "checked";
        if (isset($ldapArr["mail"])) {
            $mail = $ldapArr["mail"][0];
        }
        if (hasVDomainSupport()) {
            $tmparr = explode("@", $mail);
            $mail = $tmparr[0];
            $maildomain = $tmparr[1];
        }
    } else {
        $mail = computeMailGroupAlias($ldapArr['cn'][0]);
        $hasMail = "";
        $maildomain = "";
        if (hasVDomainSupport()) {
            $vdomains = getVDomains("");
            if (count($vdomains) > 0) {
                $maildomain = $vdomains[0][1]["virtualdomain"][0];
            }
        }
    }
    if ($hasMail == "" && $mail == "") {
        print _T("No mail alias can be set for this group", "mail");
    } else {
        print '<table cellspacing="0">';
        if (hasZarafaSupport()) {
            $trz = new TrFormElement(_T("Zarafa group", "mail"), new CheckboxTpl("zarafaGroup"));
            $trz->display(array("value" => isZarafaGroup($ldapArr['cn'][0]) ? "checked" : ""));
        }
        $test = new TrFormElement(_T("Enable mail alias for users of this group ", "mail"), new CheckboxTpl("mailgroupaccess"));
        $param = array("value" => $hasMail, "extraArg" => 'onclick="toggleVisibility(\'maildiv\');"');
        $test->display($param);
        print "</table>";
        if (!$hasMail) {
            $style = 'style =" display: none;"';
        }
        print '<div id="maildiv" ' . $style . '>';
        print '<table cellspacing="0">';
        if (!hasVDomainSupport()) {
            $m = new TrFormElement(_T("Mail alias", "mail"), new InputTpl("mailgroupalias"));
            $m->displayRo(array("value" => $mail));
        } else {
            print '<tr><td width="40%" style="text-align: right;">' . _T("Mail alias", "mail") . '</td><td>' . $mail . '<input  type="hidden" value="' . $mail . '" name="mailgroupalias">&nbsp;@&nbsp;';
            print '<input type="text" id="autocomplete" name="maildomain" value="' . $maildomain . '" /><div id="autocomplete_choices" class="autocomplete"></div>';
            print '<script type="text/javascript">new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "' . urlStrRedirect('mail/domains/ajaxMailDomainFilter') . '", {paramName: "value"});</script>';
            print '</td></tr>';
        }
        if (isExpertMode()) {
            $mailhidden = "";
            if (isset($ldapArr['mailhidden']) && $ldapArr['mailhidden'][0] == 'YES') {
                $mailhidden = 'checked="checked"';
            }
            print '<tr><td width="40%" style="text-align: right;">' . _T("Mail hidden", "mail") . '</td>';
            print '<td><input type="checkbox" name="mailhidden" ' . $mailhidden . ' /></td></tr>';
        }
        print "</table>";
        print "</div>";
    }
    print "</div>";
}