本文整理匯總了PHP中client::getPserverListPriv方法的典型用法代碼示例。如果您正苦於以下問題:PHP client::getPserverListPriv方法的具體用法?PHP client::getPserverListPriv怎麽用?PHP client::getPserverListPriv使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類client
的用法示例。
在下文中一共展示了client::getPserverListPriv方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateform
//.........這裏部分代碼省略.........
$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);
}
示例2: continueForm
static function continueForm($parent, $class, $param, $continueaction)
{
global $gbl, $sgbl, $login, $ghtml;
$vlist = null;
self::validate_client_name($param['nname']);
$param['nname'] = trim($param['nname']);
if ($continueaction === 'server') {
if (isOn($param['send_welcome_f'])) {
if (!$param['contactemail']) {
throw new lxexception("sending_welcome_needs_contactemail", array('contactemail', 'send_welcome_f'), '');
}
if (!validate_email($param['contactemail'])) {
throw new lxexception("contactemail_is_not_valid_email_address", 'contactemail', '');
}
}
dprintr($param);
if ($param['resourceplan_f'] !== 'continue_without_plan') {
$param['use_resourceplan_f'] = 'On';
$ret['param'] = $param;
$ret['action'] = 'addnow';
return $ret;
}
$array = client::getPserverListPriv();
foreach ((array) $array as $a) {
$v = "{$a}_list";
if (!$parent->listpriv->{$v}) {
//throw new lxException ("no_server_pool", $v);
}
$param["listpriv_s_{$a}_list"] = $parent->listpriv->{$v};
}
// This is a hack... This should now only happen in kloxo and not in hypervm.
if (isset($param['listpriv_s_webpserver_list'])) {
$weblist = $param['listpriv_s_webpserver_list'];
$param['listpriv_s_ipaddress_list'] = $parent->getIpaddress($weblist);
$nlist = domain::getDnsTemplateList($parent);
$param['dnstemplate_list'] = $nlist;
}
$qvlist = getQuotaListForClass('client', $param);
$vlist = lx_merge_good($vlist, $qvlist);
$ret['action'] = "add";
//$ret['continueaction'] = 'server';
$ret['variable'] = $vlist;
$ret['param'] = $param;
}
return $ret;
}
示例3: continueForm
static function continueForm($parent, $class, $param, $continueaction)
{
global $gbl, $sgbl, $login, $ghtml;
$vlist = null;
self::validate_client_name($param['nname']);
// and issue #657 - Client user names with "__" are displayed with missing end
if (stristr($param['nname'], '__')) {
throw new lxexception("{$param['nname']}_use_double_underscore", 'nname');
}
// also check if /home/<client> exists --> prevent use like 'httpd' as client
/*
if (lxfile_exists("/home/{$param['nname']}")) {
throw new lxexception("{$param['nname']}_dir_exists_under_home_dir", 'nname');
}
*/
$reserved = array('apache', 'lighttpd', 'nginx', 'httpd', 'kloxo', 'lxadmin', 'lxlabs', 'lxcenter', 'nouser', 'tinydns', 'axfrdns', 'dnscache', 'dnslog', 'bind', 'named');
foreach ($reserved as $r) {
if ($param['nname'] === $r) {
throw new lxexception("{$param['nname']}_dir_as_reserved_under_home_dir", 'nname');
}
}
$param['nname'] = trim($param['nname']);
if ($continueaction === 'server') {
if (isOn($param['send_welcome_f'])) {
if (!$param['contactemail']) {
throw new lxexception("sending_welcome_needs_contactemail", array('contactemail', 'send_welcome_f'), '');
}
// accept to more contact mail - http://forum.lxcenter.org/index.php?t=msg&goto=89118
$contact = implode(",", str_replace(" ", "", $param['contactemail']));
foreach ($contact as $c) {
if (!validate_email($c)) {
throw new lxexception("contactemail_is_not_valid_email_address", 'contactemail', '');
}
}
}
dprintr($param);
if ($param['resourceplan_f'] !== 'continue_without_plan') {
$param['use_resourceplan_f'] = 'On';
$ret['param'] = $param;
$ret['action'] = 'addnow';
return $ret;
}
$array = client::getPserverListPriv();
foreach ((array) $array as $a) {
$v = "{$a}_list";
if (!$parent->listpriv->{$v}) {
//throw new lxException ("no_server_pool", $v);
}
$param["listpriv_s_{$a}_list"] = $parent->listpriv->{$v};
}
// This is a hack... This should now only happen in kloxo and not in hypervm.
if (isset($param['listpriv_s_webpserver_list'])) {
$weblist = $param['listpriv_s_webpserver_list'];
$param['listpriv_s_ipaddress_list'] = $parent->getIpaddress($weblist);
$nlist = domain::getDnsTemplateList($parent);
$param['dnstemplate_list'] = $nlist;
}
$qvlist = getQuotaListForClass('client', $param);
$vlist = lx_merge_good($vlist, $qvlist);
$ret['action'] = "add";
//$ret['continueaction'] = 'server';
$ret['variable'] = $vlist;
$ret['param'] = $param;
}
return $ret;
}
示例4: updateform
function updateform($subaction, $param)
{
global $gbl, $sgbl, $login, $ghtml;
$parent = $this->getParentO();
switch ($subaction) {
case "copyplan":
$clist = get_namelist_from_objectlist($parent->getList('client'));
$clist[] = $parent->nname;
$vlist['copy_clientname_f'] = array('s', $clist);
$vlist['realname_f'] = array('m', $this->realname);
return $vlist;
case "account":
$total = $this->getAccountList();
$total = lx_array_merge($total);
$vlist['account'] = array('M', implode(" ", $total));
$vlist['__v_button'] = array();
return $vlist;
case "limit_s":
case "limit":
$vlist = getQuotaListForClass('client');
$vlist['__m_message_pre'] = "resourceplan_change_pre";
// This is patently wrong. In update, the object is inititialized properly and we are suppsed to get the quota for the specific type of object and not for the class.... Changing it to $this.
$sgbl->method = 'post';
return $vlist;
case "dnstemplatelist":
$parent = $this->getParentO();
$nlist = domainBase::getDnsTemplateList($parent);
$vlist['dnstemplate_list'] = array('U', $nlist);
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";
$vlist["{$s}_list"] = null;
if ($parent->isAdmin()) {
$plist = $parent->getServerList(strtilfirst($s, "pserver"));
} else {
$plist = $parent->listpriv->{$slist};
}
if ($parent->isAdmin()) {
unset($parent->listpriv->{$slist});
}
$list = lx_array_merge(array($list, $plist));
}
$vlist['server_detail_f'] = array('M', pservercore::createServerInfo($list));
//$vlist['dbtype_list'] = null;
return $vlist;
}
case "ipaddress":
dprintr($this->listpriv->ipaddress_list);
$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 "description":
if ($this->islogin()) {
throw new lxException('you_cannot_set_your_own_limit', '');
}
$vlist['disable_per'] = array('s', array('off', '95', '100', '110', '120', '130'));
if ($sgbl->isHyperVm() && $sgbl->isDebug()) {
//$vlist['centralbackup_flag'] = null;
}
$vlist['description'] = null;
//$vlist['share_status'] = null;
if (!$this->isRightParent()) {
$this->convertToUnmodifiable($vlist);
}
return $vlist;
case "changerealname":
$vlist['realname'] = null;
return $vlist;
case "ostemplatelist":
getResourceOstemplate($vlist);
return $vlist;
}
return parent::updateform($subaction, $param);
}