From: paulr Date: Sat, 11 Jun 2011 20:13:50 +0000 (+1000) Subject: setup up host update bit X-Git-Url: http://git.pjr.cc/?p=configmanager.git;a=commitdiff_plain;h=5882044ae8cee1579bb1e5582497ae8b3b9e85c5 setup up host update bit --- diff --git a/lib/www.php b/lib/www.php index 91ce2c2..dc3a105 100644 --- a/lib/www.php +++ b/lib/www.php @@ -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");