<?php include_once "htmllib/lib/include.php"; initProgram('admin'); $list = parse_opt($argv); if (isset($list['server'])) { $server = $list['server']; } else { $server = 'localhost'; } $var = $list['variable']; $val = $list['value']; $s = new Pserver(null, $server, $server); $s->get(); $pi = $s->getObject('phpini'); $pi->initPhpIni(); if (!isset($pi->phpini_flag_b->{$var})) { print "No variable by that name\n"; exit; } $pi->phpini_flag_b->{$var} = $val; $pi->setUpdateSubaction('full_update'); $pi->was(); $login->loadAllObjects('client'); $list = $login->getList('client'); foreach ($list as $c) { $dlist = $c->getList('domaina'); foreach ((array) $dlist as $l) { $web = $l->getObject('web'); if ($web->syncserver !== $server) { continue;
function postAdd() { global $gbl, $sgbl, $login, $ghtml; $parent = $this->getParentO(); $this->cpstatus = 'on'; $this->status = 'create'; $this->state = 'ok'; $this->kloxo_flag = 'on'; $this->rootpassword = $this->realpass; $this->username = str_replace(".", "", $this->nname); if ($this->isOn('use_resourceplan_f')) { $template = getFromAny(array($login, $parent), 'resourceplan', $this->resourceplan_f); if (!$template) { throw new lxexception("the_plan_doesnt_exist", 'resourceplan_f', $this->resourceplan_f); } $this->resourceplan_used = $this->resourceplan_f; $this->priv = clone $template->priv; $this->fixPrivUnset(); $this->changePlanSpecific($template); } if ($this->one_ipaddress_f) { full_validate_ipaddress($this->one_ipaddress_f); } $this->rootpassword_changed = 'on'; if ($this->one_ipaddress_f) { $ipadd = new vmipaddress_a(null, $this->syncserver, $this->one_ipaddress_f); $this->vmipaddress_a[$ipadd->nname] = $ipadd; } $syncs = new Pserver(null, $this->syncserver, $this->syncserver); $syncs->get(); if (is_unlimited($this->priv->vmipaddress_a_num)) { $this->priv->vmipaddress_a_num = 2; } if ($this->num_ipaddress_f) { $netinfo = $syncs->getIpPool($this->num_ipaddress_f); $totallist = $netinfo['ip']; if (!$this->nameserver) { $this->nameserver = $netinfo['nameserver']; } $this->networkgateway = $netinfo['networkgateway']; $this->networknetmask = $netinfo['networknetmask']; if ($totallist) { foreach ($totallist as $ip) { $ipadd = new vmipaddress_a(null, $this->syncserver, $ip); $this->vmipaddress_a[$ipadd->nname] = $ipadd; ippool::addToTmpIpAssign($l); } } } $this->used->vmipaddress_a_num = count($this->vmipaddress_a); if (!$this->hostname) { $this->hostname = strtil($this->nname, ".vm"); } $this->createSyncClass(); $this->createPublicPrivate($sslvar); // hack hack convert listpriv into a differnet object. $driverapp = $gbl->getSyncClass($this->__masterserver, $this->syncserver, 'vps'); $this->ttype = $driverapp; $this->getBestLocation(); $func = "postadd_{$driverapp}"; $this->{$func}(); // $this->distributeChildQuota(); //////////////////// /* if (exists_in_db($this->__masterserver, "uuser", $uuser->nname)) { throw new lxexception('user_exists_in_db', 'uuser'); } */ $this->setUpOsTemplateDownloadParam(); $backup = new LxBackup($this->__masterserver, $this->__readserver, $this->getClName()); $backup->initThisDef(); $this->AddObject('lxbackup', $backup); $this->lxclientpostAdd(); }