Beispiel #1
0
<?php

include_once "modules/noc/class_noc.php";
$noc = new noc();
switch ($_GET['step']) {
    case "2":
        if ($_POST['ip'] == '') {
            $error_noc['ip'] = t('Bitte gib eine IP-Adresse f&uuml;r das Device ein');
            $_GET['step'] = 1;
        }
}
switch ($_GET['step']) {
    default:
        $dsp->NewContent(t('User im Netzwerk finden'), t('Mit diesem Formular kannst du einen User im Netzwerk lokalisieren'));
        $dsp->SetForm("index.php?mod=noc&action=find&step=2");
        $dsp->AddTextFieldRow("ip", t('IP-Adresse'), $_POST['ip'], $error_noc['ip']);
        $dsp->AddFormSubmitRow(t('Weiter'));
        $dsp->AddBackButton("index.php?mod=noc");
        $dsp->AddContent();
        break;
    case "2":
        $dsp->NewContent(t('User im Netzwerk finden'), t('Mit diesem Formular kannst du einen User im Netzwerk lokalisieren'));
        $dsp->AddDoubleRow(t('IP-Adresse'), $_POST['ip']);
        $noc->IPtoMAC_arp($_POST['ip']);
        $dsp->AddSingleRow("<a href='index.php?mod=noc&action=find&step=3&ip={$_POST['ip']}'>Alle Ports Updaten</<a>");
        $dsp->AddBackButton("index.php?mod=noc&action=find&step=1");
        $dsp->AddContent();
        break;
    case "3":
        $func->question(t('Dieser Vorgang kann einige Zeit dauern. Willst du wirklich alle Ports updaten.'), "index.php?mod=noc&action=find&step=4&ip={$_GET['ip']}", "index.php?mod=noc&action=find&step=1");
        break;
Beispiel #2
0
<?php

include_once "modules/noc/class_noc.php";
$noc = new noc();
switch ($_GET["step"]) {
    default:
    case 1:
        // Get all the Port data
        $row = $db->qry_first("SELECT * FROM %prefix%noc_ports WHERE portid = %int%", $_GET["portid"]);
        if ($row["portid"] == "") {
            $func->error(t('Dieser Port existiert nicht'));
        } else {
            // Is the Port Enabled? No? Is it connected?
            switch ($row["linkstatus"]) {
                case "1":
                case "up":
                case "up(1)":
                    if ($row["adminstatus"] == "down(2)" || $row["adminstatus"] == "down" || $row["adminstatus"] == "2") {
                        $linkstatus = "<font color=\"red\">" . t('Ausgeschaltet') . "</font>";
                    } else {
                        $linkstatus = "<font color=\"green\">" . t('Aktiv') . "</font>";
                    }
                    break;
                case "2":
                case "down":
                case "down(2)":
                    if ($row["adminstatus"] == "down(2)" || $row["adminstatus"] == "down" || $row["adminstatus"] == "2") {
                        $linkstatus = "<font color=\"red\">" . t('Ausgeschaltet') . "</font>";
                    } else {
                        $linkstatus = "<font color=\"red\">" . t('Inaktiv') . "</font>";
                    }
Beispiel #3
0
<?php

include_once "modules/noc/class_noc.php";
$noc = new noc();
switch ($_GET["step"]) {
    // ------------------------------------------------------------------------------------
    // ERROR CHECKING
    case 3:
        if ($_POST["device_caption"] == "") {
            $noc_error['device_caption'] = t('Bitte gib einen Namen f&uuml;r das Device ein');
            $_GET["step"] = 2;
        }
        if ($_POST["device_ip"] == "") {
            $noc_error['device_ip'] = t('Bitte gib eine IP-Adresse f&uuml;r das Device ein');
            $_GET["step"] = 2;
        } else {
            if (!$func->checkIP($_POST["device_ip"])) {
                $noc_error['device_ip'] = t('Bitte gib eine <em>g&uuml;ltige</em> IP-Adresse f&uuml;r das Device ein');
                $_GET["step"] = 2;
            }
        }
        if ($_POST["device_write"] == "") {
            $noc_error['device_write'] = t('Bitte gib eine Write-Community f&uuml;r das Device an.');
            $_GET["step"] = 2;
        }
        if ($_POST["device_read"] == "") {
            $noc_error['device_read'] = t('Bitte gib eine Read-Community f&uuml;r das Device an.');
            $_GET["step"] = 2;
        }
        break;
}
Beispiel #4
0
<?php

include_once "modules/noc/class_noc.php";
$noc = new noc();
$filepath = "design/images/";
// Get the device details
$db->qry("SELECT * from %prefix%noc_devices WHERE id = %int%", $_GET["deviceid"]);
if (!($row = $db->fetch_array())) {
    $func->error(t('Das gew&auml;hlte Device existiert nicht'));
} else {
    switch ($_GET['step']) {
        default:
            $device_ip = $row["ip"];
            $readcommunity = $row["readcommunity"];
            // DISPLAYED TEXT
            $smarty->assign('caption', t('Name'));
            $smarty->assign('ip', t('IP-Adresse'));
            $smarty->assign('descr', t('Beschreibung'));
            $smarty->assign('contact', t('Kontaktadresse'));
            $smarty->assign('uptime', t('Laufzeit'));
            $smarty->assign('location', t('Standort'));
            $smarty->assign('context', t('Lengende'));
            $smarty->assign('active', t('Aktiv'));
            $smarty->assign('inactive', t('Inaktiv'));
            $smarty->assign('off', t('Ausgeschaltet'));
            // DISPLAYED VALUES
            $smarty->assign('deviceid', $_GET["deviceid"]);
            $smarty->assign('ip', $row["ip"]);
            $smarty->assign('caption', $row["name"]);
            $smarty->assign('contact', $row["sysContact"]);
            $smarty->assign('descr', $row["sysDescr"]);
Beispiel #5
0
<?php

include_once "modules/noc/class_noc.php";
$noc = new noc();
// STEPS: 1 = Display Form -- 2 = Register Device
// --------------------------------------------------------------------------------------------
switch ($_GET["step"]) {
    // ------------------------------------------------------------------------------------
    // ERROR CHECKING
    case 2:
        if ($_POST["device_caption"] == "") {
            $noc_error['device_caption'] = t('Bitte gib einen Namen f&uuml;r das Device ein');
            $_GET["step"] = 1;
        }
        if ($_POST["device_ip"] == "") {
            $noc_error['device_ip'] = t('Bitte gib eine IP-Adresse f&uuml;r das Device ein');
            $_GET["step"] = 1;
        } else {
            if (!$func->checkIP($_POST["device_ip"])) {
                $noc_error['device_ip'] = t('Bitte gib eine <em>g&uuml;ltige</em> IP-Adresse f&uuml;r das Device ein');
                $_GET["step"] = 1;
            }
        }
        if ($_POST["device_write"] == "") {
            $noc_error['device_write'] = t('Bitte gib eine Write-Community f&uuml;r das Device an.');
            $_GET["step"] = 1;
        }
        if ($_POST["device_read"] == "") {
            $noc_error['device_read'] = t('Bitte gib eine Read-Community f&uuml;r das Device an.');
            $_GET["step"] = 1;
        }