X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=libcbfwr%2Fweb.php;h=6f976750366918f8d443f82c75505703fb6750b5;hp=66e7cdf23d2a481d8a3508bf2be6eff19ae11716;hb=13e5ebe14a18fb0d217fdc6fc4fc786a678889da;hpb=0f5458e4a9c18595f7d9501880011369e4e65942
diff --git a/libcbfwr/web.php b/libcbfwr/web.php
index 66e7cdf..6f97675 100644
--- a/libcbfwr/web.php
+++ b/libcbfwr/web.php
@@ -5,6 +5,8 @@ $MENU_ITEMS["20_Objects"]["link"] = "$BASE_URL/objects";
$MENU_ITEMS["20_Objects"]["name"] = "Objects";
$MENU_ITEMS["30_Rules"]["link"] = "$BASE_URL/rules";
$MENU_ITEMS["30_Rules"]["name"] = "Rules";
+$MENU_ITEMS["15_Routes"]["link"] = "$BASE_URL/routing";
+$MENU_ITEMS["15_Routes"]["name"] = "Routing";
$MENU_ITEMS["10_Interfaces"]["link"] = "$BASE_URL/interfaces";
$MENU_ITEMS["10_Interfaces"]["name"] = "Interfaces";
$MENU_ITEMS["05_Admin"]["link"] = "$BASE_URL/admin";
@@ -26,10 +28,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 +57,19 @@ class CBFWWeb {
CBFWInterfacesPage($url_s);
break;
case "objects":
- $bodyFunction = "CBFWObjectsPage";
+ CBFWObjectsPage($url_s);
+ break;
+ case "routing":
+ CBFWRoutingPage($url_s);
break;
case "rules":
$bodyFunction = "CBFWRulesPage";
break;
+ case "changes":
+ CBFWChangesPage($url_s);
+ break;
case "admin":
- $bodyFunction = "CBFWAdminPage";
+ CBFWAdminPage($url_s);
break;
default:
$bodyFunction = findUrl($url_s);
@@ -69,22 +82,25 @@ 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 "\n\n\n";
+ print_r($comms->getConfig(4));
+ echo "\n\n\n";
+ print_r($comms->getConfig(5));
echo "
";
}
@@ -121,7 +137,7 @@ function CBFWAddMessage($messagelev, $message)
function CBFWMessageBuilder()
{
-
+ echo "message";
}
function CBFWpageBuilder($bodyClass, $bodyFunction, $bodycontent=null, $title="CBFW", $bodyfunctiondata=null)
@@ -168,9 +184,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 +239,36 @@ function cbfw_getLastSeen($ip, $data)
}
+function CBFWConfigStatus()
+{
+ global $WEB_ROOT_FS, $BASE_URL;
+
+ $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 Show";
+ }
+
+
+ echo "Saved Config: $saved ";
+ echo "Running Config: $running ";
+ echo "Client Config: $client ";
+}
+
function cbfw_tdiffToAgo($time_in_sec)
{
$tdiff = $time_in_sec;
@@ -292,5 +340,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
|
|
|