Example #1
0
echo $_SESSION['#NME'];
?>
</p>
         <ul id="top-navigation">
			<li class="active" onclick="hfwin(this,0);"><span><span>主页</span></span></li>
			<?php 
if (Gants(0) || Gants(4)) {
    echo '<li onclick="hfwin(this,2);"><span><span>节点列表</span></span></li>';
}
if (Gants(0) || Gants(3)) {
    echo '<li onclick="hfwin(this,3);"><span><span>配置列表</span></span></li>';
}
if (Gants(0) || Gants(2)) {
    echo '<li onclick="hfwin(this,4);"><span><span>日志列表</span></span></li>';
}
if (Gants(0)) {
    echo '<li onclick="hfwin(this,1);"><span><span>用户管理</span></span></li>';
}
?>
			<li onclick="LoginOut();"><span><span>退&nbsp;出</span></span></li>
		</ul>
	</div>
	
<div id="middle"></div>
<div id="footer"></div>
<script language="javascript">
   var FnLst=$.dialog({
     id: 'filelist',
     max: false,
//     cancel: false,
     title:'文件列表',
Example #2
0
function CmdType($cmds)
{
    $spin = explode('|', $cmds);
    $n = count($spin);
    if ($n >= 2) {
        $id = (int) $spin[1];
    } else {
        $id = 0;
    }
    switch ($spin[0]) {
        case 'nodeoff':
            //禁用节点
            if (Gants(0) || Gants(8)) {
                if ($id > 0 && $n > 2) {
                    $hstr = chste($id, 0, 'node');
                    echo $hstr . "" . $spin[2] . "<span class='act_off'  onclick='hfwprint(\"nodeon|{$id}|ste{$id}\")'>未启用</span>";
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'nodeon':
            //启用节点
            if (Gants(0) || Gants(8)) {
                if ($id > 0 && $n > 2) {
                    $hstr = chste($id, 1, 'node');
                    echo $hstr . "" . $spin[2] . "<span class='act_on'  onclick='hfwprint(\"nodeoff|{$id}|ste{$id}\")'>已启用</span>";
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'useroff':
            //禁用用户
            if (Gants(0)) {
                if ($id > 0 && $n > 2) {
                    $hstr = chste($id, 0, 'urmgt');
                    echo $hstr . "" . $spin[2] . "<span class='act_off'  onclick='hfwprint(\"useron|{$id}|ste{$id}\")'>未启用</span>";
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'useron':
            //启用用户
            if (Gants(0)) {
                if ($id > 0 && $n > 2) {
                    $hstr = chste($id, 1, 'urmgt');
                    echo $hstr . "" . $spin[2] . "<span class='act_on'  onclick='hfwprint(\"useroff|{$id}|ste{$id}\")'>已启用</span>";
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'cnfoff':
            //禁用文件
            if (Gants(0) || Gants(7)) {
                if ($id > 0 && $n > 2) {
                    $hstr = chste($id, 0, 'confs');
                    echo $hstr . "" . $spin[2] . "<span class='act_off'  onclick='hfwprint(\"cnfon|{$id}|ste{$id}\")'>已禁用</span>";
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'cnfon':
            //启用文件
            if (Gants(0) || Gants(7)) {
                if ($id > 0 && $n > 2) {
                    $hstr = chste($id, 1, 'confs');
                    echo $hstr . "" . $spin[2] . "<span class='act_on'  onclick='hfwprint(\"cnfoff|{$id}|ste{$id}\")'>已启用</span>";
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'flst':
            if ($id > 0) {
                FileTab($id);
            } else {
                echo "errorflst-id";
            }
            break;
            //文件列表
        //文件列表
        case 'nodeinfo':
            //节点信息
            if (Gants(0) || Gants(4)) {
                if ($id > 0) {
                    $hstr = HwSel("select id,nme,ip,port,hkey,ste,act,dte,tag from node_tab where id={$id}", 'nodeinfo');
                    if (empty($hstr)) {
                        echo "errornodeinfo";
                    } else {
                        echo $hstr;
                    }
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'confinfo':
            //配置文件详细
            if (Gants(0) || Gants(3)) {
                $nodes = HwSel("select id,nme from node_tab where ste=1");
                //节点列表
                if (empty($nodes)) {
                    $nodes = "error";
                }
                if ($id > 0) {
                    $hstr = HwSel("select id,file,node,ste,dte,tag,nme from file_tab where id={$id}", 'confinfo');
                    if (empty($hstr)) {
                        echo "errorconfinfo";
                    } else {
                        echo $hstr . "" . $nodes;
                    }
                } else {
                    echo "confinfonull" . $nodes;
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'confopt':
            //配置选项列表
            if (Gants(0) || Gants(3)) {
                if ($id > 0) {
                    $options = HwSel("select id,nkey,var,son from conf_tab where fid={$id} order by id desc", 'confopt');
                    //配置选项列表
                    if (empty($options)) {
                        $options = "error";
                    } else {
                        echo $options . "{$id}" . HwSel("select nme,file from file_tab where id={$id}");
                    }
                } else {
                    echo 'error-id';
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        case 'deloption':
            //删除配置项
            if (Gants(0) || Gants(7)) {
                $id = preg_replace('/[^0-9]/', '', HGT('info'));
                if (!empty($id)) {
                    if (HwExec("delete from conf_tab where id={$id}")) {
                        echo "success{$id}";
                        WebCenterLogs('删除配置项', 'conf_tab ID=' . $id);
                    } else {
                        echo 'error-sql';
                    }
                } else {
                    echo 'error-id';
                }
            } else {
                echo "error-gants0";
                exit(0);
            }
            break;
        default:
            echo "errorcmd";
            break;
    }
}