예제 #1
0
     } else {
         $setif = 0;
     }
     if (preg_match("/show (config|running-config)/", $line)) {
         $iscfg = 1;
     } else {
         $iscfg = 0;
     }
 } elseif ($iscfg) {
     # Highlight Config
     if (!preg_match("/^\$|Building configuration/", $line)) {
         # Ignore those lines to be consistent with Devices-Config
         if ($sln) {
             $devln++;
         }
         echo Shoconf($line, 0, $devln);
     }
 } elseif ($getif and preg_match("/^\\s+[A-L]{0,1}[0-9]{1,2}/", $line, $ifs)) {
     # POST IF status on HP from "sh int brief"
     if (preg_match("/\\sDown\\s/", $line)) {
         $ifstat[$ifs[0]] = 0;
         echo "<span class=\"drd\">{$line}</span>\n";
     } else {
         $ifstat[$ifs[0]] = 1;
         echo "<span class=\"olv\">{$line}</span>\n";
     }
 } elseif ($setif and preg_match("/^\\s+[A-L]{0,1}[0-9]{1,2}/", $line, $ifs)) {
     # Set IF status on HP in according sections
     if ($ifstat[$ifs[0]]) {
         echo "<span class=\"olv\">{$line}</span>\n";
     } else {
예제 #2
0
<a href="?shc=<?= $ucfg ?>&sln=<?=!$sln ?>&smo=<?= $smo ?>"><img src="img/16/form.png" title="Line #"></a>
<a href="?shc=<?= $ucfg ?>&sln=<?= $sln ?>&smo=<?=!$smo ?>"><img src="img/16/say.png" title="motd"></a>
<a href="System-Export.php?act=c&exptbl=configs&query=SELECT+config+FROM+configs+where+DEVICE%3D%22<?= $ucfg ?>%22&type=plain"><img src="img/16/flop.png" title="<?= (($verb1)?"$explbl $cfglbl":"$cfglbl $explbl") ?>"></a>
<a href="Devices-Status.php?dev=<?= $ucfg ?>"><img src="img/16/sys.png" title="Device-Status"></a>
<a href="Devices-Doctor.php?dev=<?= $ucfg ?>"><img src="img/16/cinf.png" title="<?= $cfglbl ?> <?= $sumlbl ?>"></a>
<?= (Devcli($cfg[4],$cfg[5],2)) ?>
<?php if($isadmin)
	echo "<a href=$_SERVER[PHP_SELF]?dco=$ucfg><img src=\"img/16/bcnl.png\" onclick=\"return confirm('$dellbl $cfglbl?')\" title=\"$dellbl $cfglbl!\"></a>\n";
?>

<div class="code">
<?php
	$lnr = 0;
	foreach ( explode("\n",$cfg[1]) as $cl ){
		if ($sln) $lnr++;
		echo Shoconf($cl,$smo,$lnr);
	}
echo "</div></td><td valign=top>";
?>

<form method="post" action="System-Files.php">
<select name="cfg" id="cfg" onchange="this.form.submit();">
<option value=""><?= (($verb1)?"$edilbl $fillbl":"$fillbl $edilbl") ?> ->
<?php
if (is_dir("$nedipath/conf/$shc")){
	foreach (glob("$nedipath/conf/$shc/*.cfg") as $f) {
		$l = substr(strrchr($f, '/'),1);
		echo "<option value=\"$shc/$l\">$l\n";
	}
}
?>
예제 #3
0
echo $modgroup[$self];
?>
2">
<th><img src="img/32/dtxt.png"><br>Configuration (from <?php 
echo date("j. M Y", $cfg[3]);
?>
)</th><th><img src="img/32/cfg.png"><br>Changes</th></tr>
<tr><td class="imga" valign=top>
<?
if(preg_match("/adm/",$_SESSION['group']) )
	echo "<a href=$_SERVER[PHP_SELF]?dco=$ucfg><img src=\"img/16/bcnl.png\" align=right onclick=\"return confirm('Delete $cfg[0] config?')\" title=\"Delete config!\"></a>\n";
#if ( file_exists("log/$ucfg.cfg") )
#	echo "<a href=\"log/$ucfg.conf\"><img src="img/16/flop.png align=right title=\"Save link as...\"></a>\n";
echo "<a href=$_SERVER[PHP_SELF]?shc=$ucfg&sln=" . (!$sln) . "><img src=\"img/16/form.png\" align=right title=\"Toggle Line#\"></a>\n";
echo "<a href=$_SERVER[PHP_SELF]?shc=$ucfg&smo=" . (!$smo) . "><img src=\"img/16/say.png\" align=right title=\"Suppress motd character\"></a><div class=\"code\">\n";
Shoconf($cfg[1],$smo,$sln);
echo "</div></td><td class=\"imgb\" valign=top>";
if(preg_match("/adm/",$_SESSION['group']) )
	echo "<a href=$_SERVER[PHP_SELF]?dch=$ucfg><img src=\"img/16/bcnl.png\" align=right onclick=\"return confirm('Clear changes for $cfg[0]?')\" title=\"Clear changes!\"></a>\n";
echo "<div class=\"code\">$changs";
echo "</div></td></tr></table>";
}

include_once ("inc/footer.php");

// Optimize configuration before comparison
function Opdiff($cfg,$mo){
	$config = "";
	foreach ( split("\n",$cfg) as $l ){
		if($mo == 'i' and preg_match("/secret 5|hostname|password 7|key 7|access vlan|clock-period|engineID|Current\s|change|updated/",$l) ){
			$config .= "\n";