function createExtraVariables() { global $gbl, $sgbl, $login, $ghtml; $revc = $login->getObject('general')->reversedns_b; if (!$revc->dns_slave_list) { throw new lxexception("dns_params_not_configured", '', ""); } $this->syncserver = implode(",", $revc->dns_slave_list); $rdrlist = $this->getList('rdnsrange'); $rdrange = null; foreach ($rdrlist as $k => $v) { list($base, $first) = self::getBaseEnd($v->firstip); list($base, $last) = self::getBaseEnd($v->lastip); $rdrange[] = array($base, $first, $last); } $this->__var_rdnsrange = $rdrange; dprintr($this->__var_rdnsrange); $sq = new Sqlite(null, 'reversedns'); $res = $sq->getTable(); foreach ($res as $r) { list($base, $last) = self::getBaseEnd($r['nname'], $this->__var_rdnsrange); $total[$base][] = array('nname' => $r['nname'], 'end' => $last, 'reversename' => $r['reversename']); } $this->__var_revdns1 = $revc->primarydns; $this->__var_revdns2 = $revc->secondarydns; $this->__var_reverse_list = $total; }
function createExtraVariables() { // Not here. Two different extra variables are needed, so they are created in synctosystem. // Brought back here, since the secondary server concept has been abolished in favor of multiple primary servers. global $gbl, $sgbl, $login, $ghtml; if ($sgbl->isHyperVm()) { $this->createExtraVariablesHyperVM(); return; } $db = new Sqlite($this->__masterserver, "dns"); $gen = $login->getObject('general')->generalmisc_b; $serverlist = explode(",", $this->syncserver); $list = null; foreach ($serverlist as $server) { $string = "syncserver LIKE '%{$server}%'"; $nlist = $db->getRowsWhere($string, array('nname')); $dlistv = "__var_domainlist_{$server}"; $this->{$dlistv} = $nlist; } //FIXME: We should only get the addon domains for the domains configured on that particular server. IN the case of single server system, it is not a problem, since that means we will have to get all the domains. but in the case of distributed setup, we need to properly get only the add domains under the domains loaded above. $dbaddon = new Sqlite(null, "addondomain"); $addr = $dbaddon->getTable(array('nname')); foreach ($serverlist as $server) { $dlistv = "__var_domainlist_{$server}"; $this->{$dlistv} = lx_array_merge(array($this->{$dlistv}, $addr)); } $this->fixDateSerial(); $this->__var_addonlist = $this->getParentO()->getList('addondomain'); $mydb = new Sqlite(null, "ipaddress"); $string = "syncserver = '{$this->syncserver}'"; $this->__var_ipssllist = $mydb->getRowsWhere($string, array('ipaddr', 'nname')); }
function loaddriverappInfo($master) { $db = new Sqlite($master, 'driver'); $res = $db->getTable(); // Doing the setFromArray stuff here itself. Since that is the place from where we are called, and if we call setfromarray here, naturally it results in a loop. $__t_ob = null; foreach ((array) $res as $row) { $nname = $row['nname']; $obj = new driver($master, null, $nname); foreach ($row as $key => $value) { if (csb($key, "ser_")) { $key = strfrom($key, "ser_"); $value = unserialize(base64_decode($value)); } if (cse($key, "_b") && !is_object($value)) { $value = new $key(null, null, $nname); } if (is_numeric($key)) { continue; } $obj->{$key} = $value; } $__t_ob[$nname] = $obj; } if (!isset($this->driver)) { $this->driver = array(); } $this->driver[$master] = $__t_ob; //dprintr($this->driver); }
static function initThisList($parent, $class) { $db = new Sqlite($parent->__masterserver, "ipaddress"); if ($parent->isAdmin()) { $result = $db->getTable(); } else { $result = $db->getRowsWhere("clientname = '" . $parent->nname . "'"); } return $result; }
static function getDnsTemplateList($parent) { $res = $parent->dnstemplate_list; dprintr($res); if (!$res) { $sq = new Sqlite(null, "dnstemplate"); $res = $sq->getTable(); $res = get_namelist_from_arraylist($res); } if (!$res) { throw new lxException("err_no_dns_template", '', ''); } return $res; }
function update_all_slave() { $db = new Sqlite(null, "pserver"); $list = $db->getTable(array("nname")); foreach ($list as $l) { if ($l['nname'] === 'localhost') { continue; } try { print "Upgrading Slave {$l['nname']}...\n"; rl_exec_get(null, $l['nname'], 'remotetestfunc', null); } catch (exception $e) { print $e->getMessage(); print "\n"; } } }
function updateform($subaction, $param) { if ($subaction === 'update') { $vlist['devname'] = array("M", $this->devname); $vlist['ipaddr'] = array('M', $this->ipaddr); $vlist['netmask'] = array('M', $this->netmask); $vlist['gateway'] = array('M', $this->gateway); $vlist['__v_button'] = ""; } else { if ($subaction === "exclusive") { $db = new Sqlite($this->__masterserver, "client"); $list = $db->getTable(array("nname")); $list = get_namelist_from_arraylist($list); $list = lx_merge_good('__unassigned__', $list); $vlist['clientname'] = array('s', $list); } } return $vlist; }
function fixDatabaseServers() { $db = new Sqlite($this->__masterserver, "pserver"); $list = $db->getTable(array('nname')); foreach ($list as $l) { if ($this->isDeleted() && $l['nname'] === $this->nname) { continue; } $nlist[] = $l['nname']; } if ($this->dbaction === 'add') { $nlist[] = $this->nname; } sort($nlist); rl_exec_get($this->__masterserver, null, array('pserver', 'localfixDatabaseServers'), array($nlist)); }
<?php include_once "htmllib/lib/include.php"; initProgram('admin'); $list = $login->getList('ippool'); $sq = new Sqlite(null, 'tmpipassign'); $res = $sq->getTable(); foreach ($res as $r) { if (!ippool::checkIfAlreadyAssigned('vps', $r['nname'])) { $sq->rawQuery("delete from tmpipassign where nname = '{$r['nname']}';"); continue; } if (time() - $r['ddate'] > 40) { $sq->rawQuery("delete from tmpipassign where nname = '{$r['nname']}';"); } } foreach ($list as $l) { $l->freeflag = 'on'; $fip = $l->getFreeIp(10000); if ($fip) { $l->freeflag = 'on'; } else { $l->freeflag = 'dull'; } $l->setUpdateSubaction(); $l->write(); }
function add_vps_backup_dir() { $sq = new Sqlite(null, 'vps'); $res = $sq->getTable(array('nname')); if (isset($res)) { foreach ($res as $r) { if (!lxfile_exists("__path_program_home/vps/{$r['nname']}/__backup")) { lxfile_mkdir("__path_program_home/vps/{$r['nname']}/__backup"); $vpsbackupdirname = $r['nname']; print "- Backup dir created for {$vpsbackupdirname} \n"; } } return true; } return false; }
function backup_main() { global $argc, $argv; global $gbl, $login, $ghtml; $gbl->__restore_flag = true; if ($argc === 1) { print "Usage: {$argv['0']} --restore/--list --accounts='domain-<domain1.com>,client-<client1>,domain-<domain2.com>' <backup-file> [--switchserverlist='oldserver1:newserver1,oldserver2:newserver2']\n Use --accounts=all to restore everything.\n"; exit; } initProgram("admin"); $object = $login; $opt = parse_opt($argv); if (isset($opt['class']) && isset($opt['name'])) { $object = new $opt['class'](null, null, $opt['name']); $object->get(); if ($object->dbaction === 'add') { log_error("{$opt['class']} doesnt exist"); print "{$opt['class']} doesnt exist\n"; exit; } } $class = $opt['class']; $name = $opt['name']; if (lx_core_lock("{$class}-{$name}.restore")) { print "Another Restore for the same class is happening..\n"; exit; } $backup = $object->getObject('lxbackup'); if (isset($opt['switchserverlist'])) { $sq = new Sqlite(null, "pserver"); $serverlist = $sq->getTable(); $serverlist = get_namelist_from_arraylist($serverlist); $server = $opt['switchserverlist']; $list = explode(",", $server); foreach ($list as $l) { if (!$l) { continue; } $q = explode(":", $l); $rlist[$q[0]] = $q[1]; if (!array_search_bool($q[1], $serverlist)) { print "The server {$q[1]} doesn't exist in the server system here\n"; exit; } } $param['switchserverlist'] = $rlist; dprint("\n"); } else { $param['switchserverlist'] = null; } /* if (!testAllServersWithMessage()) { $backup->restorestage = "Failed due to: could not connect to slave servers"; clearLxbackup($backup); exit; } */ $file = $opt['final']; //$param = get_variable($opt); if (isset($opt['list'])) { $gbl->__var_list_flag = true; $param['_accountselect'] = null; } else { if (isset($opt['restore'])) { $gbl->__var_list_flag = false; if (!isset($opt['accounts'])) { print "Restore option needs accounts that are to be restored. --accounts='domain-domain.com,client:clientname'... Use --list to find out all the domain/clients in the backup archive.\n"; clearLxbackup($backup); exit; } $account = $opt['accounts']; //$account = str_replace(":", "_s_vv_p_", $account); $account = str_replace(":", "-", $account); $accountlist = explode(",", $account); $param['_accountselect'] = $accountlist; } else { print "Usage: {$argv['0']} <--list/--restore --accounts=> <filename>\n"; clearLxbackup($backup); exit; } } if (isset($opt['priority']) && $opt['priority'] === 'low') { sleep(20); } dprintr($param); //dprint($file); try { $backup->doUpdateRestore($file, $param); $backup->restorestage = 'done'; } catch (exception $e) { log_error("Restore Failed. Reason: {$e->__full_message} \n"); print "Restore Failed. Reason: {$e->__full_message} \n"; $mess = $e->__full_message; mail($object->contactemail, "Restore Failed..", "Restore Failed for {$object->nname} with the Message {$mess}"); $backup->restorestage = "Restore failed due to {$mess}"; } clearLxbackup($backup); }
static function getIpaddressList($parent) { $db = new Sqlite($parent->__masterserver, 'ipaddress'); $res = $db->getTable(array('ipaddr')); $res = get_namelist_from_arraylist($res, 'ipaddr'); return $res; }
<?php include "htmllib/lib/include.php"; $db = new Sqlite(null, $argv[1]); $res = $db->getTable(); $class = $argv[1]; foreach ($res as $r) { if (isset($stored[$r['nname']])) { print "duplicate found {$r['nname']}\n"; $db->rawQuery("delete from {$class} where nname = '{$r['nname']}'"); $ob = new $class(null, null, $r['nname']); $ob->create($r); $ob->write(); continue; } $stored[$r['nname']] = $r; }
function add_vps_backup_dir() { if (lxfile_exists("__path_program_home/vps")) { print "VPS backupdir already exist...\n"; return; } $sq = new Sqlite(null, 'vps'); $res = $sq->getTable(array('nname')); foreach ($res as $r) { lxfile_mkdir("__path_program_home/vps/{$r['nname']}/__backup"); $vpsbackupdirname = $r['nname']; print "Backup dir created for {$vpsbackupdirname} \n"; } }
function updateform($subaction, $param) { global $gbl, $sgbl, $login, $ghtml; $parent = $this->getParentO(); $gen = $login->getObject('general')->generalmisc_b; switch ($subaction) { case "recovervps": /* if (!lxfile_exists("{$this->getOstemplatePath()}/{$this->ostemplate}.tar.gz")) { $list = exec_class_method("vps__{$this->ttype}", "getOsTemplatelist"); $vlist['recover_ostemplate'] = array('A', $list); } */ $vlist['recover_confirm_f'] = null; return $vlist; case "mount": $vlist['confirm_f'] = array('M', "confirm"); return $vlist; case "macaddress": $vlist['macaddress'] = null; return $vlist; case "ostemplatelist": getResourceOstemplate($vlist, $this->ttype); $vlist['__v_updateall_button'] = array(); return $vlist; case "hardpoweroff": $vlist['confirm_f'] = array("M", "Confirm"); return $vlist; case "reboot": $vlist['reboot_confirm_f'] = null; // array("f", "Confirm"); $vlist['__v_button'] = 'Reboot'; return $vlist; case "shutdown": $vlist['poweroff_confirm_f'] = null; // array("f", "Confirm"); $vlist['__v_button'] = 'Power OFF'; return $vlist; case "mainipaddress": $vlist['mainipaddress'] = array('s', get_namelist_from_objectlist($this->vmipaddress_a)); return $vlist; case "livemigrate": $serverlist = $login->getServerList($this->get__table()); $rs = null; foreach ($serverlist as $l) { $driverapp = $gbl->getSyncClass(null, $l, 'vps'); if ($driverapp === 'openvz') { $rs[] = $l; } } $serverlist = $rs; if (!$this->checkIfLockedForAction('livemigrate')) { if ($this->olddeleteflag === 'doing') { $this->olddeleteflag = 'program_interrupted'; $this->setUpdateSubaction(); } } $vlist['olddeleteflag'] = array('M', null); $vlist['server_detail_f'] = array('M', pserver::createServerInfo($serverlist, $this->get__table())); $vlist['syncserver'] = array('s', $serverlist); return $vlist; case "append_inittab": $vlist['text_inittab'] = array('t', $this->text_inittab); return $vlist; case "append_xen_config": $vlist['text_xen_config'] = array('t', $this->text_xen_config); return $vlist; case "changelocation": if ($this->isXen()) { return $this->formChangeLocationXen(); } else { return $this->formChangeLocationOpenvz(); } break; case "createuser": $this->username = str_replace(".", "", $this->nname); $vlist['username'] = array('M', null); return $vlist; case "changeosimagename": $vlist['ostemplate'] = null; return $vlist; case "clonevps": $vlist['__v_button'] = array(); return $vlist; case "createtemplate": $stem = explode("-", $this->ostemplate); if ($this->isWindows()) { $name = "{$stem[0]}-"; } else { $name = "{$stem[0]}-{$stem[1]}-{$stem[2]}-"; } $vlist['newostemplate_name_f'] = array("m", array("pretext" => $name)); $vlist['__v_button'] = 'Create'; return $vlist; case "rebuild": if ($this->isWindows()) { $type = "img"; } else { $type = "tar.gz"; } $ostlist = vps::getVpsOsimage($this, $this->ttype, $type); $vlist['ostemplate'] = array('A', $ostlist); if ($this->isNotWindows() && $this->priv->isOn('backup_flag')) { //$vlist['rebuild_backup_f'] = null; } $vlist['rebuild_confirm_f'] = null; return $vlist; /* case "installkloxo": $this->kloxo_type = 'master'; $vlist['rebuild_confirm_f'] = null; $vlist['__v_button'] = 'Install'; return $vlist; */ /* case "installkloxo": $this->kloxo_type = 'master'; $vlist['rebuild_confirm_f'] = null; $vlist['__v_button'] = 'Install'; return $vlist; */ case "commandcenter": return $this->commandCenter($param); case "fixdev": $vlist['fixdev_confirm_f'] = null; return $vlist; case "rootpassword": if ($this->isXen()) { $vlist['__m_message_pre'] = 'xen_restart_message'; } $vlist['rootpassword'] = null; return $vlist; //ONly for Template... //ONly for Template... case "description": $vlist['description'] = null; //$vlist['share_status'] = null; if (!$this->isRightParent()) { $this->convertToUnmodifiable($vlist); } return $vlist; case "timezone": $vlist['timezone'] = array('s', pserver::getTimeZoneList()); return $vlist; case "information": $vlist['nname'] = array('M', $this->nname); $vlist['corerootdir'] = array('M', $this->corerootdir); $vlist['ddate'] = array('M', @date('d-m-Y', $this->ddate)); // $vlist['kloxo_flag'] = null; if ($login->isAdmin() && $this->isXen()) { $vlist['nosaveconfig_flag'] = null; } if (!$this->isXen()) { $vlist['vpsid'] = array('M', $this->vpsid); } if ($this->isXen() && $login->isAdmin()) { $vlist['vcpu_number'] = array('s', range(1, 10)); } if ($login->isAdmin()) { $use_slaves = "__use-slaves-backup-server__"; if (!$this->centralbackup_server) { $this->centralbackup_server = $use_slaves; } $sq = new Sqlite(null, "centralbackupserver"); $list = get_namelist_from_arraylist($sq->getTable(array('nname'))); $list = lx_merge_good(array($use_slaves), $list); //$vlist['centralbackup_flag'] = null; $vlist['centralbackup_server'] = array('s', $list); } $vlist['ostemplate'] = array('M', null); $vlist['parent_name_f'] = array('M', $this->getParentName()); //$vlist['dbtype_list'] = array('M', $this->listpriv->dbtype_list); $vlist['contactemail'] = ""; if (!$this->isLogin()) { $vlist['text_comment'] = null; } return $vlist; // Only for template. For the main guy, it comes as 'rebuild' // Only for template. For the main guy, it comes as 'rebuild' case "network": if ($this->isXen()) { $vlist['__m_message_pre'] = 'xen_restart_message'; } if (!$this->isLogin() || !$gen->isOn('disable_hostname_change')) { $vlist['hostname'] = null; } if ($this->isXen()) { if (!$this->networknetmask) { $this->networknetmask = "255.255.255.0"; } $vlist['networkgateway'] = null; $vlist['networknetmask'] = null; if ($login->priv->isOn('ip_manage_flag') || $login->isAdmin()) { $vlist['networkbridge'] = array('s', array("__automatic__", "xenbr0", "xenbr1", "xenbr2", "xenbr3", "xenbr4")); } } $iplist = $this->vmipaddress_a; $iplist = implode(", ", get_namelist_from_objectlist($iplist, 'nname')); $vlist['one_ipaddress_f'] = array('M', $iplist); $vlist['nameserver'] = null; return $vlist; case "ostemplate": $driverapp = $gbl->getSyncClass($this->__masterserver, $this->listpriv->vpspserver_sing, 'vps'); $ostlist = rl_exec_get(null, $this->listpriv->vpspserver_sing, array("vps__{$driverapp}", "getOsTemplatelist")); $ostlist = lx_merge_good(array('--defer-osimage--' => '--defer-osimage--'), $ostlist); $vlist['ostemplate'] = array('A', $ostlist); return $vlist; case "changesyncserver": $sq = new Sqlite(null, 'pserver'); $list = $sq->getTable(array('nname')); $list = get_namelist_from_arraylist($list); $vlist['syncserver'] = array('s', $list); $gbl->__ajax_refresh = true; return $vlist; // Only for template... // Only for template... case "vpspserver_s": $listpriv = $parent->listpriv; $vlist['server_detail_f'] = array('M', pserver::createServerInfo($listpriv->vpspserver_list, "vps")); $parent = $this->getParentO(); $vlist['vpspserver_sing'] = null; if (!$this->isRightParent()) { $this->convertToUnmodifiable($vlist); } return $vlist; } return parent::updateform($subaction, $param); }
static function createListSlist($parent) { $nlist['nname'] = null; $nlist['parent_clname'] = null; $nlist['dtype'] = array('s', array('--any--', 'maindomain', 'subdomain')); if (check_if_many_server()) { $sql = new Sqlite($parent->__masterserver, "pserver"); $res = $sql->getTable(array('nname')); $rs = get_namelist_from_arraylist($res); $rs = lx_array_merge(array(array('--any--'), $rs)); $nlist['webpserver'] = array('s', $rs); $nlist['mmailpserver'] = array('s', $rs); $nlist['dnspserver'] = array('s', $rs); } return $nlist; }
function migrateResourceplan($class) { $ss = new Sqlite(null, "resourceplan"); $r = $ss->getTable(); if ($r) { return; } $sq = new Sqlite(null, 'clienttemplate'); $cres = $sq->getTable(); if ($class) { $nsq = new Sqlite(null, "{$class}template"); $dres = $nsq->getTable(); $total = lx_array_merge(array($cres, $dres)); } else { $total = $cres; } foreach ($total as $t) { $string = $ss->createQueryStringAdd($t); $addstring = "insert into resourceplan {$string};"; $ss->rawQuery($addstring); } }
function getAllclients($cttype = null) { $db = new Sqlite(null, 'client'); $list = $db->getTable(array('nname', 'cttype')); return $list; }
static function createListSlist($parent) { global $gbl, $sgbl, $login, $ghtml; $nlist['nname'] = null; $nlist['contactemail'] = null; $nlist['resourceplan_used'] = null; if ($sgbl->isKloxo()) { $nlist['default_domain'] = null; } $nlist['status'] = array('s', array('--any--', 'on', 'off')); $nlist['cttype'] = array('s', array('--any--', 'reseller', 'customer')); $nlist['traffic_usage_q'] = array('s', array('--any--', 'overquota', 'underquota')); if (check_if_many_server()) { $sql = new Sqlite($parent->__masterserver, "pserver"); $res = $sql->getTable(array('nname')); $rs = get_namelist_from_arraylist($res); $rs = lx_merge_good(array('--any--'), $rs); $nlist['websyncserver'] = array('s', $rs); $nlist['mmailsyncserver'] = array('s', $rs); //$nlist['coma_dnssyncserver_list'] = array('s', $rs); } return $nlist; }
function getDbServerNum() { $db = new Sqlite($this->__masterserver, "pserver"); $list = $db->getTable(array('nname')); foreach ($list as $k => $l) { $nlist[] = $l['nname']; } sort($nlist); foreach ($nlist as $k => $l) { if ($l === $this->syncserver) { return $k + 1; } } }
<?php include_once "htmllib/lib/include.php"; if (!isset($argv[1])) { print "Need file name\n"; exit; } $sq = new Sqlite(null, "vps"); $list = $sq->getTable(array("vpsid", "nname", "contactemail", "password", "rootpassword")); foreach ($list as $l) { $nlist[$l['vpsid']] = $l; } lfile_put_serialize($argv[1], $nlist); dprintr($nlist);
function updateform($subaction, $param) { global $gbl, $sgbl, $login, $ghtml; switch ($subaction) { case "installatron": $vlist['__v_button'] = array(); return $vlist; case "ostemplatelist": getResourceOstemplate($vlist, 'all'); $vlist['__v_updateall_button'] = array(); return $vlist; case "createinvoice_m": $vlist['month'] = null; return $vlist; case "createinvoice_s": $vlist['month'] = array('s', $this->getInvoiceMonthList()); return $vlist; case "search_engine": $vlist['se_url'] = array('M', "http://"); $vlist['se_email'] = null; return $vlist; case "cron_mailto": $vlist['cron_mailto'] = null; return $vlist; case "default_domain": $vlist['default_domain'] = array('s', add_disabled(get_namelist_from_objectlist($this->getList('domain')))); return $vlist; case "shell_access": $res[] = "/bin/bash"; $res[] = "/usr/bin/lxjailshell"; $res = add_disabled($res); $vlist['nname'] = array('M', null); $vlist['disable_system_flag'] = null; $vlist['shell'] = array('s', $res); $vlist['__v_updateall_button'] = array(); return $vlist; case "generate_csr": include "lib/countrycode.inc"; foreach ($gl_country_code as $key => $name) { $temp[$key] = $name; } $s = new sslcert(null, null, null); $this->ssl_data_b = new ssl_data_b(null, null, null); $vlist['contactemail'] = array('M', null); $vlist["ssl_data_b_s_commonName_r"] = null; $vlist["ssl_data_b_s_emailAddress_r"] = null; $vlist["ssl_data_b_s_countryName_r"] = array('A', $temp); $vlist["ssl_data_b_s_stateOrProvinceName_r"] = null; $vlist["ssl_data_b_s_localityName_r"] = null; $vlist["ssl_data_b_s_organizationName_r"] = null; $vlist["ssl_data_b_s_organizationalUnitName_r"] = null; return $vlist; case "domainpserver": if ($this->isAdmin()) { $parent = $this; } else { $parent = $this->getParentO(); } self::getDomainServerVlist($parent, $this, $vlist); return $vlist; case "forcedeletepserver": if_not_admin_complain_and_exit(); $list = get_namelist_from_objectlist($this->getList('pserver')); $vlist['pserver_delete_f'] = array('s', array_remove($list, "localhost")); return $vlist; case "deleteorphanedvps": $sq = new Sqlite(null, 'vps'); $slist = get_namelist_from_objectlist($this->getList('pserver')); $res = $sq->getTable(array('nname', 'syncserver', 'parent_clname')); $list = null; foreach ($res as $r) { if (!array_search_bool($r['syncserver'], $slist)) { $list[$r['nname']] = "{$r['nname']} ({$r['syncserver']}) (orphaned)"; } } if ($list) { $vlist['vps_delete_f'] = array('A', $list); } else { $vlist['vps_delete_f'] = array('M', 'No Orphaned vm'); } return $vlist; case "multivpscreate": $vlist['vps_basename_f'] = null; $vlist['vps_admin_password_f'] = null; $vlist['vps_count_f'] = null; $vlist['vps_template_name_f'] = array('s', get_namelist_from_objectlist($this->getList('vpstemplate'))); return $vlist; case "disable_url": $vlist['disable_url'] = array('m', array('pretext' => 'http://')); return $vlist; case "message": $vlist['wall_from_f'] = array('M', $login->nname); $vlist['send_to_f'] = array('M', $this->nname); $vlist['wall_subject_f'] = null; $vlist['wall_message_f'] = null; $vlist['__v_button'] = 'Send'; return $vlist; case "skeleton": $vlist['skeletonarchive'] = array('M', null); $vlist['skeletonarchive_f'] = null; return $vlist; case "wall": $vlist['wall_from_f'] = array('M', $this->nname); //Can't do this. If he has 10000 client, this itelf will hang the machine. //$vlist['send_to_f'] = array('M', $namlist); $vlist['wall_subject_f'] = null; $vlist['wall_message_f'] = null; $vlist['__v_button'] = 'Send'; return $vlist; case "dnstemplatelist": $parent = $this->getParentO(); $nlist = domain::getDnsTemplateList($parent); $vlist['dnstemplate_list'] = array('U', $nlist); $vlist['__v_updateall_button'] = array(); return $vlist; case "information": $vlist['nname'] = array('M', $this->nname); if ($this->isAdmin()) { $gen = $login->getObject('general'); $this->disable_admin = $gen->disable_admin; $vlist['disable_admin'] = null; } if ($this->isLogin()) { $vlist['cttype'] = array('M', $this->cttype); } else { $parent = $this->getParentO(); $res = null; if (check_if_many_server()) { $ctlist = array('reseller', 'customer', 'wholesale'); } else { $ctlist = array('reseller', 'customer'); } foreach ($ctlist as $v) { if ($parent->isGte($v)) { continue; } $res[] = $v; } if ($res) { $vlist['cttype'] = array('s', $res); } else { $vlist['cttype'] = array('M', $this->cttype); } } $vlist['ddate'] = array('M', @date('d-m-Y', $this->ddate)); if (!$this->isAdmin()) { $vlist['parent_name_f'] = array('M', $this->getParentName()); } $vlist['contactemail'] = ""; if (!$this->isLogin()) { $vlist['text_comment'] = null; } return $vlist; case "license": $lic = $login->getObject('license')->licensecom_b; if ($login->isAdmin()) { $vlist['lic_pserver_num_f'] = array('M', $lic->lic_pserver_num); $vlist['lic_client_num_f'] = array('M', $lic->lic_client_num); $vlist['lic_maindomain_num_f'] = array('M', $lic->lic_maindomain_num); } else { $vlist['lic_node_num_f'] = array('M', $lic->node_num); } $vlist['lic_live_support_f'] = array('M', $lic->lic_live_support); //$vlist['lic_ipaddress_f'] = array('M', $lic->lic_ipaddress); $vlist['lic_client_f'] = array('M', $lic->lic_client); //$vlist['lic_current_f'] = array('t', lfile_get_contents('__path_program_etc/license.txt')); $vlist['license_upload_f'] = null; return $vlist; case "ipaddress": $parent = $this->getParentO(); if ($this->isLogin() || !$this->isRightParent()) { $vlist['ipaddress_list'] = array('M', $this->getIpaddress($this->listpriv->webpserver_list)); $vlist['__v_button'] = array(); } else { if (check_if_many_server()) { dprintr($this->listpriv->webpserver_list); $iplist = $parent->getIpaddress($this->listpriv->webpserver_list); } else { $iplist = $parent->getIpaddress(array('localhost')); } dprintr($iplist); $vlist['ipaddress_list'] = array('Q', $iplist); } return $vlist; case "pserver_s": $parent = $this->getParentO(); $list = null; $serverlist = client::getPserverListPriv(); if ($this->isLogin() || !$this->isRightParent()) { foreach ($serverlist as $s) { $slist = "{$s}_list"; $vlist["{$s}_list"] = array('M', $this->listpriv->{$slist}); } $vlist['__v_button'] = array(); //$vlist['dbtype_list'] = array('M', $this->listpriv->dbtype_list); return $vlist; } else { $vlist['server_detail_f'] = null; foreach ($serverlist as $s) { $slist = "{$s}_list"; // Hack.. Actually, admin's listpriv should be empty so that the __get inside the listpriv will get automatically called. if ($parent->isAdmin()) { unset($parent->listpriv->{$slist}); } $vlist["{$s}_list"] = null; $list = lx_array_merge(array($list, $parent->getServerList(strtilfirst($s, "pserver")))); } $sinfo = pservercore::createServerInfo($list); $sinfo = get_warning_for_server_info($parent, $sinfo); $vlist['server_detail_f'] = array('M', $sinfo); //$vlist['dbtype_list'] = null; return $vlist; } case "description": $vlist['description'] = null; //$vlist['share_status'] = null; if (!$this->isRightParent()) { $this->convertToUnmodifiable($vlist); } return $vlist; } return parent::updateform($subaction, $param); }