setup up host update bit
authorpaulr <me@pjr.cc>
Sat, 11 Jun 2011 20:13:50 +0000 (06:13 +1000)
committerpaulr <me@pjr.cc>
Sat, 11 Jun 2011 20:13:50 +0000 (06:13 +1000)
lib/www.php

index 91ce2c2..dc3a105 100644 (file)
@@ -191,7 +191,25 @@ function www_updateHost()
        $func = $HOST_TYPE["$htype"]["getconfig"];
        $logdets = unserialize(base64_decode($hconfig));
 
-       $conf = $func($hip, $logdets["username"], $logdets["password"], $logdets["enable"]);
+       // now check enable, username and password bits for completeness
+       $need_user = false;
+       $need_pass = false;
+       $need_enable = false;
+
+       // this aint the right way.
+       if($logdets["username"] == "" && $_REQUEST["username"] == "") {
+               // we need a user
+               $need_user = true;
+       }
+       if($logdets["password"] == "" && $_REQUEST["password"] == "") {
+               // we need a user
+               $need_pass = true;
+       }
+       if($logdets["enable"] == "" && $_REQUEST["enable"] == "" && $HOST_TYPE["$htype"]["needsenable"]) {
+               $need_enable = true;
+       }
+       
+       $conf = $func($hip, $act_user, $act_pass, $act_enable);
 
        // function db_getMaxValue($tablename, $column, $columnsel="", $wheresel="")
        $oldconf_rid = db_getMaxValue("configs", "configs_id", "hostip", "$hip");