X-Git-Url: http://git.pjr.cc/?p=configmanager.git;a=blobdiff_plain;f=lib%2Fscreenos.plugin.php;h=20555d34d18b94b2b535f4440aa46f6f2eaf6721;hp=30da6078c5aba68162b8fd76de9f5034d1fe7168;hb=16e3be6e5ed75359a4271cc94f80ca656cefd4b2;hpb=c5565a4a43cec9436fc8b6c8ddec513619405bbd diff --git a/lib/screenos.plugin.php b/lib/screenos.plugin.php index 30da607..20555d3 100644 --- a/lib/screenos.plugin.php +++ b/lib/screenos.plugin.php @@ -1,60 +1,8 @@ -Note: If your router/firewall/device uses a one-time password, leave these blank and manually update from the -home page
-Name
-Password
-Method - "; - - echo "Attempting first config grab, i see
"; - echo "
";
-		echo $config;
-		echo "
"; - } else { - echo "No username and password set, you can update manually from the home page\n"; - $hconfig["username"] = ""; - $hconfig["password"] = ""; - db_updateData("hosts", "hostconfig", base64_encode(serialize($hconfig)), "hostip", "$hip"); - } - - - echo "
";
-	print_r($_REQUEST);
-	echo "
"; -} +$HOST_TYPE["screenos"]["needsenable"] = false; function nsos_getConfigFromDB($hip, $cid) @@ -64,70 +12,11 @@ function nsos_getConfigFromDB($hip, $cid) return base64_decode($data[0]["configdata"]); } -function nsos_detail($hip) -{ - $data = db_selectData("configs", "hostip", "$hip", "configtime desc"); - - echo ""; - echo ""; - foreach($data as $dstruct) { - //echo "
";
-		//print_r($dstruct);
-		//echo "
"; - $dold = round((time()-$dstruct["configtime"])/86400); - - $lupdate = strftime("%T %e %b %G", $dstruct["configtime"])." ($dold days old)"; - $cid = $dstruct["configs_id"]; - echo ""; - } - echo "
Config DataCompare
$lupdate Get DownloadTick
"; - -} - function nsos_updateConfig($hip, $hostconfig) { - $hconf = unserialize(base64_decode($hostconfig)); - if($hconf["username"] == "" && !isset($_REQUEST["username"])) { - echo "No username/password data
"; -?> -
-Name
-Password
-
-
-"; - return 0; - } - - //error_log("getting config with ".$hconf["username"]." and ".$conf["password"]); - echo "Got config, saving it to db
"; - $lastupdate = time(); - db_updateData("hosts", "lastupdate", "$lastupdate", "hostip", "$hip"); - db_insertData("configs", "$hip", "$lastupdate", base64_encode($config)); - - echo "Config is:
";
-	echo $config;
-	echo "
"; } -function nsos_getConfig($host, $username, $password) +function nsos_getConfig($host, $username, $password, $enable) { return genericssh_ssh($host, $username, $password, "cli show configuration"); }