Ejemplo n.º 1
0
// set language
isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']);
//setdefault("window",array("bgcolor"=>"white"));
//setdefault("table",array("cellpadding"=>"0"));
//setdefault("text",array("size"=>"2"));
$title = my_("Display subnet information obtained from a routing table");
newhtml($p);
$w = myheading($p, $title, true);
// explicitly cast variables as security measure against SQL injection
list($cust) = myRegister("I:cust");
// display opening text
insert($w, heading(3, "{$title}."));
insert($w, text(my_("Display subnet information obtained from a routing table will show the routing table information on the left of the screen and the corresponding entries in the database on the right. If there are entries on both sides of the table, the subnet exists in the routing table and the database. If there are only entries on the left, the subnet only exists in the routing table. The same is true for the right hand side. If you click on the left, you can add the subnet to the database. If you click on the right, you can view the existing database information.")));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f = form(array("method" => "post", "action" => "displayrouter.php")));
$cust = myCustomerDropDown($ds, $f, $cust, $grps, FALSE) or myError($w, $p, my_("No customers"));
insert($f, textbrbr(my_("IP address of device to query")));
insert($f, span(my_("The device must be SNMP capable"), array("class" => "textSmall")));
insert($f, input_text(array("name" => "ipaddr", "size" => "15", "maxlength" => "15")));
insert($f, textbrbr(my_("Community string")));
$community = SNMP_COMMUNITY == "" ? "public" : SNMP_COMMUNITY;
insert($f, password(array("name" => "community", "value" => $community, "size" => "20", "maxlength" => "20")));
insert($f, textbrbr(my_("Router type")));
insert($f, span(my_("Type 'Generic' will work for most routers"), array("class" => "textSmall")));
$lst = array("generic" => my_("Generic"), "riverstone" => "RiverStone", "juniper" => "Juniper");
insert($f, selectbox($lst, array("name" => "rtrtype")));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
printhtml($p);
Ejemplo n.º 2
0
            insert($w, text(my_("Password changed")));
        } else {
            $formerror .= my_("Password could not be changed") . "\n";
        }
    }
}
if (!$_POST || $formerror) {
    myError($w, $p, $formerror, FALSE);
    if ($user) {
        insert($w, heading(3, sprintf(my_("Change password for user %s"), $user)));
    } else {
        insert($w, heading(3, sprintf(my_("Change password for user %s"), getAuthUsername())));
    }
    // start form
    insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text($title));
    // display opening text
    if ($user) {
        insert($con, hidden(array("name" => "user", "value" => "{$user}")));
    }
    insert($con, textbr(my_("New password (case sensitive!):")));
    insert($con, password(array("name" => "password1", "value" => "{$password1}", "size" => "40", "maxlength" => "40")));
    insert($con, textbrbr(my_("New password (again):")));
    insert($con, password(array("name" => "password2", "value" => "{$password2}", "size" => "40", "maxlength" => "40")));
    insert($con, generic("br"));
    insert($con, submit(array("value" => my_("Submit"))));
    insert($con, freset(array("value" => my_("Clear"))));
}
printhtml($p);
Ejemplo n.º 3
0
require_once "../layout/class.layout";
require_once "../auth.php";
require_once '../menus/lib/PHPLIB.php';
require_once '../menus/lib/layersmenu-common.inc.php';
require_once '../menus/lib/treemenu.inc.php';
$auth = new SQLAuthenticator(REALM, REALMERROR);
// And now perform the authentication
$grps = $auth->authenticate();
// set language
isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']);
$title = my_("Display subnet information");
newhtml($p);
$myWwwPath = '../menus/';
$w = myheading($p, $title);
insert($w, generic("link", array("rel" => "stylesheet", "href" => "{$myWwwPath}" . "layerstreemenu.css")));
insert($w, generic("link", array("rel" => "stylesheet", "href" => "{$myWwwPath}" . "layerstreemenu-hidden.css")));
insert($w, script("", array("language" => "JavaScript", "type" => "text/javascript", "src" => $myWwwPath . 'libjs/layerstreemenu-cookies.js')));
// display opening text
insert($w, heading(3, my_("Display subnets.")));
insert($w, text(my_("Click on customer/AS to display all associated subnets, click on the area to display all subnets in area and contained ranges, click on a range to display only subnets associated with that range. Subnets not within an area or range can be viewed by selecting the customer/AS.")));
insert($w, block("<p><hr>"));
insert($w, $t = table(array("cols" => "1", "width" => "100%", "border" => "1", "cellspacing" => "2", "frame" => "void", "rules" => "ALL", "cellpadding" => "5")));
insert($t, $leftmenu = cell(array("align" => "left", "width" => "100%", "valign" => "top")));
//read the database and create the strings containing the menus
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
@set_time_limit(90);
// default is collapsed, change to "1" for expanded tree
// value is stored in a cookie so clear cookies to see effect
$expanded = "";
$displayall = FALSE;
$menustring = "";
Ejemplo n.º 4
0
$export->addRow(array("subnet_addr", "subnet_size", "subnet_mask", "description", "last_modified", "changed_by", "update_sent"));
$export->saveRow();
$cnt = 0;
$prevrow = "";
while ($row = $result->FetchRow()) {
    setdefault("cell", array("class" => color_flip_flop()));
    $export->addRow(NULL);
    // customer is 0, display all customers with customer description
    // on customer change
    if ($cust == 0 and $row["custdescrip"] != $prevrow) {
        if (REGENABLED) {
            insert($t, $c = cell(array("colspan" => "7")));
        } else {
            insert($t, $c = cell(array("colspan" => "6")));
        }
        insert($c, generic("b"));
        insert($c, anchor($_SERVER["PHP_SELF"] . "?cust=" . $row["customer"] . "&areaindex=&rangeindex=&ipaddr={$ipaddr}&descrip=" . urlencode($descrip) . "&expr={$expr}&size={$size}", $row["custdescrip"]));
        $prevrow = $row["custdescrip"];
    }
    insert($t, $c = cell());
    insert($c, anchor("displaysubnet.php?baseindex=" . $row["baseindex"], inet_ntoa($row["baseaddr"])));
    $export->addCell(inet_ntoa($row["baseaddr"]));
    if ($row["subnetsize"] == 1) {
        insert($t, $c = cell());
        insert($c, text(my_("Host")));
        $export->addCell(my_("Host"));
    } else {
        insert($t, $c = cell());
        insert($c, text($row["subnetsize"]));
        $export->addCell($row["subnetsize"]);
    }
Ejemplo n.º 5
0
echo "Temporäres Verzeichnis:\t\t\t" . $tempDir . ": " . $tempUser["name"] . "({$tempStat['4']}):" . $tempGroup["name"] . "({$tempStat['5']}) " . generic(is_writable($tempDir), " beschreibbar") . "\n";
echo implode("\n", $tempDirSubdirs) . "\n";
#echo "Apache-User:				"******"\n";
echo "MySQLi-Modul:\t\t\t\t" . generic(extension_loaded("mysqli"), "geladen") . "\n";
echo "MySQL-Modul:\t\t\t\t" . generic(extension_loaded("mysql"), "geladen") . "\n";
echo "Reflection-Modul:\t\t\t" . generic(extension_loaded("reflection"), "geladen") . "\n";
echo "GD-Modul:\t\t\t\t" . generic(extension_loaded("gd"), "geladen") . " (bisher nur für multiCMS)\n";
echo "Curl-Modul:\t\t\t\t" . generic(extension_loaded("curl"), "geladen") . " (pixelLetter-Plugin)\n";
echo "Session-Modul:\t\t\t\t" . generic(extension_loaded("session"), "geladen") . "\n";
echo "Pear Imagick-Klasse:\t\t\t" . generic(class_exists("Imagick"), "geladen") . " (Exifer-Erweiterung für multiCMS)\n\n";
echo "alle geladenen Module:\n";
echo wordwrap(implode(", ", get_loaded_extensions()), 100) . "\n\n";
echo "Cookies:\t\t\t\t" . generic(isset($_COOKIE["TestCookie"]), "akzeptiert") . "\n";
echo "JavaScript:\t\t\t\t<span style=\"color:red;\" id=\"jstest\">nicht aktiviert</span>\n\n";
echo "MySQL-Server:\t\t\t\t" . generic($mysql, "erreichbar") . " (es werden nur localhost und 127.0.0.1 getestet)\n";
while ($t = $pf->pfdbFetchAssoc()) {
    echo "\t<b>" . str_pad($t["host"], 20) . "" . str_pad($t["datab"], 20) . "</b>\n";
    $r = mysql_connect($t["host"], $t["user"], $t["password"]);
    echo "\t\tMySQL server: " . mysql_get_server_info() . "\n";
    echo "\t\tMySQL client: " . mysql_get_client_info() . "\n";
    if (extension_loaded("mysqli")) {
        $ri = new mysqli($t["host"], $t["user"], $t["password"], $t["datab"]);
        #print_r($ri);
        echo "\t\tMySQLi client: " . $ri->client_info . "\n";
    }
    $ts = mysql_fetch_assoc(mysql_query("SELECT @@sql_mode"));
    echo "\t\tMode: " . str_replace(array("STRICT_TRANS_TABLES", "STRICT_ALL_TABLES"), array("<span style=\"color:red;\">STRICT_TRANS_TABLES</span>", "<span style=\"color:red;\">STRICT_ALL_TABLES</span>"), $ts["@@sql_mode"]);
    echo "\n";
    if ($r) {
        #$qG = mysql_query("SHOW GRANTS");
Ejemplo n.º 6
0
            insert($ck, anchor($vars, ">>"));
            $printed = 1;
        }
    }
    //create the export view form
    $export->setInfo(array(array("maintenance_page"), array("request index")));
    $export->createExportForm($w, NULL);
}
// display opening text
insert($w, heading(3, "{$title}."));
insert($w, textbr(my_("Perform the selected IPplan database maintenance.")));
// start form
insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
insert($f, hidden(array("name" => "action", "value" => "custindex")));
insert($f, generic("p"));
insert($f, submit(array("value" => my_("Display list of customer indexes"))));
// start form
insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
insert($f, hidden(array("name" => "action", "value" => "reqindex")));
insert($f, generic("p"));
insert($f, submit(array("value" => my_("View request list"))));
// start form
insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
insert($f, hidden(array("name" => "action", "value" => "deleterequest")));
insert($f, submit(array("value" => my_("Clear IP address request list"))));
// start form
insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
insert($f, hidden(array("name" => "action", "value" => "deleteaudit")));
insert($f, generic("p"));
insert($f, submit(array("value" => my_("Clear Audit Log"))));
printhtml($p);
Ejemplo n.º 7
0
function myheading($q, $title, $displaymenu = true)
{
    // Generate the correct prefix for URLs in menu.
    $BASE_URL = base_url();
    $BASE_DIR = base_dir();
    $myDirPath = $BASE_DIR . '/menus/';
    $myWwwPath = $BASE_URL . '/menus/';
    // these files should probably not be here
    require_once $myDirPath . 'lib/PHPLIB.php';
    require_once $myDirPath . 'lib/layersmenu-common.inc.php';
    require_once $myDirPath . 'lib/layersmenu.inc.php';
    require_once $BASE_DIR . '/menudefs.php';
    eval("\$ADMIN_MENU = \"{$ADMIN_MENU}\";");
    // create the html page HEAD section
    insert($q, $header = wheader("IPPlan - {$title}"));
    insert($q, $w = container("div", array("class" => "matte")));
    insert($header, generic("meta", array("http-equiv" => "Content-Type", "content" => "text/html; charset=UTF-8")));
    if ($displaymenu) {
        insert($header, generic("link", array("rel" => "stylesheet", "href" => "{$myWwwPath}" . "layersmenu-gtk2.css")));
        //    insert($header, generic("link",array("rel"=>"stylesheet","href"=>"$myWwwPath"."layersmenu-demo.css")));
    }
    // Konqueror and Safari browsers do not support overflow: auto css tag so use custom stylesheet
    if (stristr($_SERVER["HTTP_USER_AGENT"], "konqueror") or stristr($_SERVER["HTTP_USER_AGENT"], "safari")) {
        insert($header, generic("link", array("rel" => "stylesheet", "href" => "{$BASE_URL}" . "/themes/default-safari.css")));
    } else {
        // Added theme support.
        $themecookie = isset($_COOKIE["ipplanTheme"]) ? $_COOKIE["ipplanTheme"] : "";
        global $config_themes;
        // obtained from config.php file which is global
        if (!empty($themecookie) and $config_themes[$themecookie] != "") {
            insert($header, generic("link", array("rel" => "stylesheet", "href" => "{$BASE_URL}" . "/themes/{$config_themes[$themecookie]}")));
        } else {
            insert($header, generic("link", array("rel" => "stylesheet", "href" => "{$BASE_URL}" . "/themes/default.css")));
        }
    }
    if ($displaymenu) {
        insert($w, script("", array("language" => "JavaScript", "type" => "text/javascript", "src" => $myWwwPath . "libjs/layersmenu-browser_detection.js")));
        insert($w, script("", array("language" => "JavaScript", "type" => "text/javascript", "src" => $myWwwPath . 'libjs/layersmenu-library.js')));
        insert($w, script("", array("language" => "JavaScript", "type" => "text/javascript", "src" => $myWwwPath . 'libjs/layersmenu.js')));
        $mid = new LayersMenu(6, 7, 2, 1);
        $mid->setDirroot($BASE_DIR . '/menus/');
        $mid->setLibjsdir($BASE_DIR . '/menus/libjs/');
        $mid->setImgdir($BASE_DIR . '/menus/menuimages/');
        $mid->setImgwww($BASE_URL . '/menus/menuimages/');
        $mid->setIcondir($BASE_DIR . '/menus/menuicons/');
        $mid->setIconwww($BASE_URL . '/menus/menuicons/');
        $mid->setTpldir($BASE_DIR . '/menus/templates/');
        $mid->SetMenuStructureString($ADMIN_MENU);
        $mid->setIconsize(16, 16);
        $mid->parseStructureForMenu('hormenu1');
        $mid->newHorizontalMenu('hormenu1');
    }
    // draw header box
    insert($w, $con = container("div", array("class" => "headerbox", "align" => "center")));
    insert($con, heading(1, my_("IPPlan - IP Address Management and Tracking")));
    insert($con, block("<br>"));
    insert($con, heading(3, $title));
    if ($displaymenu) {
        // draw menu box here
        insert($w, $con = container("div", array("class" => "menubox")));
        insert($con, $t = table(array("cols" => "2", "width" => "100%")));
        insert($t, $c1 = cell());
        insert($t, $c2 = cell(array("align" => "right")));
        insert($c1, block($mid->getHeader()));
        insert($c1, block($mid->getMenu('hormenu1')));
        insert($c1, block($mid->getFooter()));
        // find a place to display logged in user
        insert($c2, $uc = container("div", array("class" => "userbox")));
        if (getAuthUsername() != "") {
            insert($uc, block(sprintf(my_("Logged in as %s"), getAuthUsername())));
        }
    }
    insert($w, $con = container("div", array("class" => "normalbox")));
    insert($w, $con1 = container("div", array("class" => "footerbox")));
    insert($con1, block("IPPlan v4.92b"));
    return $con;
}
Ejemplo n.º 8
0
function insertCreateUserForm($w, $ds)
{
    list($userid, $userdescrip, $useremail, $grp) = myRegister("S:userid S:userdescrip S:useremail S:grp");
    insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
    insert($f, hidden(array("name" => "action", "value" => "parsecreateuserform")));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Create new user")));
    insert($con, textbr(my_("User-id (case sensitive!):")));
    insert($con, input_text(array("name" => "userid", "value" => "{$userid}", "size" => "20", "maxlength" => "40")));
    insert($con, textbrbr(my_("User's fullname:")));
    insert($con, input_text(array("name" => "userdescrip", "value" => "{$userdescrip}", "size" => "40", "maxlength" => "80")));
    insert($con, textbrbr(my_("User's e-mail:")));
    insert($con, input_text(array("name" => "useremail", "value" => "{$useremail}", "size" => "40", "maxlength" => "64")));
    if (AUTH_INTERNAL) {
        insert($con, textbrbr(my_("Password (case sensitive!):")));
        insert($con, password(array("name" => "password1", "size" => "20", "maxlength" => "40")));
        insert($con, textbrbr(my_("Password (again):")));
        insert($con, password(array("name" => "password2", "size" => "20", "maxlength" => "40")));
    }
    $result2 = $ds->GetGrps();
    $lst = array("" => "No group");
    while ($row = $result2->FetchRow()) {
        $col = $row["grp"];
        $lst["{$col}"] = $row["grp"] . " - " . $row["grpdescrip"];
    }
    insert($con, textbrbr(my_("Group")));
    insert($con, selectbox($lst, array("name" => "grp"), $grp));
    insert($f, generic("br"));
    insert($f, submit(array("value" => my_("Create User"))));
    insert($f, freset(array("value" => my_("Clear"))));
}
Ejemplo n.º 9
0
function detect_video($d, $t, $r)
{
    if (preg_match('@jisu\\.cf@', $d) || preg_match('@juhe\\.ml@', $d) || preg_match('@iptvlinks\\.tk@', $d)) {
        echo_(" >>> generic" . PHP_EOL);
        generic($d, $t, $r);
    } elseif (preg_match('@youtube\\.com@', $d)) {
        echo_(" >>> youtube.com" . PHP_EOL);
        youtube($d, $t, $r);
    } else {
        echo "Url:{$d}\r\nChannel:{$t}\r\nNOT SUPPORTED YET.\r\n";
        stf($d);
    }
}