X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=libcbfwr%2Fweb.php;h=6baae23c14632b4884a1e170f439aec3ec9589f2;hp=66e7cdf23d2a481d8a3508bf2be6eff19ae11716;hb=60673f4f00bab805471fcbb85c8816aebb3a9582;hpb=0f5458e4a9c18595f7d9501880011369e4e65942
diff --git a/libcbfwr/web.php b/libcbfwr/web.php
index 66e7cdf..6baae23 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;
}
@@ -78,13 +83,17 @@ 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 +130,7 @@ function CBFWAddMessage($messagelev, $message)
function CBFWMessageBuilder()
{
-
+ echo "message";
}
function CBFWpageBuilder($bodyClass, $bodyFunction, $bodycontent=null, $title="CBFW", $bodyfunctiondata=null)
@@ -168,9 +177,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 +232,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 +331,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
|
|
|