当前位置: 首页>>代码示例>>PHP>>正文


PHP get_namelist_from_arraylist函数代码示例

本文整理汇总了PHP中get_namelist_from_arraylist函数的典型用法代码示例。如果您正苦于以下问题:PHP get_namelist_from_arraylist函数的具体用法?PHP get_namelist_from_arraylist怎么用?PHP get_namelist_from_arraylist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_namelist_from_arraylist函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateform

 function updateform($subaction, $param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $sq = new Sqlite(null, 'web');
     $list = $sq->getRowsWhere("syncserver = '{$this->syncserver}'", array('nname'));
     $dlist = get_namelist_from_arraylist($list, 'nname');
     if (!$login->isAdmin()) {
         $sq = new Sqlite(null, 'domain');
         $nlist = $sq->getRowsWhere("parent_clname = '{$login->getClName()}'", array('nname'));
         $ndlist = get_namelist_from_arraylist($nlist);
         foreach ($dlist as $k => $v) {
             if (!array_search_bool($v, $ndlist)) {
                 unset($dlist[$k]);
             }
         }
     }
     if ($dlist) {
         $dlist = add_disabled($dlist);
         $vlist['domain'] = array('s', $dlist);
     } else {
         $vlist['domain'] = array('M', "No Domain");
         $vlist['__v_button'] = array();
     }
     return $vlist;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:25,代码来源:domainipaddresslib.php

示例2: updateWht

 function updateWht()
 {
     $res = $this->main->__var_whitelist;
     $res = merge_array_object_not_deleted($res, $this->main);
     $list = get_namelist_from_arraylist($res, 'ipaddress');
     $rmt = new Remote();
     $rmt->data = $list;
     lfile_put_serialize("__path_home_root/lxguard/whitelist.info", $rmt);
     lxshell_return("__path_php_path", "../bin/common/lxguard.php");
 }
开发者ID:digideskio,项目名称:hypervm,代码行数:10,代码来源:lxguardwhitelist__synclib.php

示例3: createExtraVariables

 function createExtraVariables()
 {
     $this->__var_system_username = $this->getParentO()->username;
     $sq = new Sqlite(null, 'davuser');
     $list = $sq->getRowsWhere("parent_clname = '{$this->parent_clname}'", array("username", "realpass"));
     $this->__var_davuser = $list;
     $sq = new Sqlite(null, 'web');
     $list = $sq->getRowsWhere("syncserver = '{$this->getParentO()->syncserver}'", array('nname'));
     $this->__var_domlist = get_namelist_from_arraylist($list);
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:10,代码来源:davuserlib.php

示例4: initThisOutOfBand

 static function initThisOutOfBand($parent, $iclass, $mclass, $rclass)
 {
     $sq = new Sqlite(null, $iclass);
     $res = $sq->getRowsWhere("parent_clname = '{$parent->getClName()}'", array("nname"));
     $res = get_namelist_from_arraylist($res);
     $ret = null;
     foreach ($res as $r) {
         $ret[] = "or";
         $ret[] = array('parent_clname', '=', "'{$mclass}-{$r}'");
     }
     unset($ret[0]);
     return $ret;
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:13,代码来源:lxdb.php

示例5: dbactionAdd

 function dbactionAdd()
 {
     global $gbl, $sgbl, $login;
     if (if_demo()) {
         return;
     }
     $_filepath = "__path_home_root/lxguard/hostdeny.info";
     $result = $this->main->__var_hostlist;
     $result = merge_array_object_not_deleted($result, $this->main);
     $list = get_namelist_from_arraylist($result, 'hostname', 'hostname');
     dprintr($list);
     lfile_put_serialize($_filepath, $list);
     lxshell_return("__path_php_path", "../bin/common/lxguard.php");
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:hostdeny__linuxlib.php

示例6: getDnsTemplateList

 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;
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:14,代码来源:domainbaselib.php

示例7: get_local_application_version_list

function get_local_application_version_list()
{
    $list = allinstallapp__linux::getListofApps();
    $list = get_namelist_from_arraylist($list);
    foreach ($list as $k => $v) {
        if (csb($v, "__title")) {
            continue;
        }
        $info = allinstallapp::getAllInformation($v);
        $ret[$v] = $info['pversion'];
    }
    $loc = new Remote();
    $loc->applist = $ret;
    return $loc;
}
开发者ID:soar-team,项目名称:kloxo,代码行数:15,代码来源:programlib.php

示例8: addform

 static function addform($parent, $class, $typetd = null)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $vlist['client'] = array('M', $parent->nname);
     $sq = new Sqlite(null, 'invoice');
     $res = $sq->getRowsWhere("client = '{$parent->nname}'", array("month"));
     $list = get_namelist_from_arraylist($res, 'month');
     $list = array_reverse($list);
     $vlist['month'] = array('s', $list);
     $vlist['amount'] = null;
     $vlist['paymentgw'] = null;
     $vlist['transactionid'] = null;
     $ret['variable'] = $vlist;
     $ret['action'] = 'add';
     return $ret;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:16,代码来源:paymentdetaillib.php

示例9: createExtraVariables

 function createExtraVariables()
 {
     global $gbl, $sgbl, $login, $ghtml;
     $gen = $login->getObject('general')->generalmisc_b;
     $port = $login->getObject('general')->portconfig_b;
     $webstatsprog = $gen->webstatisticsprogram;
     if (!$webstatsprog) {
         $webstatsprog = "awstats";
     }
     $this->__var_statsprog = $webstatsprog;
     $ol = array("index.php", "index.html", "index.shtml", "index.htm", "default.htm", "Default.aspx", "Default.asp", "index.pl");
     if (!isset($login->getObject('genlist')->dirindexlist_a)) {
         $this->__var_index_list = $ol;
     } else {
         $dirin = $login->getObject('genlist')->dirindexlist_a;
         $list = get_namelist_from_objectlist($dirin);
         $this->__var_index_list = lx_array_merge(array($list, $ol));
     }
     //	$this->__var_sslport = $port->sslport;
     //	if (!$this->__var_sslport) $this->__var_sslport = "7777";
     $this->__var_sslport = isset($port->sslport) ? $port->sslport : "7777";
     //	$this->__var_nonsslport = $port->nonsslport;
     //	if (!$this->__var_nonsslport) $this->__var_nonsslport = "7778";
     $this->__var_nonsslport = isset($port->nonsslport) ? $port->nonsslport : "7778";
     //	if (!$this->docroot) { $this->docroot = $this->nname; }
     //	if (!$this->corelocation) { $this->corelocation = "__path_customer_root"; }
     if (!isset($this->docroot)) {
         $this->docroot = $this->nname;
     }
     if (!isset($this->corelocation)) {
         $this->corelocation = "__path_customer_root";
     }
     $this->__var_extrabasedir = $gen->extrabasedir;
     $this->__var_dirprotect = $this->getList("dirprotect");
     if (!$this->isDeleted()) {
         if ($this->getParentO()) {
             $parent = $this->getParentO()->getParentO();
         }
         if ($parent) {
             $this->__var_disable_url = $parent->disable_url;
         }
     }
     //$dvlist = $this->getList('davuser');
     $dvlist = null;
     foreach ((array) $dvlist as $v) {
         $ndvlist[$v->directory][] = null;
     }
     //$this->__var_davuser = $ndvlist;
     $this->__var_davuser = null;
     if (!$this->customer_name) {
         if ($this->getRealClientParentO()) {
             $this->customer_name = $this->getRealClientParentO()->getPathFromName();
         }
     }
     $this->__var_railspp = $this->getList('rubyrails');
     $mydb = new Sqlite($this->__masterserver, 'ipaddress');
     $syncserver = $this->syncserver ? $this->syncserver : 'localhost';
     $string = "syncserver = '{$syncserver}'";
     $this->__var_ipssllist = $mydb->getRowsWhere($string, array('ipaddr', 'nname'));
     $this->__var_addonlist = $this->getTrueParentO()->getList('addondomain');
     if (!isset($this->__var_sysuserpassword)) {
         $this->__var_sysuserpassword['realpass'] = $this->getParentO()->realpass;
     }
     $dipdb = new Sqlite(null, "domainipaddress");
     $string = "syncserver = '{$syncserver}' ";
     $domainip = $dipdb->getRowsWhere($string, array('domain', 'ipaddr'));
     $this->__var_domainipaddress = get_namelist_from_arraylist($domainip, 'ipaddr', 'domain');
     $ipdb = new Sqlite($this->__masterserver, 'ipaddress');
     $string = "syncserver = '{$syncserver}' ";
     $iplist = $ipdb->getRowsWhere($string, array('ipaddr'));
     $this->__var_ipaddress = $iplist;
     $mydb = new Sqlite($this->__masterserver, "web");
     /* This is to ensure that the excess domainipaddress entries are filtered out.
     	$siplist = get_namelist_from_arraylist($iplist, 'ipaddr');
     	foreach($this->__var_domainipaddress as $k) {
     		if (!isset($siplist[$k])) {
     			unset($this->__var_domainipaddress[$k]);
     		}
     	}
     */
     if ($this->dbaction === 'update' && $this->subaction !== 'full_update' && $this->subaction !== 'fixipdomain') {
         return;
     }
     if ($this->dbaction === 'add') {
         $this->__var_parent_contactemail = $this->getTrueParentO()->getTrueParentO()->contactemail;
         $this->__var_clientname = $this->getTrueParentO()->getTrueParentO()->nname;
     }
     $string = "syncserver = '{$syncserver}'";
     $this->__var_vdomain_list = $mydb->getRowsWhere($string, array('nname', 'ipaddress'));
     /*
     $string = "ttype='forward' AND syncserver = '$syncserver'" ;
     $this->__var_fdomain_list = $mydb->getRowsWhere($string, array('nname'));
     */
     // new -- related to apache/lighttpd new structure
     $mmaildb = new Sqlite($this->__masterserver, 'mmail');
     $syncserver = $this->syncserver ? $this->syncserver : 'localhost';
     $string = "syncserver = '{$syncserver}'";
     $this->__var_mmaillist = $mmaildb->getRowsWhere($string, array('nname', 'parent_clname', 'webmailprog', 'webmail_url', 'remotelocalflag'));
 }
开发者ID:zseand,项目名称:kloxo,代码行数:99,代码来源:weblib.php

示例10: updateform

 function updateform($subaction, $param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     switch ($subaction) {
         case "centralbackupconfig":
             $list = $login->getList('centralbackupserver');
             $list = get_namelist_from_objectlist($list);
             $vlist['centralbackupserver'] = array('s', add_disabled($list));
             $vlist['internalnetworkip'] = null;
             $vlist['tmpdir'] = null;
             //$vlist['__v_updateall_button'] = array();
             return $vlist;
         case "commandcenter":
             return $this->commandCenter($param);
             break;
         case "timezone":
             $vlist['timezone'] = array('s', pserver::getTimeZoneList());
             return $vlist;
         case "ssl_key":
             $this->createPublicPrivate();
             $this->setUpdateSubaction();
             $vlist['text_public_key'] = array('t', null);
             return $vlist;
         case "switchprogram":
             $this->web_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'web');
             $this->dns_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'dns');
             $this->spam_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'spam');
             $vlist['web_driver'] = array('s', array('apache', 'lighttpd'));
             $vlist['dns_driver'] = array('s', array('bind', 'djbdns'));
             $vlist['spam_driver'] = array('s', array('spamassassin', 'bogofilter'));
             return $vlist;
         case "mysqlpasswordreset":
             $vlist['newpassword_f'] = null;
             return $vlist;
         case "importvps":
             $vlist['importvps'] = array('M', 'Import Vpses on this server?');
             $vlist['__v_button'] = "Import";
             return $vlist;
         case "importhypervmvps":
             $vlist['importvps'] = array('M', 'Import HyperVM Vpses on this server?');
             $vlist['__v_button'] = "Import";
             return $vlist;
         case "savevpsdata":
             $vlist['__v_button'] = "Save";
             return $vlist;
         case "information":
             $sq = new Sqlite(null, 'client');
             $res = $sq->getRowsWhere("cttype = 'wholesale'", null, array('nname'));
             $clientlist = get_namelist_from_arraylist($res);
             $vlist['description'] = null;
             $vlist['realhostname'] = null;
             if ($sgbl->isHyperVm()) {
                 $list = get_namelist_from_objectlist($login->getList('datacenter'));
                 if (!$list) {
                     $list[] = '--no-dc--';
                     $this->datacenter = '--no-dc--';
                 }
                 $vlist['datacenter'] = array('s', $list);
                 $newclientlist = lx_array_merge(array(array('--unassigned--'), $clientlist));
                 if ($this->nname === 'localhost') {
                     $vlist['clientname'] = array('M', $login->getKeyword('master_cannot_be_assigned'));
                 } else {
                     $vlist['clientname'] = array('s', $newclientlist);
                 }
             }
             if ($sgbl->isHyperVm()) {
                 $vlist['max_vps_num'] = null;
             }
             $this->setDefaultValue("load_threshold", "20");
             $vlist['load_threshold'] = null;
             return $vlist;
         case "backupconfig":
             return $vlist;
         case "phpsmtp":
             $vlist['pserverconf_b_s_usesmtp'] = null;
             $vlist['pserverconf_b_s_smtpserver'] = null;
             $vlist['pserverconf_b_s_smtpport'] = null;
             $vlist['pserverconf_b_s_smtpuseauth'] = null;
             $vlist['pserverconf_b_s_smtpuser'] = null;
             $vlist['pserverconf_b_s_smtppass'] = null;
             return $vlist;
         case "cron_mailto":
             $vlist['cron_mailto'] = null;
             return $vlist;
         case "vpslist":
             $vlist['used_vpslist_f'] = array('M', $this->getUsed());
             $vlist['__v_button'] = array();
             return $vlist;
         case "showused":
             $res = $this->createUsedDomainList();
             foreach ($res as $k => $v) {
                 $var = "used_domainlist_{$k}_f";
                 $vlist[$var] = array('M', $this->{$var});
             }
             $vlist['__v_button'] = array();
             return $vlist;
         case "update":
             $vlist['nname'] = array('M', null);
             $vlist['password'] = null;
             return $vlist;
//.........这里部分代码省略.........
开发者ID:soar-team,项目名称:kloxo,代码行数:101,代码来源:pservercorelib.php

示例11: getDomainAlist

 function getDomainAlist(&$alist)
 {
     $rd = null;
     if ($this->default_domain && !$this->isDisabled('default_domain')) {
         $d = new Domain(null, null, $this->default_domain);
         $d->get();
         if ($d->dbaction === 'clean' && $d->parent_clname === $this->getClName()) {
             $rd = $d;
         }
     }
     if (!$rd) {
         $sq = new Sqlite(null, 'domain');
         $list = $sq->getRowsWhere("parent_clname = '{$this->getClName()}'", array('nname'));
         if ($list) {
             $list = get_namelist_from_arraylist($list);
             $dname = getFirstFromList($list);
             $d = new Domain(null, null, $dname);
             $d->get();
             $rd = $d;
         }
     }
     if (!$rd) {
         return;
     }
     $this->getAlistFromChild($rd, $alist);
     try {
         $m = $this->getFromList('mailaccount', "postmaster@{$rd->nname}");
     } catch (exception $e) {
         return;
     }
     $alist['__title_mailaccount'] = "Mailaccount {$m->nname}";
     //$alist[] =   "a=addform&c=mailaccount";
     $malist = $m->createShowAlist($rslist);
     foreach ($malist as $k => $a) {
         if (csb($k, "__title")) {
             //$alist[$k] = $a;
         } else {
             if (is_string($a)) {
                 $alist[] = "j[class]=mailaccount&j[nname]={$m->nname}&{$a}";
             } else {
                 if (!csb($a->url, "http")) {
                     $a->url = "j[class]=mailaccount&j[nname]={$m->nname}&{$a->url}";
                 }
                 $alist[] = $a;
             }
         }
     }
 }
开发者ID:zseand,项目名称:kloxo,代码行数:48,代码来源:clientlib.php

示例12: backup_main

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);
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:98,代码来源:restore.php

示例13: getIpaddressList

 static function getIpaddressList($parent)
 {
     $db = new Sqlite($parent->__masterserver, 'ipaddress');
     $res = $db->getTable(array('ipaddr'));
     $res = get_namelist_from_arraylist($res, 'ipaddr');
     return $res;
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:7,代码来源:dnsbaselib.php

示例14: updateform


//.........这里部分代码省略.........
                 $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);
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:101,代码来源:vpsbaselib.php

示例15: VerifyString

 static function VerifyString($parent, $param)
 {
     $ip = $param['ipaddr'];
     if (!self::isValidIpaddress($ip)) {
         throw new lxexception("ipaddress_invalid", 'ipaddr');
     }
     if ($param['gateway']) {
         if (!self::isValidIpaddress($param['gateway'])) {
             throw new lxexception("gateway_invalid", 'gateway');
         }
     }
     if (!self::isValidIpaddress($param['netmask'])) {
         throw new lxexception("netmask_invalid", 'netmask');
     }
     $sq = new Sqlite($parent->__masterserver, "ipaddress");
     $res = $sq->getRowsWhere("syncserver = '{$parent->nname}'");
     $list = get_namelist_from_arraylist($res, "ipaddr");
     if (array_search_bool($ip, $list)) {
         throw new lxexception("ipaddress_already_configured", 'ipaddr');
     }
     $ret = lxshell_return("ping", "-n", "-c", "1", "-w", "5", $ip);
     // If the return status is 1, the ping fail and nobody uses. But if return is 0, somebody is using the IP
     if (intval($ret) !== 1) {
         throw new lxexception($ret . 'Another host is using the IP ' . $ip . ' and it is responding to the IP ping. Please you will ensure to use an available IP to add.', 'ipaddr');
     }
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:26,代码来源:ipaddresslib.php


注:本文中的get_namelist_from_arraylist函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。