function updateUpdate($param)
 {
     // This is sort of a hack... The ssl configuration of the ipaddress has to be reflected properly in the domain too. So the web objects are initialized, the ssl parameters are changed on the fly and synced again. All this is because, apache will refuse to start if the ssl files are missing, which is f*****g terrible. (later)... Apache is actually ok. The whole damn problem is with iis. Be careful about the createExtraVariables. As for now, the web object doesn't create objects from the parent domain object, and thus web object will work indepnednely without the help of the domain parent object. Thus the parent of the web can anything. But if in the at any time in the future the web object starts needing any parameter from the domain, then this will have to be rewritten. Then the domain objects have to initialized first, then the web objects are initialized, and the web can be created only UNDER the domain, and not directly under this object.
     global $gbl, $sgbl, $login, $ghtml;
     $driverapp = $gbl->getSyncClass($this->__masterserver, $this->__readserver, 'web');
     $olddom = $this->domain;
     $newdom = $param['domain'];
     if (!csb($newdom, "lxdummy") && !is_disabled($newdom)) {
         $ip = gethostbyname($newdom);
         if ($ip != $this->getParentO()->ipaddr) {
             throw new lxexception("this_domain_does_not_resolve_to_this_ip", 'domain', $newdom);
         }
     }
     $this->domain = $param['domain'];
     $this->ipaddr = $this->getParentO()->ipaddr;
     $this->setUpdateSubaction();
     $this->write();
     if ($olddom) {
         $odo = new Web(null, $this->syncserver, $olddom);
         $odo->get();
         // Need to get the client here itself so that it won't run into problems later. You don't need the client anymore...
         //$odo->getParentO()->getParentO();
         if ($odo->dbaction !== 'add') {
             $odo->setUpdateSubaction('fixipdomain');
             $odo->was();
         }
     }
     if ($olddom === $newdom) {
         return;
     }
     if (is_disabled($newdom)) {
         return;
     }
     $ndo = new Web(null, $this->syncserver, $newdom);
     $ndo->get();
     //$ndo->getParentO()->getParentO(); //you don't need client anymore..
     $ndo->setUpdateSubaction('fixipdomain');
     $ndo->was();
 }
        $this->response->status($code);
        $this->response->headers->set("Content-Type", "application/json");
        echo json_encode(array("errors" => array($err)));
    }
    function authed()
    {
        return isset($_SESSION["adminid"]);
    }
}
$app = new Web(array("debug" => false));
$app->add(new Slim\Middleware\ContentTypes());
$app->notFound(function () use($app) {
    echo "Requested resource not found";
});
$app->get("/", function () use($app) {
    $app->redirect("/");
});
$app->get("/plans", function () use($app) {
    if (!$app->authed()) {
        $app->makeError("Access denied");
        return;
    }
    $qres = mysql_query("SELECT * FROM `tblproducts` p WHERE p.`type` IN ( 'hostingaccount','reselleraccount') and p.`configoption1` != '' and p.`servertype` = 'cpanel';");
    if ($qres === FALSE) {
        $app->makeError("Unable to get the list of hosting packages");
        return;
    }
    $plans = array();
    while (($row = mysql_fetch_assoc($qres)) !== FALSE) {
        $plans[] = array("id" => intval($row["id"]), "label" => $row["name"], "description" => $row["description"], "name" => $row["configoption1"], "limits" => array("ftp" => intval($row["configoption2"]), "disk" => intval($row["configoption3"]), "email" => intval($row["configoption4"]), "bandwidth" => intval($row["configoption5"]), "dedicated_ip" => onoffval($row["configoption6"]), "ssh" => onoffval($row["configoption7"]), "databases" => intval($row["configoption8"]), "cgi" => onoffval($row["configoption9"]), "subdomains" => intval($row["configoption10"]), "frontpage" => onoffval($row["configoption11"]), "parked" => intval($row["configoption12"]), "addon" => intval($row["configoption14"]), "overage" => strval($row["overagesenabled"][0]) === "1"));
    }