From 5882044ae8cee1579bb1e5582497ae8b3b9e85c5 Mon Sep 17 00:00:00 2001 From: paulr Date: Sun, 12 Jun 2011 06:13:50 +1000 Subject: [PATCH] setup up host update bit --- lib/www.php | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) 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"); -- 1.7.0.4