本文整理汇总了PHP中fix_nname_to_be_variable函数的典型用法代码示例。如果您正苦于以下问题:PHP fix_nname_to_be_variable函数的具体用法?PHP fix_nname_to_be_variable怎么用?PHP fix_nname_to_be_variable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fix_nname_to_be_variable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doUpdate
static function doUpdate($list)
{
$cmd = self::getYumCommand();
$file = fix_nname_to_be_variable($cmd);
$file = "__path_program_root/cache/{$file}";
lxshell_return("yum", "-y", "install", implode(" ", $list));
lunlink($file);
}
示例2: doUpdate
static function doUpdate($list)
{
$cmd = self::getYumCommand();
$file = fix_nname_to_be_variable(implode(" ", $cmd));
$file = "__path_program_root/cache/{$file}";
$plist = implode(" ", $list);
while (true) {
system("up2date --nox --install --nosig {$plist}", $return_value);
if (!$return_value) {
break;
}
dprint("Got error from up2date...\n");
}
lunlink($file);
}
示例3: getListVersion
static function getListVersion($syncserver, $list)
{
$list[]['componentname'] = 'mysql';
$list[]['componentname'] = 'perl';
//$list[]['componentname'] = 'postgresql';
$list[]['componentname'] = 'httpd';
$list[]['componentname'] = 'qmail';
$list[]['componentname'] = 'courier-imap-toaster';
$list[]['componentname'] = 'php';
$list[]['componentname'] = 'lighttpd';
$list[]['componentname'] = 'djbdns';
$list[]['componentname'] = 'bind';
$list[]['componentname'] = 'spamassassin';
$list[]['componentname'] = 'pure-ftpd';
foreach ($list as $l) {
$nlist[] = $l['componentname'];
}
$complist = implode(" ", $nlist);
$file = fix_nname_to_be_variable("rpm -q {$complist}");
$file = "__path_program_root/cache/{$file}";
$cmdlist = lx_array_merge(array(array("rpm", "-q"), $nlist));
$val = get_with_cache($file, $cmdlist);
$res = explode("\n", $val);
$ret = null;
foreach ($list as $k => $l) {
$name = $list[$k]['componentname'];
$sing['nname'] = $name . "___" . $syncserver;
$sing['componentname'] = $name;
$sing['version'] = self::getVersion($res, $name);
$status = strstr($sing['version'], "not installed");
$sing['status'] = $status ? 'off' : 'on';
/*
if (isOn($sing['status'])) {
$sing['full_version'] = `rpm -qi $name`;
} else {
$sing['full_version'] = $sing['version'];
}
*/
$ret[] = $sing;
}
return $ret;
}
示例4: syncSpamUserPref
function syncSpamUserPref()
{
global $gbl, $sgbl, $ghtml;
// The parent can be either a domain or a user. CHeck for the @ sign.
if (csa($this->main->nname, "@")) {
list($user, $domain) = explode("@", $this->main->nname);
} else {
$domain = $this->main->nname;
$user = null;
}
$sysuser = mmail__qmail::getUserGroup($domain);
// --- issue #578/#721 - missing in version 6.1.6
// $mailpath = "/home/lxadmin/mail";
$mailpath = mmail__qmail::getDir($domain);
if ($user) {
// $prefpath = "$mailpath/domains/{$domain}/{$user}/.bogopref.cf";
$prefpath = "{$mailpath}/{$user}/.bogopref.cf";
} else {
return;
}
$prefdir = dirname($prefpath);
if (!lxfile_exists(dirname($prefpath))) {
lxuser_mkdir($sysuser, dirname($prefpath));
}
$wname = fix_nname_to_be_variable($this->main->nname);
$fdata = null;
$cutoff = $this->main->spam_hit / 10 + 0.2;
$fdata .= "spam_cutoff {$cutoff}\n";
$fdata .= "spam_subject_tag={$this->main->subject_tag}\n";
$fdata .= "wordlist R,user,{$wname}.wordlist.db,1\n";
$fdata .= "wordlist R,system,wordlist.db,2\n";
$fdata .= "wordlist R,system,kloxo.wordlist.db,3\n";
lxuser_put_contents($sysuser, $prefpath, $fdata);
if (!lxfile_real("/var/bogofilter/{$wname}.wordlist.db")) {
new_process_cmd($sysuser, null, "bogofilter -d /var/bogofilter/ --wordlist=R,user,{$wname}.wordlist.db,1 -n < /etc/my.cnf");
}
lxfile_touch("/var/bogofilter/wordlist.db");
// Using generic because spamassasin is used on windows too. Or at least can be used.
//lxfile_generic_chown("/var/bogofilter", mmail__qmail::getUserGroup($domain));
}
示例5: do_resource
function do_resource($tree, $object, $depth, $alistflag, $func, $complex = true, $showurlflag = true)
{
global $gbl, $sgbl, $login, $ghtml;
static $scriptdone;
if (!$scriptdone && $complex) {
print "<link href=/htmllib/js/tree/dtree.css rel=stylesheet type=text/css>\n";
$ghtml->print_jscript_source("/htmllib/js/tree/dtree.js");
$scriptdone = true;
}
$treename = "_" . fix_nname_to_be_variable($object->nname);
?>
<table width=90% cellpadding=0 cellspacing=0 valign=top>
<tr>
<td valign=top align=left>
<?php
if ($complex) {
print "<div class='dtree'>";
print "<script>";
print "{$treename} = new dTree('{$treename}');";
print "</script>";
}
$val = -1;
if (!$tree) {
$tree = $this->print_resource(null, $object, $ghtml->frm_o_o, $object, $depth, $alistflag, $func, false, $showurlflag);
}
if ($complex) {
print "<script>";
if (isset($gbl->__tmp_checkbox_value)) {
print "var __treecheckboxcount = {$gbl->__tmp_checkbox_value};";
}
}
$total = -1;
print_time('tree');
$this->print_tree($treename, $tree, $total, $val, $complex);
if ($complex) {
print "document.write({$treename});";
print "</script>";
print "</div>";
}
print_time('tree', "Tree", 2);
?>
</td>
</tr>
</table>
<form name=__treeForm id=__treeForm method=<?php
echo "get";
?>
action="/display.php">
<input type=hidden name=frm_accountselect value="">
<?php
$this->print_current_input_vars(array('frm_action', 'frm_subaction'));
if (cse($ghtml->frm_subaction, "confirm_confirm")) {
$this->print_input("hidden", "frm_action", "update");
$sub = $this->frm_subaction;
$actionimg = "finish.gif";
} else {
$this->print_input("hidden", "frm_action", "updateform");
$sub = $this->frm_subaction . "_confirm";
$actionimg = "next.gif";
}
$this->print_input("hidden", "frm_subaction", "{$sub}");
if (isset($gbl->__tmp_checkbox_value)) {
print "<a href=javascript:treeStoreValue()> <img src=/img/general/button/{$actionimg}> </a>";
}
print "</form>";
}
示例6: getSslCertnameFromIP
static function getSslCertnameFromIP($ipname)
{
return fix_nname_to_be_variable($ipname);
}
示例7: fix_mysql_root_password
function fix_mysql_root_password($server)
{
global $gbl, $sgbl, $login, $ghtml;
$pass = $login->password;
$pass = fix_nname_to_be_variable($pass);
$pass = substr($pass, 3, 11);
$dbadmin = new Dbadmin(null, $server, "mysql___{$server}");
$dbadmin->get();
if ($dbadmin->dbaction === 'add') {
$dbadmin->syncserver = $server;
$dbadmin->ttype = 'mysql';
$dbadmin->dbtype = 'mysql';
$dbadmin->dbadmin_name = 'root';
$dbadmin->parent_clname = createParentName("pserver", $server);
$dbadmin->write();
$dbadmin->get();
$dbadmin->dbaction = 'clean';
}
if ($dbadmin->dbpassword) {
dprint("Mysql Password is not null\n");
return;
}
$dbadmin->dbpassword = $pass;
$dbadmin->setUpdateSubaction('update');
try {
$dbadmin->was();
} catch (exception $e) {
}
}
示例8: add
static function add($parent, $class, $param)
{
if (!($parent->isClass('pserver') || $parent->priv->isOn('cron_minute_flag'))) {
if (!is_numeric($param['minute'])) {
$param['minute'] = 0;
}
}
$param['username'] = $parent->username;
/*
if ($parent->is__table('pserver')) {
$param['syncserver'] = $parent->nname;
} else {
$param['syncserver'] = $parent->syncserver;
}
*/
$parambase = implode("_", array($param['username'], $param['command']));
$parambase = fix_nname_to_be_variable($parambase);
$cronlist = $parent->getList('cron');
$count = 0;
while (isset($cronlist[$parambase . "_" . $count])) {
$count++;
}
$param['nname'] = $parambase . "_" . $count;
return $param;
}
示例9: set_class_variable
function set_class_variable($class, $var, $val)
{
$var = fix_nname_to_be_variable($var);
$class = ucfirst($class);
$variable = "{$class}::\$" . $var;
return eval(" {$variable} = \$val ; ");
}
示例10: __ac_desc_resource
function __ac_desc_resource($object)
{
global $gbl, $sgbl, $login, $ghtml;
$sgbl->__var_main_resource = true;
$treename = fix_nname_to_be_variable($object->nname);
?>
<!-- Resource Description -->
<table valign="top">
<tr align="left">
<td width="10">
<input class="submitbutton" onClick='<?php
echo $treename;
?>
.closeAll();' type="button" value="Close">
</td>
<td align="left" width="10">
<input class="submitbutton" onClick='<?php
echo $treename;
?>
.openAll();' type="button" value="Open">
</td>
<td width="100%"> </td>
</tr>
</table>
<?php
$ghtml->do_full_resource($object, 0, false);
}
示例11: getFilterVariableForThis
function getFilterVariableForThis($class)
{
$filtervar = "__filtervar_{$class}";
if (isset($this->{$filtervar})) {
return $this->{$filtervar};
}
$name = fix_nname_to_be_variable($this->nname);
$id = "{$this->get__table()}_{$name}__{$class}";
$this->{$filtervar} = $id;
return $id;
}
示例12: add
static function add($parent, $class, $param)
{
if (!($parent->isClass('pserver') || $parent->priv->isOn('cron_minute_flag'))) {
if (!is_numeric($param['minute'])) {
$param['minute'] = 0;
}
}
$param['username'] = $parent->username;
/*
if ($parent->is__table('pserver')) {
$param['syncserver'] = $parent->nname;
} else {
$param['syncserver'] = $parent->syncserver;
}
*/
$parambase = implode("_", array($param['username'], $param['command']));
if (!$parent->priv->isOn('cron_shell_flag')) {
if (!(substr($param['command'], 0, 5) === "wget ") && !(substr($param['command'], 0, 4) === "php ")) {
throw new lxException("command_not_allowd", '', '');
}
}
$parambase = fix_nname_to_be_variable($parambase);
$cronlist = $parent->getList('cron');
$count = 0;
while (isset($cronlist[$parambase . "_" . $count])) {
$count++;
}
$param['nname'] = $parambase . "_" . $count;
return $param;
}
示例13: __ac_desc_resource
function __ac_desc_resource($object)
{
global $gbl, $sgbl, $login, $ghtml;
$sgbl->__var_main_resource = true;
$treename = fix_nname_to_be_variable($object->nname);
?>
<table valign=top > <tr align=left><td width=10><input class=submitbutton onClick='<?php
echo $treename;
?>
.closeAll();' type=button value="Close"></td> <td align=left width=10> <input class=submitbutton onClick='<?php
echo $treename;
?>
.openAll();' type=button value="Open"> </td> <td width=100%> </td> </tr></table>
<?php
$ghtml->do_full_resource($object, 0, false);
}
示例14: updateform
function updateform($subaction, $param)
{
global $gbl, $sgbl, $login, $ghtml;
$progname = $sgbl->__var_program_name;
$parent = $this->getParentO();
$tree = createTreeObject('name', null, null, null, null, null, null);
$gbl->__var_restore_tree = $tree;
if ($this->rm_username) {
$this->rm_username = fix_meta_character($this->rm_username);
}
switch ($subaction) {
case "backup":
if (trim($this->ftp_server)) {
$vlist['ftp_server'] = array('M', null);
$vlist['rm_username'] = array('M', null);
$vlist['rm_password'] = array('M', '***');
$vlist['upload_to_ftp'] = array('M', null);
} else {
$vlist['upload_to_ftp'] = array('M', "Ftp Server Not Set");
}
if (!$this->getParentO()->checkIfLockedForAction('backup')) {
if ($this->backupstage === 'doing') {
$this->backupstage = 'program_interrupted';
}
}
$this->backupstage = fix_nname_to_be_variable($this->backupstage);
$vlist['backupstage'] = array('M', null);
$vlist['backup_to_file_f'] = null;
$parent->backupExtraVar($vlist);
$vlist['__v_button'] = 'Backup Now';
return $vlist;
case "restore_confirm":
$gbl->__var_tmp_disabled_flag = false;
if ($param) {
$this->backupcheckForConsistency($tree, $param);
}
$vlist['__v_childheir'] = '__var_backup';
$vlist['__v_showcheckboxflag'] = true;
if ($sgbl->isDebug()) {
$vlist['__v_resourcefunc'] = "getBackupChildList";
} else {
$vlist['__v_resourcefunc'] = "getDisplayBackupChildList";
}
$vlist['__v_param'] = $param;
$vlist['__v_button'] = 'Restore Now';
print_time("restore_process", "Restore Processing Took");
return $vlist;
case "restore_confirm_confirm":
$gbl->__var_tmp_disabled_flag = true;
print_time("restore_process");
if ($param) {
$this->backupcheckForConsistency($tree, $param);
}
$vlist['__v_childheir'] = '__var_backup';
if ($sgbl->isDebug()) {
$vlist['__v_resourcefunc'] = "getBackupChildList";
} else {
$vlist['__v_resourcefunc'] = "getDisplayBackupChildList";
}
$vlist['__v_showcheckboxflag'] = true;
$vlist['__v_param'] = $param;
$vlist['__v_button'] = 'Restore Now';
print_time("restore_process", "Restore Processing Took");
return $vlist;
case "schedule_conf":
if ($parent->isSimpleBackup()) {
$sched = array('disabled', 'weekly', 'monthly');
} else {
$sched = array('disabled', 'daily', 'weekly', 'monthly');
}
if (!$this->backupschedule_type) {
$this->backupschedule_type = 'disabled';
}
if ($this->priv->isOn('backupschedule_flag')) {
$vlist['backupschedule_type'] = array('s', $sched);
} else {
$vlist['backupschedule_type'] = array('M', 'Disabled');
}
$vlist['rm_last_number'] = null;
$vlist['__v_updateall_button'] = array();
break;
case "ftp_conf":
$vlist['ftp_server'] = null;
$vlist['rm_username'] = null;
$vlist['rm_password'] = array('m', get_star_password());
$vlist['rm_directory'] = null;
$vlist['upload_to_ftp'] = null;
$vlist['upload_type'] = array('M', 'ftp');
$vlist['no_local_copy_flag'] = null;
$vlist['dont_verify_ftp_f'] = null;
$vlist['__v_updateall_button'] = array();
break;
case "restore_from_ftp":
if (!$this->ftp_server) {
$vlist['ftp_server'] = array("M", "Ftp Server is Not Set");
break;
}
$vlist['ftp_server'] = array('M', null);
$vlist['rm_username'] = array('M', null);
$vlist['rm_password'] = array('M', "****");
//.........这里部分代码省略.........
示例15: printSelectObjectTable
function printSelectObjectTable($name_list, $parent, $class, $blist = array(), $display = null)
{
global $gbl, $sgbl, $login, $ghtml;
print_time("{$class}.objecttable");
if ($this->frm_accountselect !== null) {
$sellist = explode(',', $this->frm_accountselect);
} else {
$sellist = null;
}
$classdesc = $this->get_class_description($class, $display);
$unique_name = trim($parent->nname) . trim($class) . trim($display) . trim($classdesc[2]);
$unique_name = fix_nname_to_be_variable($unique_name);
$filtername = $parent->getFilterVariableForThis($class);
$fil = $this->frm_hpfilter;
$sortdir = null;
$sortby = null;
if (isset($fil[$filtername]['sortby'])) {
$sortby = $fil[$filtername]['sortby'];
}
if (isset($fil[$filtername]['sortdir'])) {
$sortdir = $fil[$filtername]['sortdir'];
}
$pagesize = '99999';
$iconpath = get_image_path() . "/button";
$nlcount = count($name_list) + 1;
$imgheadleft = $login->getSkinDir() . "/top_lt.gif";
$imgheadleft2 = $login->getSkinDir() . "/top_lt.gif";
$imgheadright = $login->getSkinDir() . "/top_rt.gif";
$imgheadbg = $login->getSkinDir() . "/top_bg.gif";
$imgbtnbg = $login->getSkinDir() . "/btn_bg.gif";
$imgtablerowhead = $login->getSkinDir() . "/tablerow_head.gif";
$imgtablerowheadselect = $login->getSkinDir() . "/top_line_medium.gif";
$imgbtncrv = $login->getSkinDir() . "/btn_crv.gif";
$imgtopline = $login->getSkinDir() . "/top_line.gif";
$classdesc = $this->get_class_description($class);
$unique_name = trim($parent->nname) . trim($class) . trim($classdesc[2]);
$unique_name = fix_nname_to_be_variable($unique_name);
//dprint("-- ".$unique_name. " --", 2);
?>
<br />
<script> var ckcount<?php
echo $unique_name;
?>
; </script>
<?php
$tsortby = $sortby;
if (!$sortby) {
$tsortby = exec_class_method($class, "defaultSort");
}
if (!$sortdir) {
$sortdir = exec_class_method($class, "defaultSortDir");
}
//print_time("objecttable");
$obj_list = $parent->getVirtualList($class, $total_num, $tsortby, $sortdir);
//print_time("objecttable", 'objecttable');
if (!$sellist) {
//$total_num = $this->display_count($obj_list, $display) ;
}
?>
<table width=100%> <tr> <td align=center>
<table cellspacing=2 cellpadding=2 width=97% align=center>
<tr><td class=rowpoint></td><td colspan= <?php
echo $nlcount;
?>
>
<table cellpadding=0 cellspacing=0 border=0 width=100%>
<tr><td valign=bottom ></td>
<td>
<?php
if (isset($ghtml->__http_vars['frm_hpfilter'][$filtername]['pagenum'])) {
$cgi_pagenum = $ghtml->__http_vars['frm_hpfilter'][$filtername]['pagenum'];
} else {
$cgi_pagenum = 1;
}
if (!$sellist) {
$this->print_next_previous($parent, $class, "top", $cgi_pagenum, $total_num, $pagesize);
}
?>
</td>
<td align=right valign=bottom >
<?php
if (!$sellist) {
?>
<table cellpadding="0" cellspacing="0" border="0" height="27" >
<tr><td><img src="<?php
echo $imgheadleft;
?>
"></td><td nowrap valign=middle background="<?php
echo $imgheadbg;
?>
"><b><font color="#ffffff"><?php
echo get_plural($classdesc[2]);
?>
under <?php
echo $parent->display("nname");
?>
</b> <?php
//.........这里部分代码省略.........