X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=libcbfwr%2Fweb.php;h=f28b21f9e071af97cc5999e5d12ca4e9e4685801;hp=66e7cdf23d2a481d8a3508bf2be6eff19ae11716;hb=86842492eae6203c9df0df46363b4e809d577c70;hpb=0f5458e4a9c18595f7d9501880011369e4e65942 diff --git a/libcbfwr/web.php b/libcbfwr/web.php index 66e7cdf..f28b21f 100644 --- a/libcbfwr/web.php +++ b/libcbfwr/web.php @@ -26,10 +26,15 @@ class CBFWWeb { $bodycontent = null; $conf = new Config(); - $conf->loadConfig(); + $comms = new Comms(); + $conf->loadConfig($comms->getConfig(0)); $rconfig = $conf->getConfig(); if($rconfig["status"] != "conf") { + if($rconfig["status"] == "nodir") { + cbfw_startnodir(); + return 0; + } cbfw_startinstaller(); return 0; } @@ -50,13 +55,13 @@ class CBFWWeb { CBFWInterfacesPage($url_s); break; case "objects": - $bodyFunction = "CBFWObjectsPage"; + CBFWObjectsPage($url_s); break; case "rules": $bodyFunction = "CBFWRulesPage"; break; case "admin": - $bodyFunction = "CBFWAdminPage"; + CBFWAdminPage($url_s); break; default: $bodyFunction = findUrl($url_s); @@ -69,22 +74,21 @@ class CBFWWeb { } -function CBFWAdminPage($urls) -{ - echo "im an admin page"; -} - function CBFBuildHomePage($urls) { echo "Must remember this, gotta rules could apply to multiple zones not just one
"; echo "i.e.: add rule reject from object/host/hostname to address6/2003::123 in zones Zone/zonename/rulenum Zone/zonename/rulenum"; - $conf = new Config(); - $conf->loadConfig(); + + $comms = new Comms(); echo "
";
-	print_r($conf->getConfig());
+	print_r($comms->getConfig(0));
+	echo "\n\n\n";
+	print_r($comms->getConfig(1));
 	echo "\n\n\n";
-	print_r($conf->getBootConfig());
+	print_r($comms->getConfig(2));
+	echo "\n\n\n";
+	print_r($comms->getConfig(3));
 	echo "
"; } @@ -121,7 +125,7 @@ function CBFWAddMessage($messagelev, $message) function CBFWMessageBuilder() { - + echo "message"; } function CBFWpageBuilder($bodyClass, $bodyFunction, $bodycontent=null, $title="CBFW", $bodyfunctiondata=null) @@ -168,9 +172,11 @@ function CBFWpageBuilder($bodyClass, $bodyFunction, $bodycontent=null, $title="C // page top echo "

CBFW


"; - echo "
"; + echo "
"; CBFWMessageBuilder(); - echo "
"; + echo ""; + CBFWConfigStatus(); + echo "
"; // menu, then body echo "
"; @@ -221,6 +227,34 @@ function cbfw_getLastSeen($ip, $data) } +function CBFWConfigStatus() +{ + $comms = new Comms(); + + $conf0 = $comms->getConfig(0); + $conf1 = $comms->getConfig(2); + $conf2 = $comms->getConfig(3); + + if($conf1["status"] == "nochange") { + $saved = "Current"; + $running = "Current"; + } else { + $saved = "Old"; + $running = "Current"; + } + if($conf2["status"] == "nochange") { + $client = "Current"; + } else { + $ch = $conf2["status"]; + $client = "$ch Changes"; + } + + + echo "Saved Config: $saved
"; + echo "Running Config: $running
"; + echo "Client Config: $client
"; +} + function cbfw_tdiffToAgo($time_in_sec) { $tdiff = $time_in_sec; @@ -292,5 +326,15 @@ Now, tell me where you want me to create the webconfig file:
+ +

Cant Run

+There is no config and no directory where i can store one. Login to the server and either create /var/run/cbfwr or /var + + \ No newline at end of file