|
发表于 2010-8-17 22:54:43
|
显示全部楼层
关于华为HG522中超级用户和普通用户权限级别的设置
本帖最后由 kingioi 于 2010-8-17 23:01 编辑
刚我找到一个JS文件,Userlevel="2" 代表了菜单的编号,菜单里只有数字1和2
-
- // JavaScript Document
- var curUserName = top.curUser//"<%ejGet(curUserName)%>";
- var sysUserName = '1'//"<%ejGet(sysUserName)%>";
- var sptUserName = '0'//"<%ejGet(sptUserName)%>";
- var ctcqdUserName = 'ctcqd'
- var bandRegName = 'regAcc';
- var usrUserName = 0//"<%ejGet(usrUserName)%>";
- var iCount = 0;
- var MenuArray = new Array();
- if (curUserName == sptUserName || curUserName == sysUserName || curUserName == ctcqdUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "状态", "../status/deviceinfo.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "设备信息", "../status/deviceinfo.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "网络侧信息", "../status/network.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "用户侧信息", "../status/user.asp", "");
- }
- if(curUserName == ctcqdUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(2, "远程管理信息", "../status/acs.asp", "");
- }
- if (curUserName == sptUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "网络", "../network/wan1.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "宽带设置", "../network/wan1.asp", "");
- }
- if (curUserName == sysUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "网络", "../network/wlan.asp", "");
- }
- if (curUserName == sptUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(2, "DHCP配置", "../network/dhcp.asp", "");
- }
- if (curUserName == sptUserName || curUserName == sysUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(2, "WLAN配置", "../network/wlan.asp", "");
- }
- if (curUserName == sptUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(2, "远程管理", "../network/tr069.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "QoS", "../network/qos.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "时间管理", "../network/sntp.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "路由配置", "../network/route.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "线路设置", "../network/dsl.asp", "");
- }
- if (curUserName == sptUserName || curUserName == sysUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "安全", "../security/urlfilter.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "广域网访问设置", "../security/urlfilter.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "防火墙", "../security/firewall.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "MAC过滤", "../security/macfilter.asp", "");
- }
- if (curUserName == sptUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(2, "端口过滤", "../security/portfilter.asp", "");
- }
- if (curUserName == sptUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "应用", "../application/ddns.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "DDNS配置", "../application/ddns.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "高级NAT配置", "../application/adnat.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "UPNP配置", "../application/upnp.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "IGMP设置", "../application/igmp.asp", "");
- }
- else if(curUserName == sysUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "应用", "../application/daily.asp", "");
- }
- if (curUserName == sptUserName || curUserName == sysUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(2, "日常应用", "../application/daily.asp", "");
- }
- if (curUserName == sptUserName || curUserName == sysUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "管理", "../management/account.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "用户管理", "../management/account.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "设备管理", "../management/reset.asp", "");
- }
- if (curUserName == sptUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(2, "日志文件管理", "../management/syslog.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "维护", "../management/diagnose.asp", "");
- }
- if(curUserName == ctcqdUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "网络", "../network/dslNegotiate.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "线路设置", "../network/dslNegotiate.asp", "");
- }
- if(curUserName == ctcqdUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "诊断", "../management/quickdiagnose.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "网络诊断", "../management/quickdiagnose.asp", "");
- }
- if (curUserName == sptUserName || curUserName == sysUserName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "帮助", "../help/help.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "使用帮助", "../help/help.asp", "");
- }
- if (curUserName == bandRegName)
- {
- MenuArray[iCount++] = new MenuNodeConstruction(1, "注册", "../ehomeclient/bandReg.asp", "");
- MenuArray[iCount++] = new MenuNodeConstruction(2, "业务注册", "../ehomeclient/bandReg.asp", "");
- }
- MenuArray[iCount++] = new MenuNodeConstruction(0, "", "", "");
- function MenuNodeConstruction(Level, Text, Link, Target)
- {
- this.Level = Level;
- this.Text = Text;
- this.Link = Link;
- this.Target = Target;
- }
- function MakeMenu(Selected_Menu)
- {
- var Menu = Selected_Menu.split("->");
- MakeMenu_L2(Menu[1], MakeMenu_L1(Menu[0]));
- }
- function MakeMenu_L1(Menu_Text)
- {
- var Menu_L2_Start;
- var Code = '<table border="0" cellpadding="0" cellspacing="0" height="43px">';
- for (iCount = 0; MenuArray[iCount].Level != 0; iCount++)
- {
- if (MenuArray[iCount].Level == 1)
- {
- if (MenuArray[iCount].Text != Menu_Text)
- {
- Code += '<td height="17px"><img src="../../images/back_button.jpg"></td>';
- }
- else
- {
- Menu_L2_Start = iCount + 1;
- Code += '<td height="17px"><img src="../../images/selected_button.jpg"></td>';
- }
- }
- }
- Code += '</tr><tr>';
- for (iCount = 0; MenuArray[iCount].Level != 0; iCount++)
- {
- var str = 'LoadPage(\'' + iCount + '\')';
- if (MenuArray[iCount].Level == 1)
- {
- if (MenuArray[iCount].Text != Menu_Text)
- {
- Code += '<td bgcolor="#EF8218" height="30px"><a href="javascript:' + str + '" target="' + MenuArray[iCount].Target + '" class="Menu_L1_Link"><p align="center">' + MenuArray[iCount].Text + '</p></a></td>';
- }
- else
- {
- Code += '<td bgcolor="#427594" height="30px"><a href="javascript:' + str + '" target="' + MenuArray[iCount].Target + '" class="Menu_L1_Active"><p align="center">' + MenuArray[iCount].Text + '</p></a></td>';
- }
- }
- }
- Code += '</tr></table>';
- getElement('MenuArea_L1').innerHTML = Code;
- return Menu_L2_Start;
- }
- function LoadPage(strIndex)
- {
- var index = parseInt(strIndex);
- location = MenuArray[index].Link;;
- }
- function MakeMenu_L2(Menu_Text, Start)
- {
- var Code = '<table border="0" cellpadding="0" cellspacing="0" height="15px"><tr><td width="10px"><td width="7px" class="Menu_L2_Link"><p>|</p></td>';
- for (iCount = Start; (MenuArray[iCount].Level != 0) && (MenuArray[iCount].Level != 1); iCount++)
- {
- var str = 'LoadPage(\'' + iCount + '\')';
- if (MenuArray[iCount].Level == 2)
- {
- if (MenuArray[iCount].Text != Menu_Text)
- {
- Code += '<td height="30px"><p align="center"><a href="javascript:' + str + '" target="' + MenuArray[iCount].Target + '" class="Menu_L2_Link"><p> ' + MenuArray[iCount].Text + ' </p></a></td>';
- }
- else
- {
- Code += '<td height="30px"><p align="center"><a href="javascript:' + str + '" target="' + MenuArray[iCount].Target + '" class="Menu_L2_Active"><p> ' + MenuArray[iCount].Text + ' </p></a></td>';
- }
- Code += '<td width="7px" class="Menu_L2_Link"><p>|</p></td>';
- }
- }
- Code += '</tr></table>';
- getElement('MenuArea_L2').innerHTML = Code;
- }
- function DisplayLocation(Selected_Menu)
- {
- var Menu = Selected_Menu.split("->");
- getElement('LocationDisplay').innerHTML = Menu[0];
- }
复制代码 |
|