找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 9917|回复: 3

烽火光猫HG6543C绕过无线SSID修改格式限制

[复制链接]
发表于 2020-10-4 22:28:10 | 显示全部楼层 |阅读模式
烽火HG6543C4采用默认终端配置账号密码登录(普通账号见设备背面标牌)
通过chome开发者工具(F12可打开),找个wlanBasicSettings_2G_CM.js这个文件,搜索saveApply函数,发现SSID等参数检测是通过wlcfgTestFields函数。片段信息如下:
function wlcfgTestFields(){
        else if(ssidmunidfir != "CMCC-" && areacode != "Jiangsu"){
                alert("SSID名称必须以CMCC-作为开头");
                return ;
        }
}
function saveApply(){
        var test = wlcfgTestFields();
        if (test != true) {
                return false;
        }
}
对if (test != true) {设置断点,然后点击页面保存设置,弹出告警信息确定后,程序会停在断电处,修改test变量值为true,继续脚本执行,即可绕过对SSID名称格式修改的限制。


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
发表于 2020-10-5 23:43:56 | 显示全部楼层
  1. <script language="JavaScript" type="text/javascript">

  2. var WapiFlag = '0';
  3. var aWiFiCustFlag = '0';
  4. var aWiFiSSID2GInst = '';
  5. var wifiPasswordMask='1';
  6. var CfgMode ='HUBCMCC_RMS';
  7. var CurrentBin = 'CMCC';
  8. var curUserType='0';
  9. var MngtJsCmcc = '0';
  10. var TianyiFlag = '0';
  11. var wep1password;
  12. var wpapskpassword;
  13. var radiuspassword;
  14. var wep1PsdModFlag = false;
  15. var pskPsdModFlag = false;
  16. var radPsdModFlag = false;

  17. var g_flags = new Array();
  18. g_flags[0] = 0;
  19. g_flags[1] = 0;
  20. g_flags[2] = 0;
  21. var desc_show = "点击显示密码";
  22. var desc_hide = "点击隐藏密码";

  23. function GetLanguageDesc(Name)
  24. {
  25.     return cfg_wlancfgdetail_language[Name];
  26. }

  27. var wlanpage;
  28. if (location.href.indexOf("e8cWlanBasic.asp?") > 0)
  29. {
  30. wlanpage = location.href.split("?")[1];
  31. top.WlanBasicPage = wlanpage;
  32. }

  33. wlanpage = top.WlanBasicPage;


  34. function ShowOrHideText(flag, checkBoxId, passwordId, textId, value)
  35. {
  36.     if (1 == g_flags[flag])
  37.     {
  38. getElById(checkBoxId).innerHTML = desc_show;
  39.         setDisplay(passwordId, 1);
  40.         setDisplay(textId, 0);
  41. g_flags[flag] = 0;
  42.     }
  43.     else
  44.     {
  45. getElById(checkBoxId).innerHTML = desc_hide;
  46.         setDisplay(passwordId, 0);
  47.         setDisplay(textId, 1);
  48. g_flags[flag] = 1;
  49.     }
  50. }

  51. function stWlan(domain,name,enable,ssid,BeaconType,BasicEncryptionModes,BasicAuthenticationMode,
  52.                 KeyIndex,EncryptionLevel,WPAEncryptionModes,WPAAuthenticationMode,IEEE11iEncryptionModes,IEEE11iAuthenticationMode,
  53.                 X_HW_WPAand11iEncryptionModes,X_HW_WPAand11iAuthenticationMode,RadiusServer,RadiusPort,RadiusKey,X_HW_ServiceEnable, LowerLayers,
  54. X_HW_WAPIEncryptionModes,X_HW_WAPIAuthenticationMode,X_HW_WAPIServer,X_HW_WAPIPort)
  55. {
  56.     this.domain = domain;
  57.     this.name = name;
  58.     this.enable = enable;
  59.     this.ssid = ssid;
  60.     this.BeaconType = BeaconType;
  61.     this.BasicEncryptionModes = BasicEncryptionModes;
  62.     this.BasicAuthenticationMode = BasicAuthenticationMode;
  63.     this.KeyIndex = KeyIndex;
  64.     this.EncypBit = EncryptionLevel;
  65.     this.WPAEncryptionModes = WPAEncryptionModes;
  66.     this.WPAAuthenticationMode = WPAAuthenticationMode;
  67.     this.IEEE11iEncryptionModes = IEEE11iEncryptionModes;
  68.     this.IEEE11iAuthenticationMode = IEEE11iAuthenticationMode;
  69.     this.X_HW_WPAand11iEncryptionModes = X_HW_WPAand11iEncryptionModes;
  70.     this.X_HW_WPAand11iAuthenticationMode = X_HW_WPAand11iAuthenticationMode;
  71.     this.RadiusServer = RadiusServer;
  72.     this.RadiusPort = RadiusPort;
  73.     this.RadiusKey = RadiusKey;
  74. this.X_HW_ServiceEnable = X_HW_ServiceEnable;
  75. this.LowerLayers = LowerLayers;
  76. this.X_HW_WAPIEncryptionModes = X_HW_WAPIEncryptionModes;
  77. this.X_HW_WAPIAuthenticationMode = X_HW_WAPIAuthenticationMode;
  78. this.X_HW_WAPIServer = X_HW_WAPIServer;
  79. this.X_HW_WAPIPort = X_HW_WAPIPort;
  80. }


  81. function stWEPKey(domain, value)
  82. {
  83.     this.domain = domain;
  84.     this.value = value;
  85. }

  86. function stPreSharedKey(domain, value)
  87. {
  88.     this.domain = domain;
  89.     this.value = value;
  90. }

  91. function stMaxWLAN(idx, lang)
  92. {
  93.     this.MAX_ID = idx;
  94.     this.MAX_ID_LANG = lang;
  95. }

  96. function stIndexMapping(index,portIndex)
  97. {
  98.     this.index = index;
  99.     this.portIndex = portIndex;
  100. }

  101. function stWlanWifi(domain,name,enable,ssid,mode,channel,power,Country,AutoChannelEnable,channelWidth)
  102. {
  103.     this.domain = domain;
  104.     this.name = name;
  105.     this.enable = enable;
  106.     this.ssid = ssid;
  107.     this.mode = mode;
  108.     this.channel = channel;
  109.     this.power = power;
  110.     this.RegulatoryDomain = Country;
  111.     this.AutoChannelEnable = AutoChannelEnable;
  112.     this.channelWidth = channelWidth;
  113. }


  114. var WlanWifiArr = new Array(new stWlanWifi("InternetGatewayDevice\x2eLANDevice\x2e1\x2eWLANConfiguration\x2e1","ath0","1","CMCC\x2dSheenHome","11bgn","0","80","CN","1","1"),null);
  115. var WlanWifi = WlanWifiArr[0];
  116. if (null == WlanWifi)
  117. {
  118. WlanWifi = new stWlanWifi("","","","","11n","","","","","");
  119. }

  120. var enbl = '1';

  121. var Wlan = new Array();

  122. var WlanArr = new Array(new stWlan("InternetGatewayDevice\x2eLANDevice\x2e1\x2eWLANConfiguration\x2e1","ath0","1","CMCC\x2dSheenHome","WPAand11i","None","None","1","104\x2dbit","TKIPEncryption","PSKAuthentication","TKIPandAESEncryption","PSKAuthentication","AESEncryption","PSKAuthentication","192\x2e168\x2e0\x2e100","1812","\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a","1","InternetGatewayDevice\x2eLANDevice\x2e1\x2eWiFi\x2eRadio\x2e1","SMS4","WAPIPSK","192\x2e168\x2e100\x2e200","3810"),null);

  123. var wlanArrLen = WlanArr.length - 1;

  124. for (i=0; i < wlanArrLen; i++)
  125. {
  126.     Wlan[i] = new stWlan();
  127.     Wlan[i] = WlanArr[i];
  128. }

  129. var g_keys = new Array(new stWEPKey("InternetGatewayDevice\x2eLANDevice\x2e1\x2eWLANConfiguration\x2e1\x2eWEPKey\x2e1","\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a"),new stWEPKey("InternetGatewayDevice\x2eLANDevice\x2e1\x2eWLANConfiguration\x2e1\x2eWEPKey\x2e2","\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a"),new stWEPKey("InternetGatewayDevice\x2eLANDevice\x2e1\x2eWLANConfiguration\x2e1\x2eWEPKey\x2e3","\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a"),new stWEPKey("InternetGatewayDevice\x2eLANDevice\x2e1\x2eWLANConfiguration\x2e1\x2eWEPKey\x2e4","\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a"),null);
  130. if (null != g_keys)
  131. {
  132. wep1password = g_keys[0];
  133. }

  134. var wpaPskKey = new Array(new stPreSharedKey("InternetGatewayDevice\x2eLANDevice\x2e1\x2eWLANConfiguration\x2e1\x2ePreSharedKey\x2e1","\x2a\x2a\x2a\x2a\x2a\x2a\x2a\x2a"),null);

  135. var wlanMac = '78\x3a58\x3a60\x3aD4\x3aD3\x3a44';

  136. var ssidIdx = -1;
  137. var ssidAccessAttr = 'Subscriber';
  138. var AddFlag = true;
  139. var currentWlan = new stWlan();
  140. var maxSingleWLAN     = new stMaxWLAN(4,'four');
  141. var maxDoubleWLAN     = new stMaxWLAN(8,'eight');

  142. function getWlanPortNumber(name)
  143. {
  144.     var length = name.length;
  145.     var number;
  146.     var str = parseInt(name.charAt(length-1));
  147.     return str;
  148. }

  149. var uiFirstRecordFor5G = 0;
  150. var RecordFor5G = 0;
  151. var flag5Ghide = 0;
  152. function FirstRecordFor5G()
  153. {
  154. if ((1 == DoubleFreqFlag) && ("5G" == wlanpage))
  155. {
  156. for (var loop = 0; loop < WlanMap.length; loop++)
  157. {
  158. if (WlanMap[loop].portIndex > 3)
  159. {
  160. uiFirstRecordFor5G = parseInt(getIndexFromPort(WlanMap[loop].portIndex));
  161. WlanWifi = WlanWifiArr[uiFirstRecordFor5G];
  162. RecordFor5G = loop;
  163. break;
  164. }
  165. }
  166. }
  167. }

  168. var uiFirstRecordFor2G = 0;
  169. var RecordFor2G = 0;
  170. function FirstRecordFor2G()
  171. {
  172. if ((1 == DoubleFreqFlag) && ("2G" == wlanpage))
  173. {
  174. for (var loop = 0; loop < WlanMap.length; loop++)
  175. {
  176. if (WlanMap[loop].portIndex < 4)
  177. {
  178. uiFirstRecordFor2G = parseInt(getIndexFromPort(WlanMap[loop].portIndex));
  179. WlanWifi = WlanWifiArr[uiFirstRecordFor2G];
  180. RecordFor2G = loop;
  181. break;
  182. }
  183. }
  184. }
  185. }

  186. var uiTotal2gNum = 0;
  187. var uiTotal5gNum = 0;
  188. var uiTotalNum = 0;
  189. function Total2gNum()
  190. {
  191. uiTotal2gNum = 0;
  192. uiTotal5gNum = 0;
  193. uiTotalNum = Wlan.length;

  194. for (var loop = 0; loop < Wlan.length; loop++)
  195. {
  196. if ('' == Wlan[loop].name)
  197. {
  198. continue;
  199. }

  200. if (getWlanPortNumber(Wlan[loop].name) > 3)
  201. {
  202. uiTotal5gNum++;
  203. }
  204. else
  205. {
  206. uiTotal2gNum++;
  207. }
  208. }
  209. }
  210. var ShowISPSsidFlag = '0';

  211. var WlanMap = new Array();
  212. var j = 0;
  213. for (var i = 0; i < Wlan.length; i++)
  214. {
  215.     var index = getWlanPortNumber(Wlan[i].name);
  216.     var wlanInst = getWlanInstFromDomain(Wlan[i].domain);

  217.     if ((isSsidForIsp(wlanInst) == 1) && (1 != ShowISPSsidFlag))
  218.     {
  219.      continue;
  220.     }
  221.     else
  222.     {
  223.    WlanMap[j] = new stIndexMapping(i,index);
  224.    j++;
  225.     }
  226. }

  227. if (WlanMap.length >= 2)
  228. {
  229.     for (var i = 0; i < WlanMap.length-1; i++)
  230.     {
  231.         for( var j =0; j < WlanMap.length-i-1; j++)
  232.         {
  233.             if (WlanMap[j+1].portIndex < WlanMap[j].portIndex)
  234.             {
  235.                 var middle = WlanMap[j+1];
  236.                 WlanMap[j+1] = WlanMap[j];
  237.                 WlanMap[j] = middle;
  238.             }
  239.         }
  240.     }
  241. }

  242. function getIndexFromPort(index)
  243. {
  244.     for (var i = 0; i < WlanMap.length; i++)
  245.     {
  246.         if (index == WlanMap[i].portIndex)
  247.         {
  248.             return WlanMap[i].index;
  249.         }
  250.     }
  251. }

  252. function getPortFromIndex(index)
  253. {
  254.     for (var i = 0; i < WlanMap.length; i++)
  255.     {
  256.         if (index == WlanMap[i].index)
  257.         {
  258.             return WlanMap[i].portIndex;
  259.         }
  260.     }
  261. }

  262. function getEncryLevel(encrylevel)
  263. {
  264.     var level = '';
  265.     for (var i = 0; i < encrylevel.length; i++)
  266.     {
  267.         if (encrylevel.charAt(i) != '-')
  268.         {
  269.             level += encrylevel.charAt(i);
  270.         }
  271.         else
  272.         {
  273.             break;
  274.         }
  275.     }
  276.     return level;
  277. }

  278. var auth_none = "NONE";
  279. var auth_wep = "WEP";
  280. var auth_wpa_psk = "WPA-PSK";
  281. var auth_wpa2_psk = "WPA2-PSK";
  282. var auth_wpawpa2_psk = "WPA-PSK/WPA2-PSK";
  283. var auth_wpa = cfg_wlancfgdetail_language['amp_auth_wpa'];
  284. var auth_wpa2 = cfg_wlancfgdetail_language['amp_auth_wpa2'];
  285. var auth_wpawpa2 = cfg_wlancfgdetail_language['amp_auth_wpawpa2'];

  286. var encrypt_none = "NONE";
  287. var encrypt_open = "OPEN";
  288. var encrypt_share = "SHARE";
  289. var encrypt_both = "OPEN+SHARE";
  290. var encrypt_tkip = "TKIP";
  291. var encrypt_aes = "AES";
  292. var encrypt_tkipaes = "TKIP+AES";

  293. function addAuthModeOption()
  294. {
  295.     var len = document.forms[0].WlanAuthMode_select.options.length;   
  296.     var authMode = getSelectVal('WlanAuthMode_select');
  297.     var mode = WlanWifi.mode;
  298.    
  299.     for (i = 0; i < len; i++)
  300.     {
  301.         document.forms[0].WlanAuthMode_select.remove(0);
  302.     }

  303.     if (mode == "11n")
  304.     {
  305. document.forms[0].WlanAuthMode_select[0] = new Option(auth_none, "open");
  306. document.forms[0].WlanAuthMode_select[1] = new Option(auth_wpa_psk, "wpa-psk");
  307. document.forms[0].WlanAuthMode_select[2] = new Option(auth_wpa2_psk, "wpa2-psk");
  308. document.forms[0].WlanAuthMode_select[3] = new Option(auth_wpawpa2_psk, "wpa/wpa2-psk");
  309. document.forms[0].WlanAuthMode_select[4] = new Option(auth_wpa, "wpa");
  310. document.forms[0].WlanAuthMode_select[5] = new Option(auth_wpa2, "wpa2");
  311. document.forms[0].WlanAuthMode_select[6] = new Option(auth_wpawpa2, "wpa/wpa2");
  312.     }
  313.     else
  314.     {
  315. document.forms[0].WlanAuthMode_select[0] = new Option(auth_none, "open");
  316.         document.forms[0].WlanAuthMode_select[1] = new Option(auth_wep, "shared");
  317. document.forms[0].WlanAuthMode_select[2] = new Option(auth_wpa_psk, "wpa-psk");
  318. document.forms[0].WlanAuthMode_select[3] = new Option(auth_wpa2_psk, "wpa2-psk");
  319. document.forms[0].WlanAuthMode_select[4] = new Option(auth_wpawpa2_psk, "wpa/wpa2-psk");
  320. document.forms[0].WlanAuthMode_select[5] = new Option(auth_wpa, "wpa");
  321. document.forms[0].WlanAuthMode_select[6] = new Option(auth_wpa2, "wpa2");
  322. document.forms[0].WlanAuthMode_select[7] = new Option(auth_wpawpa2, "wpa/wpa2");
  323. if(1 == WapiFlag)
  324. {
  325. document.forms[0].WlanAuthMode_select[8] = new Option(cfg_wlancfgdetail_language['amp_auth_wapi_psk'], "wapi-psk");
  326. document.forms[0].WlanAuthMode_select[9] = new Option(cfg_wlancfgdetail_language['amp_auth_wapi'], "wapi");
  327. }
  328.     }
  329.    
  330.     setSelect('WlanAuthMode_select',authMode);
  331. }

  332. function addWapiEncryMethodOption()
  333. {
  334. var len = document.forms[0].WlanPwdMode_select.options.length;
  335. for (i = 0; i < len; i++)
  336.     {
  337.         document.forms[0].WlanPwdMode_select.remove(0);
  338.     }
  339. document.forms[0].WlanPwdMode_select[0] = new Option(cfg_wlancfgdetail_language['amp_encrypt_sms4'], "SMS4");

  340. }

  341. function addEncryMethodOption(type1,type2)
  342. {
  343.     var len = document.forms[0].WlanPwdMode_select.options.length;
  344.     var mode = WlanWifi.mode;
  345.    
  346.     for (i = 0; i < len; i++)
  347.     {
  348.         document.forms[0].WlanPwdMode_select.remove(0);
  349.     }

  350.     if ((type1 == 0) && (type2 == 0))
  351.     {
  352.     }
  353.     else if ((type1 == 0) && (type2 == 1))
  354.     {
  355.     }
  356.     else
  357.     {
  358.         if (mode == "11n")
  359.         {
  360.             document.forms[0].WlanPwdMode_select[0] = new Option(cfg_wlancfgdetail_language['amp_encrypt_aes'], "AESEncryption");   
  361.         }
  362.         else
  363.         {
  364. document.forms[0].WlanPwdMode_select[0] = new Option(cfg_wlancfgdetail_language['amp_encrypt_aes'], "AESEncryption");
  365. document.forms[0].WlanPwdMode_select[1] = new Option(cfg_wlancfgdetail_language['amp_encrypt_tkip'], "TKIPEncryption");
  366. document.forms[0].WlanPwdMode_select[2] = new Option(encrypt_tkipaes, "TKIPandAESEncryption");
  367.         }
  368.     }
  369. }

  370. function GetWepEncrypt(BasicAuthenticationMode)
  371. {
  372. if ((BasicAuthenticationMode == 'None') ||(BasicAuthenticationMode == 'OpenSystem'))
  373. {
  374. return 'OpenSystem';
  375. }
  376. else if ((BasicAuthenticationMode == 'SharedAuthentication') ||(BasicAuthenticationMode == 'SharedKey'))
  377. {
  378. return 'SharedKey';
  379. }
  380. else
  381. {
  382. return 'Both';
  383. }
  384. }

  385. function ClearPsdModFlag()
  386. {
  387.     wep1PsdModFlag = false;
  388.     pskPsdModFlag = false;
  389.     radPsdModFlag = false;
  390. }

  391. function authModeChange()
  392. {   
  393. ClearPsdModFlag();

  394.     setDisplay("wlEncryMethod",0);
  395. setDisplay("wlEncryWep",0);
  396.     setDisplay("keyInfo", 0);
  397.     setDisplay("wlRadius", 0);
  398.     setDisplay("wpaPreShareKey", 0);
  399.     setDisable("WlanPwdMode_select",0);
  400. setDisplay('wlWapi',0);

  401.     var authMode = getSelectVal('WlanAuthMode_select');      

  402.     switch (authMode)
  403.     {
  404.         case 'open':
  405.             break;

  406.         case 'shared':
  407.             var level = getEncryLevel(Wlan[ssidIdx].EncypBit);
  408.             var mode = WlanWifi.mode;              
  409.             
  410.             if (mode == "11n")
  411.             {
  412.             }
  413.             else
  414.             {
  415. setDisplay("wlEncryWep",1);
  416.                 setDisplay('keyInfo', 1);
  417.                 if (AddFlag == false)
  418.                 {
  419. setSelect('WlanWepPwd_select', GetWepEncrypt(Wlan[ssidIdx].BasicAuthenticationMode));
  420.                     setSelect('WlanKeyBit_select', parseInt(level)+24);
  421.                     setText('wlKeys1',g_keys[ssidIdx * 4].value);
  422.                     wep1password = g_keys[ssidIdx * 4].value;
  423.                     setText('twlKeys1',g_keys[ssidIdx * 4].value);
  424.                 }
  425.                 else
  426.                 {
  427. setSelect('WlanWepPwd_select', 'Both');
  428.                     setSelect('WlanKeyBit_select', 128);
  429.                     setText('wlKeys1','');
  430.                     wep1password = ''; setText('twlKeys1','');
  431.                 }
  432.             }      
  433.             break;

  434.         case 'wpa':
  435.         case 'wpa2':
  436.     case 'wpa/wpa2':
  437. setDisplay('wlEncryMethod',1);
  438. addEncryMethodOption(1,0);
  439.             setDisplay('wlRadius', 1);
  440.             if (AddFlag == false)
  441.             {
  442.                 if (authMode == 'wpa')
  443.                 {
  444.                     setSelect('WlanPwdMode_select',Wlan[ssidIdx].WPAEncryptionModes);
  445.                 }
  446.                 else if (authMode == 'wpa2')
  447.                 {
  448.                     setSelect('WlanPwdMode_select',Wlan[ssidIdx].IEEE11iEncryptionModes);
  449.                 }
  450. else
  451. {
  452.     setSelect('WlanPwdMode_select',Wlan[ssidIdx].X_HW_WPAand11iEncryptionModes);
  453. }
  454.                 setText('wlRadiusIPAddr',Wlan[ssidIdx].RadiusServer);
  455.                 setText('wlRadiusPort',Wlan[ssidIdx].RadiusPort);
  456.                 setText('wlRadiusKey',Wlan[ssidIdx].RadiusKey);
  457. radiuspassword = Wlan[ssidIdx].RadiusKey;
  458. setText('twlRadiusKey',Wlan[ssidIdx].RadiusKey);
  459.             }
  460.             else
  461.             {
  462.                 setText('wlRadiusIPAddr','');
  463.                 setText('wlRadiusPort','');
  464.                 setText('wlRadiusKey','');
  465. radiuspassword = '';
  466. setText('twlRadiusKey','');
  467.             }
  468.             break;

  469.         case 'wpa-psk':
  470.         case 'wpa2-psk':
  471.     case 'wpa/wpa2-psk':
  472. setDisplay('wlEncryMethod',1);
  473. addEncryMethodOption(1,0);

  474.             setDisplay('wpaPreShareKey', 1);
  475.             if (AddFlag == false)
  476.             {
  477.                 if (authMode == 'wpa-psk')
  478.                 {
  479.                     setSelect('WlanPwdMode_select',Wlan[ssidIdx].WPAEncryptionModes);
  480.                 }
  481. else if (authMode == 'wpa2-psk')
  482.                 {
  483.                     setSelect('WlanPwdMode_select',Wlan[ssidIdx].IEEE11iEncryptionModes);
  484.                 }
  485.                 else
  486.                 {
  487.                     setSelect('WlanPwdMode_select',Wlan[ssidIdx].X_HW_WPAand11iEncryptionModes);
  488.                 }
  489.                 setText('WlanPassword_password',wpaPskKey[ssidIdx].value);
  490. wpapskpassword = wpaPskKey[ssidIdx].value;
  491. setText('tWlanPassword_password',wpaPskKey[ssidIdx].value);
  492.             }
  493.             else
  494.             {
  495.                 setText('WlanPassword_password','');
  496. wpapskpassword = '';
  497. setText('tWlanPassword_password','');
  498.             }
  499.             break;
  500. case 'wapi-psk':
  501. setDisplay('wlEncryMethod',1);            
  502.             addWapiEncryMethodOption();  
  503. document.getElementById('wpa_psk').innerHTML = GetLanguageDesc("amp_wapi_psk");
  504. setDisable('WlanPwdMode_select',1);
  505. setDisplay("wpaPreShareKey", 1);
  506. setText('WlanPassword_password',wpaPskKey[ssidIdx].value);
  507. setText('tWlanPassword_password',wpaPskKey[ssidIdx].value);
  508. wpapskpassword = wpaPskKey[ssidIdx].value;
  509. if(AddFlag == false)
  510. {

  511. setSelect('WlanPwdMode_select',Wlan[ssidIdx].X_HW_WAPIEncryptionModes);
  512. }
  513. break;
  514. case 'wapi':
  515. setDisplay('wlEncryMethod',1);            
  516.             addWapiEncryMethodOption();  
  517. setDisable('WlanPwdMode_select',1);
  518. setDisplay('wlWapi',1);
  519. setText('wapiIPAddr',Wlan[ssidIdx].X_HW_WAPIServer);
  520. setText('wapiPort',Wlan[ssidIdx].X_HW_WAPIPort);
  521. if(AddFlag == false)
  522. {
  523. setSelect('WlanPwdMode_select',Wlan[ssidIdx].X_HW_WAPIEncryptionModes);
  524. }
  525. break;
  526.         default:
  527.             break;
  528.     }
  529. }

  530. function isValidKey(val, size)
  531. {
  532.     var ret = false;
  533.     var len = val.length;
  534.     var dbSize = size * 2;

  535.      
  536.       if (isValidAscii(val) != '')
  537.      {
  538.         return false;
  539.      }

  540.     if ( len == size )
  541.        ret = true;
  542.     else if ( len == dbSize )
  543.     {
  544.        for ( i = 0; i < dbSize; i++ )
  545.           if ( isHexaDigit(val.charAt(i)) == false )
  546.              break;
  547.        if ( i == dbSize )
  548.           ret = true;
  549.     }
  550.     else
  551.       ret = false;

  552.    return ret;
  553. }

  554. function displaywepkey()
  555. {   
  556.     if (AddFlag == false)
  557.     {
  558.         setText('wlKeys1',g_keys[ssidIdx * 4].value);
  559. wep1password = g_keys[ssidIdx * 4].value;
  560. setText('twlKeys1',g_keys[ssidIdx * 4].value);
  561.     }
  562.     else
  563.     {
  564.         setText('wlKeys1','');
  565. wep1password = '';
  566. setText('twlKeys1', '');
  567.     }
  568. }

  569. function beaconTypeChange(mode)
  570. {
  571.     setDisplay('wlEncryMethod',0);
  572. setDisplay("wlEncryWep",0);
  573.     setDisplay('keyInfo', 0);
  574.     setDisplay('wlRadius', 0);
  575.     setDisplay('wpaPreShareKey', 0);
  576. setDisplay('wlWapi',0);
  577.    
  578.     if (mode == 'Basic')
  579.     {
  580.         var BasicAuthenticationMode = Wlan[ssidIdx].BasicAuthenticationMode;
  581.         var BasicEncryptionModes = Wlan[ssidIdx].BasicEncryptionModes;
  582.         if (BasicEncryptionModes == 'None')
  583.     {
  584.             setSelect('WlanAuthMode_select','open');
  585.         }
  586.         else
  587.         {
  588.             var level = getEncryLevel(Wlan[ssidIdx].EncypBit);
  589. setDisplay("wlEncryWep",1);
  590.             setDisplay('keyInfo', 1);
  591.             setSelect('WlanAuthMode_select','shared');
  592.             setSelect('WlanWepPwd_select',GetWepEncrypt(BasicAuthenticationMode));
  593.             setSelect('WlanKeyBit_select', parseInt(level)+24);
  594. WlanKeyBit_selectChange();
  595.             displaywepkey();
  596.         }
  597.     }
  598. else if (mode == 'WPA')
  599. {
  600.     if (Wlan[ssidIdx].WPAAuthenticationMode == 'EAPAuthentication')
  601.         {
  602.             setDisplay("wlEncryMethod",1);
  603. addEncryMethodOption(1,0);
  604.             setDisplay("wlRadius", 1);
  605.             setSelect('WlanAuthMode_select','wpa');
  606.             setSelect('WlanPwdMode_select',Wlan[ssidIdx].WPAEncryptionModes);
  607.             setText('wlRadiusIPAddr',Wlan[ssidIdx].RadiusServer);
  608.             setText('wlRadiusPort',Wlan[ssidIdx].RadiusPort);
  609.             setText('wlRadiusKey',Wlan[ssidIdx].RadiusKey);
  610. radiuspassword = Wlan[ssidIdx].RadiusKey;
  611. setText('twlRadiusKey',Wlan[ssidIdx].RadiusKey);
  612.         }
  613.         else
  614.         {
  615.             setDisplay("wlEncryMethod",1);
  616. addEncryMethodOption(1,1);
  617.             setDisplay("wpaPreShareKey", 1);
  618.             setSelect('WlanAuthMode_select','wpa-psk');
  619.             setSelect('WlanPwdMode_select',Wlan[ssidIdx].WPAEncryptionModes);
  620.             setText('WlanPassword_password',wpaPskKey[ssidIdx].value);
  621. wpapskpassword = wpaPskKey[ssidIdx].value;
  622. setText('tWlanPassword_password',wpaPskKey[ssidIdx].value);
  623.         }
  624. }
  625. else if ((mode == '11i') || (mode == 'WPA2') )
  626.     {
  627.         if (Wlan[ssidIdx].IEEE11iAuthenticationMode == 'EAPAuthentication')
  628.         {
  629.             setDisplay("wlEncryMethod",1);
  630. addEncryMethodOption(1,0);
  631.             setDisplay("wlRadius", 1);
  632.             setSelect('WlanAuthMode_select','wpa2');
  633.             setSelect('WlanPwdMode_select',Wlan[ssidIdx].IEEE11iEncryptionModes);
  634.             setText('wlRadiusIPAddr',Wlan[ssidIdx].RadiusServer);
  635.             setText('wlRadiusPort',Wlan[ssidIdx].RadiusPort);
  636.             setText('wlRadiusKey',Wlan[ssidIdx].RadiusKey);
  637. radiuspassword = Wlan[ssidIdx].RadiusKey;
  638. setText('twlRadiusKey',Wlan[ssidIdx].RadiusKey);
  639.         }
  640.         else
  641.         {
  642.             setDisplay("wlEncryMethod",1);
  643. addEncryMethodOption(1,2);
  644.             setDisplay("wpaPreShareKey", 1);
  645.             setSelect('WlanAuthMode_select','wpa2-psk');
  646.             setSelect('WlanPwdMode_select',Wlan[ssidIdx].IEEE11iEncryptionModes);
  647.             setText('WlanPassword_password',wpaPskKey[ssidIdx].value);
  648. wpapskpassword = wpaPskKey[ssidIdx].value;
  649. setText('tWlanPassword_password',wpaPskKey[ssidIdx].value);
  650.         }
  651. }
  652. else if ((mode == 'WPAand11i')|| (mode == 'WPA/WPA2'))
  653.     {
  654.         if (Wlan[ssidIdx].X_HW_WPAand11iAuthenticationMode == 'EAPAuthentication')
  655.         {
  656.             setDisplay("wlEncryMethod",1);
  657. addEncryMethodOption(1,0);
  658.             setDisplay("wlRadius", 1);
  659.             setSelect('WlanAuthMode_select','wpa/wpa2');
  660.             setSelect('WlanPwdMode_select',Wlan[ssidIdx].X_HW_WPAand11iEncryptionModes);
  661.             setText('wlRadiusIPAddr',Wlan[ssidIdx].RadiusServer);
  662.             setText('wlRadiusPort',Wlan[ssidIdx].RadiusPort);
  663.             setText('wlRadiusKey',Wlan[ssidIdx].RadiusKey);
  664. radiuspassword = Wlan[ssidIdx].RadiusKey;
  665. setText('twlRadiusKey',Wlan[ssidIdx].RadiusKey);
  666.         }
  667.         else
  668.         {
  669.             setDisplay("wlEncryMethod",1);
  670. addEncryMethodOption(0,2);
  671.             setDisplay("wpaPreShareKey", 1);
  672.             setSelect('WlanAuthMode_select','wpa/wpa2-psk');
  673.             setSelect('WlanPwdMode_select',Wlan[ssidIdx].X_HW_WPAand11iEncryptionModes);
  674.             setText('WlanPassword_password',wpaPskKey[ssidIdx].value);
  675. wpapskpassword = wpaPskKey[ssidIdx].value;
  676. setText('tWlanPassword_password',wpaPskKey[ssidIdx].value);
  677.         }
  678. }
  679. else if(mode == 'X_HW_WAPI')
  680. {
  681. if(Wlan[ssidIdx].X_HW_WAPIAuthenticationMode == 'WAPIPSK')
  682. {
  683. setSelect('WlanAuthMode_select','wapi-psk');
  684. setDisplay('wlEncryMethod',1);            
  685.             addWapiEncryMethodOption();  

  686. setDisable('WlanPwdMode_select',1);
  687. setDisplay("wpaPreShareKey", 1);
  688. document.getElementById('wpa_psk').innerHTML = GetLanguageDesc("amp_wapi_psk");
  689. setText('WlanPassword_password',wpaPskKey[ssidIdx].value);
  690. setText('tWlanPassword_password',wpaPskKey[ssidIdx].value);
  691. wpapskpassword = wpaPskKey[ssidIdx].value;



  692. setSelect('WlanPwdMode_select',Wlan[ssidIdx].X_HW_WAPIEncryptionModes);
  693. }
  694. else
  695. {
  696. setSelect('WlanAuthMode_select','wapi');
  697. setDisplay('wlEncryMethod',1);            
  698.             addWapiEncryMethodOption();  
  699. setDisable('WlanPwdMode_select',1);
  700. setDisplay('wlWapi',1);
  701. setText('wapiIPAddr',Wlan[ssidIdx].X_HW_WAPIServer);
  702. setText('wapiPort',Wlan[ssidIdx].X_HW_WAPIPort);
  703. }
  704. }
  705.     else
  706.     {
  707.         setSelect('WlanAuthMode_select','open');
  708.     }
  709. }

  710. function WlanKeyBit_selectChange()
  711. {
  712. var desc;

  713.     if (getSelectVal('WlanKeyBit_select') == 128)
  714. {
  715. desc = "128位无线网络密钥需输入13个ASCII字符或26个十六进制数";
  716. }
  717. else
  718. {
  719. desc = "64位无线网络密钥需输入5个ASCII字符或10个十六进制数";
  720. }

  721. getElById("Title_wlan_key_tips_lable").innerHTML = desc;
  722. }

  723. function onMethodChange(isSelected)
  724. {   
  725. var authMode = getSelectVal('WlanAuthMode_select');
  726. if (authMode == 'open')
  727. {
  728.     var var2 = getSelectVal('WlanPwdMode_select');

  729.     if (var2 == 'None')
  730.         {
  731.             setDisplay('keyInfo', 0);
  732.         }
  733.         else
  734.         {
  735.             if (AddFlag == false)
  736.             {
  737.                 var level = getEncryLevel(Wlan[ssidIdx].EncypBit);
  738.                 setDisplay('keyInfo', 1);
  739.                 setSelect('WlanKeyBit_select', parseInt(level)+24);

  740.                 setText('wlKeys1',g_keys[ssidIdx * 4].value);
  741. wep1password = g_keys[ssidIdx * 4].value;
  742. setText('twlKeys1',g_keys[ssidIdx * 4].value);
  743.             }
  744.             else
  745.             {
  746.                 setDisplay('keyInfo', 1);
  747.                 setSelect('WlanKeyBit_select', 128);

  748.                 setText('wlKeys1','');
  749. wep1password = '';
  750. setText('twlKeys1','');
  751.             }
  752.         }
  753. }
  754.     else
  755.     {
  756.         setDisplay('keyInfo', 0);
  757.     }
  758. }

  759. function onWepChange()
  760. {

  761. }

  762. function SsidEnable()
  763. {
  764.     if (true == AddFlag)
  765.     {
  766.         return;
  767.     }

  768. if (Wlan[ssidIdx].X_HW_ServiceEnable == 1)
  769.     {
  770.     }
  771.     else
  772.     {
  773.         AlertEx(cfg_wlancfgother_language['amp_ssid_state']);
  774.         setCheck('wlEnable', 0);
  775.     }

  776. return;
  777. }

  778. function ShowSsidEnable(currentWlan)
  779. {
  780. if (currentWlan.X_HW_ServiceEnable == 1)
  781.     {
  782.     setCheck('wlEnable', currentWlan.enable);
  783.     }
  784.     else
  785.     {
  786.         setCheck('wlEnable', 0);
  787.     }

  788. return;
  789. }

  790. function ltrim(str)
  791. {
  792. return str.replace(/(^\s*)/g,"");
  793. }

  794. function IsCharandNum(str)
  795. {
  796.     var prefix='';
  797. var postfix = '-5G';
  798. var endPos = str.length;
  799. var ErrorNote = "SSID-1 “CMCC-”前缀后面只允许输入由0-9、a-z、A-Z等组成的字符串。";

  800. if (0 == getWlanPortNumber(currentWlan.name))
  801. {
  802. prefix = "CMCC-";
  803. }

  804. if ((1 == DoubleFreqFlag) && (4 == getWlanPortNumber(currentWlan.name)))
  805. {
  806. prefix = "CMCC-";

  807. endPos = str.length - postfix.length;
  808. if (endPos != str.lastIndexOf(postfix))
  809. {
  810. endPos = str.length;
  811. }

  812. ErrorNote = "SSID-5 “CMCC-”前缀后面只允许输入由0-9、a-z、A-Z等组成的字符串,并且允许以“-5G”结尾。";
  813. }

  814. for( var i = prefix.length; i < endPos; i++ )
  815. {
  816. if(str.charAt(i) < '0' || str.charAt(i) > '9')
  817. {
  818. if(str.charAt(i) < 'a' || str.charAt(i) > 'z')
  819. {
  820. if(str.charAt(i) < 'A' || str.charAt(i) > 'Z')
  821. {
  822. AlertEx(ErrorNote);
  823. return false;
  824. }
  825. }
  826. }
  827. }

  828. return true;
  829. }

  830. function addParameter1(Form)
  831. {   
  832.     Form.addParameter('y.Enable',getCheckVal('wlEnable'));
  833.     var ssid;
  834.     ssid = ltrim(getValue('WlanSsid_text'));
  835. if (ssid == '')
  836.     {
  837.         AlertEx(cfg_wlancfgother_language['amp_empty_ssid']);
  838.         return false;
  839.     }

  840.     if (ssid.length > 32)
  841.     {
  842.         AlertEx(cfg_wlancfgother_language['amp_ssid_check1'] + ssid + cfg_wlancfgother_language['amp_ssid_too_loog']);
  843.         return false;
  844.     }

  845.     if (isValidAscii(ssid) != '')
  846.     {
  847.         AlertEx(cfg_wlancfgother_language['amp_ssid_check1'] + ssid + cfg_wlancfgother_language['amp_ssid_invalid'] + isValidAscii(ssid));
  848.         return false;
  849.     }

  850.     for (i = 0; i < Wlan.length; i++)
  851.     {
  852.         if ((getWlanPortNumber(Wlan[i].name) > 3) && ((1 == DoubleFreqFlag) && ("2G" == wlanpage)) )
  853.         {
  854.             continue;
  855.         }
  856.         
  857.         if ((getWlanPortNumber(Wlan[i].name) <= 3) && ((1 == DoubleFreqFlag) && ("5G" == wlanpage)) )
  858.         {
  859.             continue;
  860.         }
  861.         
  862.         if (ssidIdx != i)
  863.         {
  864.             if (Wlan[i].ssid == ssid)
  865.             {
  866.                 AlertEx(cfg_wlancfgother_language['amp_ssid_exist']);
  867.                 return false;
  868.             }
  869.         }
  870.         else
  871.         {
  872.             continue;
  873.         }
  874.     }
  875.    
  876. if ('E8C' == CurrentBin.toUpperCase() && '0' == TianyiFlag)
  877. {
  878. if((0 == getWlanPortNumber(currentWlan.name)) && (0 != ssid.indexOf("ChinaNet-")) )
  879. {
  880. AlertEx(cfg_wlancfgother_language['amp_ssid_must_be_chinanet']);
  881. return false;
  882. }

  883. if (1 == DoubleFreqFlag)
  884. {
  885. if((4 == getWlanPortNumber(currentWlan.name)) && (0 != ssid.indexOf("ChinaNet-")) )
  886. {
  887. AlertEx(cfg_wlancfgother_language['amp_ssid_must_be_chinanet_5G']);
  888. return false;
  889. }
  890. }
  891. }

  892. if ('CMCC' == CurrentBin.toUpperCase() && MngtJsCmcc != 1)
  893. {
  894. if((0 == getWlanPortNumber(currentWlan.name)) && (0 != ssid.indexOf("CMCC-")) )
  895. {
  896. AlertEx(cfg_wlancfgother_language['amp_ssid_must_be_cmcc']);
  897. return false;
  898. }

  899. if (1 == DoubleFreqFlag)
  900. {
  901. if((4 == getWlanPortNumber(currentWlan.name)) && (0 != ssid.indexOf("CMCC-")) )
  902. {
  903. AlertEx(cfg_wlancfgother_language['amp_ssid_must_be_cmcc_5G']);
  904. return false;
  905. }
  906. }
  907. }

  908. if ('SHXCNCATV' == CfgMode.toUpperCase())
  909. {
  910. if((0 == getWlanPortNumber(currentWlan.name)) && (0 != ssid.indexOf("sxbctvnet-")) )
  911. {
  912. AlertEx(cfg_wlancfgother_language['amp_ssid_must_be_shxcncatv']);
  913. return false;
  914. }

  915. if (1 == DoubleFreqFlag)
  916. {
  917. if((4 == getWlanPortNumber(currentWlan.name)) && (0 != ssid.indexOf("sxbctvnet-")) )
  918. {
  919. AlertEx(cfg_wlancfgother_language['amp_ssid_must_be_shxcncatv_5G']);
  920. return false;
  921. }
  922. }
  923. }

  924. if (('1' == aWiFiCustFlag) && (aWiFiSSID2GInst == getWlanInstFromDomain(currentWlan.domain)))
  925. {
  926. if ((ssid != 'aWiFi') && (0 != ssid.indexOf("aWiFi-")))
  927. {
  928. AlertEx(cfg_wlancfgother_language['amp_ssid_must_be_awifi']);
  929. return false;
  930. }
  931. if (ssid == 'aWiFi-')
  932. {
  933. ssid = 'aWiFi';
  934. }
  935. }

  936.     Form.addParameter('y.SSID',ssid);
  937. }

  938. function addParameter2(Form)
  939. {
  940.     var url = '';
  941.     var temp = '';

  942.     var AuthMode = getSelectVal('WlanAuthMode_select');

  943. if (AuthMode == 'open')
  944. {
  945. Form.addParameter('y.BeaconType','None');
  946. Form.addParameter('y.BasicAuthenticationMode','OpenSystem');
  947. Form.addParameter('y.BasicEncryptionModes','None');
  948. }
  949.     else if (AuthMode == 'shared')
  950.     {
  951.         var KeyBit = getSelectVal('WlanKeyBit_select');
  952. var index = 1;
  953. var wlKeys1 = getValue('wlKeys1');
  954. var val;
  955. var i;
  956. var vKey = 0;
  957. var KeyDesc;

  958. for (vKey = 0; vKey < 1; vKey++)
  959. {
  960.    if (vKey == 0)
  961.    {
  962.    val = wlKeys1;
  963.    KeyDesc = cfg_wlancfgdetail_language['amp_encrypt_key1'];
  964.    }

  965.    if ( val != '' && val != null)
  966.    {   
  967.    if ( KeyBit == '128' )
  968.    {
  969.    if (isValidKey(val, 13) == false )
  970.    {
  971.    AlertEx(cfg_wlancfgdetail_language['amp_key_check1'] + val + cfg_wlancfgdetail_language['amp_key_invalid1']);
  972.    return false;
  973.    }
  974.    }
  975.    else
  976.    {
  977.    if (isValidKey(val, 5) == false )
  978.    {
  979.    AlertEx(cfg_wlancfgdetail_language['amp_key_check1'] + val + cfg_wlancfgdetail_language['amp_key_invalid2']);
  980.    return false;
  981.    }
  982.    }
  983.    
  984.    }
  985.    else
  986.    {
  987.    AlertEx(cfg_wlancfgdetail_language['amp_key_invalid3']);
  988.    return false;
  989.    }
  990. }
  991. Form.addParameter('y.WEPEncryptionLevel',(KeyBit-24)+'-bit');
  992. Form.addParameter('y.WEPKeyIndex',index);

  993.         if (wifiPasswordMask == '1')
  994.         {
  995.             if (KeyBit == '128')
  996.             {
  997.                 if ( (wlKeys1 != "*************") || (wep1PsdModFlag == true) )
  998.                 {
  999.                     Form.addParameter('k1.WEPKey', wlKeys1);
  1000.                     Form.addParameter('k2.WEPKey', wlKeys1);
  1001.                     Form.addParameter('k3.WEPKey', wlKeys1);
  1002.                     Form.addParameter('k4.WEPKey', wlKeys1);  
  1003.                 }
  1004.             }
  1005.             else
  1006.             {
  1007.                 if ( (wlKeys1 != "*****") || (wep1PsdModFlag == true) )
  1008.                 {
  1009.                     Form.addParameter('k1.WEPKey', wlKeys1);
  1010.                     Form.addParameter('k2.WEPKey', wlKeys1);
  1011.                     Form.addParameter('k3.WEPKey', wlKeys1);
  1012.                     Form.addParameter('k4.WEPKey', wlKeys1);
  1013.                 }
  1014.             }
  1015.         }
  1016.         else
  1017.         {
  1018.             Form.addParameter('k1.WEPKey', wlKeys1);
  1019.             Form.addParameter('k2.WEPKey', wlKeys1);
  1020.             Form.addParameter('k3.WEPKey', wlKeys1);
  1021.             Form.addParameter('k4.WEPKey', wlKeys1);  
  1022.         }

  1023.         
  1024.         Form.addParameter('y.BeaconType','Basic');
  1025. Form.addParameter('y.BasicAuthenticationMode',getSelectVal('WlanWepPwd_select'));
  1026.         Form.addParameter('y.BasicEncryptionModes','WEPEncryption');
  1027.     }
  1028.     else if (AuthMode == 'wpa' || AuthMode == 'wpa2' || AuthMode == 'wpa/wpa2')
  1029.     {
  1030.         var wlRadiusKey = getValue('wlRadiusKey');
  1031.         var wlRadiusIPAddr = getValue('wlRadiusIPAddr');
  1032.         var wlRadiusPort = getValue('wlRadiusPort');
  1033.         
  1034.         if (wlRadiusIPAddr == '' || wlRadiusPort == '' || wlRadiusKey == '')
  1035.         {
  1036.             AlertEx(cfg_wlancfgother_language['amp_empty_para']);
  1037.             return false;
  1038.         }

  1039. if (isValidRaiusKey(wlRadiusKey) == false)
  1040. {
  1041.     AlertEx(cfg_wlancfgdetail_language['amp_radius_keyinvalid']);
  1042.             return false;
  1043. }


  1044.         if (isAbcIpAddress(wlRadiusIPAddr) == false)
  1045.         {
  1046.             AlertEx(cfg_wlancfgdetail_language['amp_srvip_invalid']);
  1047.             return false;
  1048.         }

  1049.         if (isValidRadiusPort(wlRadiusPort) == false)
  1050.         {
  1051.             AlertEx(cfg_wlancfgdetail_language['amp_srvport_invalid']);
  1052.             return false;
  1053.         }
  1054.         
  1055.         if (AuthMode == 'wpa')
  1056.         {
  1057.             Form.addParameter('y.BeaconType','WPA');
  1058.             Form.addParameter('y.WPAAuthenticationMode','EAPAuthentication');
  1059.             Form.addParameter('y.WPAEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1060.         }
  1061.         else if (AuthMode == 'wpa2')
  1062.         {
  1063.             Form.addParameter('y.BeaconType','11i');
  1064.             Form.addParameter('y.IEEE11iAuthenticationMode','EAPAuthentication');
  1065.             Form.addParameter('y.IEEE11iEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1066.         }
  1067. else
  1068. {
  1069.     Form.addParameter('y.BeaconType','WPAand11i');
  1070.             Form.addParameter('y.X_HW_WPAand11iAuthenticationMode','EAPAuthentication');
  1071.             Form.addParameter('y.X_HW_WPAand11iEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1072. }
  1073.         
  1074.         if (wifiPasswordMask == '1')
  1075.         {
  1076.             if ( (wlRadiusKey != "********") || (radPsdModFlag == true) )
  1077.             {
  1078.                 Form.addParameter('y.X_HW_RadiusKey',wlRadiusKey);
  1079.             }
  1080.         }
  1081.         else
  1082.         {
  1083.            Form.addParameter('y.X_HW_RadiusKey',wlRadiusKey);
  1084.         }

  1085.         Form.addParameter('y.X_HW_RadiuServer',wlRadiusIPAddr);

  1086.         wlRadiusPort = parseInt(getValue('wlRadiusPort'),10);
  1087.         Form.addParameter('y.X_HW_RadiusPort',wlRadiusPort);
  1088.     }
  1089.     else if (AuthMode == 'wpa-psk' || AuthMode == 'wpa2-psk' || AuthMode == 'wpa/wpa2-psk'|| AuthMode == 'wapi'|| AuthMode == 'wapi-psk')
  1090.     {
  1091.         var value = getValue('WlanPassword_password');
  1092. var wapiIP = getValue('wapiIPAddr');
  1093. var wapiPort = getValue('wapiPort');


  1094. if(AuthMode == 'wpa-psk' || AuthMode == 'wpa2-psk' || AuthMode == 'wpa/wpa2-psk')
  1095. {

  1096. if (value == '')
  1097. {
  1098. AlertEx(cfg_wlancfgother_language['amp_empty_para']);
  1099. return false;
  1100. }

  1101. if (isValidWPAPskKey(value) == false)
  1102. {
  1103. AlertEx(cfg_wlancfgdetail_language['amp_wpskey_invalid']);
  1104. return false;
  1105. }
  1106. }

  1107.         if (AuthMode == 'wpa-psk')
  1108.         {
  1109.             Form.addParameter('y.BeaconType','WPA');
  1110.             Form.addParameter('y.WPAAuthenticationMode','PSKAuthentication');
  1111.             Form.addParameter('y.WPAEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1112.         }
  1113.         else if (AuthMode == 'wpa2-psk')
  1114.         {
  1115.             Form.addParameter('y.BeaconType','11i');
  1116.             Form.addParameter('y.IEEE11iAuthenticationMode','PSKAuthentication');
  1117.             Form.addParameter('y.IEEE11iEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1118.         }
  1119. else if(AuthMode == 'wapi')
  1120. {
  1121. if (isAbcIpAddress(wapiIP) == false)
  1122. {
  1123. AlertEx(cfg_wlancfgdetail_language['amp_wapisrvip_invalid']);
  1124. return false;
  1125. }

  1126. if (isValidRadiusPort(wapiPort) == false)
  1127. {
  1128. AlertEx(cfg_wlancfgdetail_language['amp_wapisrvport_invalid']);
  1129. return false;
  1130. }
  1131. Form.addParameter('y.BeaconType','X_HW_WAPI');
  1132. Form.addParameter('y.X_HW_WAPIAuthenticationMode','WAPICERT');
  1133. Form.addParameter('y.X_HW_WAPIEncryptionModes','SMS4');
  1134. Form.addParameter('y.X_HW_WAPIServer',wapiIP);
  1135. Form.addParameter('y.X_HW_WAPIPort',parseInt(getValue('wapiPort')),10);
  1136. }
  1137. else if(AuthMode == 'wapi-psk')
  1138. {
  1139. if (value == '')
  1140. {
  1141. AlertEx(cfg_wlancfgother_language['amp_empty_para']);
  1142. return false;
  1143. }

  1144. if (isValidWPAPskKey(value) == false)
  1145. {
  1146. AlertEx(cfg_wlancfgdetail_language['amp_wpskey_invalid']);
  1147. return false;
  1148. }
  1149. Form.addParameter('y.BeaconType','X_HW_WAPI');
  1150. Form.addParameter('y.X_HW_WAPIAuthenticationMode','WAPIPSK');
  1151. Form.addParameter('y.X_HW_WAPIEncryptionModes','SMS4');
  1152. }
  1153. else
  1154.         {
  1155.             Form.addParameter('y.BeaconType','WPAand11i');
  1156.             Form.addParameter('y.X_HW_WPAand11iAuthenticationMode','PSKAuthentication');
  1157.             Form.addParameter('y.X_HW_WPAand11iEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1158.         }

  1159.         if (wifiPasswordMask == '1')
  1160.         {
  1161.             if ( (value != "********") || (pskPsdModFlag == true) )
  1162.             {
  1163.                 Form.addParameter('k.PreSharedKey',value);
  1164.             }
  1165.             
  1166.         }
  1167.         else
  1168.         {
  1169.             Form.addParameter('k.PreSharedKey',value);
  1170.         }
  1171.     }
  1172.     else
  1173.     {
  1174.     }

  1175.     return true;
  1176. }

  1177. var guiCoverSsidNotifyFlag = 0;

  1178. function setCoverSsidNotifyFlag(DBvalue, WebValue)
  1179. {
  1180.     if (DBvalue != WebValue)
  1181.     {
  1182.         guiCoverSsidNotifyFlag++;
  1183.     }
  1184. }

  1185. function stExtendedWLC(domain, SSIDIndex)
  1186. {
  1187.     this.domain = domain;
  1188.     this.SSIDIndex = SSIDIndex;
  1189. }

  1190. var apExtendedWLC = new Array(null);

  1191. function isWifiCoverSsidNotify()
  1192. {   
  1193.     if (guiCoverSsidNotifyFlag > 0)
  1194.     {
  1195.         return true;
  1196.     }
  1197.     return false;
  1198. }

  1199. function isWifiCoverSsid(wlanInst)
  1200. {
  1201.     for (var j = 0; j < apExtendedWLC.length - 1; j++)
  1202.     {
  1203.         if (wlanInst == apExtendedWLC[j].SSIDIndex)
  1204.         {
  1205.             if (isWifiCoverSsidNotify())
  1206.             {
  1207.                    return true;            
  1208.             }
  1209.         }
  1210.     }

  1211.     return false
  1212. }

  1213. function AddParaForCover(Form)
  1214. {
  1215.     var wlandomain = Wlan[ssidIdx].domain;
  1216.     var length = wlandomain.length;
  1217.     var wlanInstId = parseInt(wlandomain.charAt(length-1));
  1218.     var beaconType = "Basic";

  1219.     Form.addParameter('w.SsidInst',wlanInstId);
  1220.    
  1221.     Form.addParameter('w.SSID',ltrim(getValue('WlanSsid_text')));
  1222.     setCoverSsidNotifyFlag(Wlan[ssidIdx].ssid, ltrim(getValue('WlanSsid_text')));
  1223.    
  1224.     Form.addParameter('w.Enable',getCheckVal('wlEnable'));

  1225.     Form.addParameter('w.Standard',WlanWifi.mode);

  1226.     Form.addParameter('w.BasicAuthenticationMode','None');
  1227.     Form.addParameter('w.BasicEncryptionModes','WEPEncryption');
  1228.     Form.addParameter('w.WPAAuthenticationMode','EAPAuthentication');
  1229.     Form.addParameter('w.WPAEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1230.     Form.addParameter('w.IEEE11iAuthenticationMode','EAPAuthentication');
  1231.     Form.addParameter('w.IEEE11iEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1232.     Form.addParameter('w.MixAuthenticationMode','EAPAuthentication');
  1233.     Form.addParameter('w.MixEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1234.    
  1235.     var AuthMode = getSelectVal('WlanAuthMode_select');
  1236.     if (AuthMode == 'shared' || AuthMode == 'open')
  1237.     {   
  1238.         Form.addParameter('w.BeaconType','Basic');
  1239.         setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, 'Basic');        
  1240.         
  1241.         Form.addParameter('w.BasicAuthenticationMode',getSelectVal('WlanWepPwd_select'));
  1242.         setCoverSsidNotifyFlag(Wlan[ssidIdx].BasicAuthenticationMode, getSelectVal('WlanWepPwd_select'));        
  1243.         
  1244.         Form.addParameter('w.BasicEncryptionModes','WEPEncryption');
  1245.         setCoverSsidNotifyFlag(Wlan[ssidIdx].BasicEncryptionModes, 'WEPEncryption');
  1246.     }
  1247.     else if (AuthMode == 'wpa' || AuthMode == 'wpa2' || AuthMode == 'wpa/wpa2')
  1248.     {
  1249.         if (AuthMode == 'wpa')
  1250.         {
  1251.             Form.addParameter('w.BeaconType','WPA');
  1252.             setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, 'WPA');            
  1253.             
  1254.             beaconType = "WPA";
  1255.             Form.addParameter('w.WPAAuthenticationMode','EAPAuthentication');
  1256.             setCoverSsidNotifyFlag(Wlan[ssidIdx].WPAAuthenticationMode, 'EAPAuthentication');
  1257.             
  1258.             Form.addParameter('w.WPAEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1259.             setCoverSsidNotifyFlag(Wlan[ssidIdx].WPAEncryptionModes, getSelectVal('WlanPwdMode_select'));
  1260.         }
  1261.         else if (AuthMode == 'wpa2')
  1262.         {
  1263.             Form.addParameter('w.BeaconType','11i');
  1264.             setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, '11i');
  1265.             
  1266.             beaconType = "11i";
  1267.             Form.addParameter('w.IEEE11iAuthenticationMode','EAPAuthentication');
  1268.             setCoverSsidNotifyFlag(Wlan[ssidIdx].IEEE11iAuthenticationMode, 'EAPAuthentication');
  1269.             
  1270.             Form.addParameter('w.IEEE11iEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1271.             setCoverSsidNotifyFlag(Wlan[ssidIdx].IEEE11iEncryptionModes, getSelectVal('WlanPwdMode_select'));
  1272.         }
  1273.         else
  1274.         {
  1275.             Form.addParameter('w.BeaconType','WPAand11i');
  1276.             setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, 'WPAand11i');
  1277.             
  1278.             beaconType = "WPAand11i";
  1279.             Form.addParameter('w.MixAuthenticationMode','EAPAuthentication');
  1280.             setCoverSsidNotifyFlag(Wlan[ssidIdx].X_HW_WPAand11iAuthenticationMode, 'EAPAuthentication');
  1281.             
  1282.             Form.addParameter('w.MixEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1283.             setCoverSsidNotifyFlag(Wlan[ssidIdx].X_HW_WPAand11iEncryptionModes, getSelectVal('WlanPwdMode_select'));
  1284.         }
  1285.     }
  1286.     else if (AuthMode == 'wpa-psk' || AuthMode == 'wpa2-psk' || AuthMode == 'wpa/wpa2-psk'|| AuthMode == 'wapi'|| AuthMode == 'wapi-psk')
  1287.     {
  1288.         if (AuthMode == 'wpa-psk')
  1289.         {
  1290.             Form.addParameter('w.BeaconType','WPA');
  1291.             setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, 'WPA');
  1292.             
  1293.             beaconType = "WPA";
  1294.             Form.addParameter('w.WPAAuthenticationMode','PSKAuthentication');
  1295.             setCoverSsidNotifyFlag(Wlan[ssidIdx].WPAAuthenticationMode, 'PSKAuthentication');
  1296.             
  1297.             Form.addParameter('w.WPAEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1298.             setCoverSsidNotifyFlag(Wlan[ssidIdx].WPAEncryptionModes, getSelectVal('WlanPwdMode_select'));
  1299.         }
  1300.         else if (AuthMode == 'wpa2-psk')
  1301.         {
  1302.             Form.addParameter('w.BeaconType','11i');
  1303.             setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, '11i');
  1304.             
  1305.             beaconType = "11i";
  1306.             Form.addParameter('w.IEEE11iAuthenticationMode','PSKAuthentication');
  1307.             setCoverSsidNotifyFlag(Wlan[ssidIdx].IEEE11iAuthenticationMode, 'PSKAuthentication');
  1308.             
  1309.             Form.addParameter('w.IEEE11iEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1310.             setCoverSsidNotifyFlag(Wlan[ssidIdx].IEEE11iEncryptionModes, getSelectVal('WlanPwdMode_select'));
  1311.         }
  1312.         else if(AuthMode == 'wapi')
  1313.         {
  1314.             Form.addParameter('w.BeaconType','X_HW_WAPI');
  1315.             setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, 'X_HW_WAPI');
  1316.             
  1317.             beaconType = "X_HW_WAPI";
  1318.             
  1319.         }
  1320.         else if(AuthMode == 'wapi-psk')
  1321.         {
  1322.             Form.addParameter('w.BeaconType','X_HW_WAPI');
  1323.             setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, 'X_HW_WAPI');
  1324.             
  1325.             beaconType = "X_HW_WAPI";
  1326.         }
  1327.         else
  1328.         {
  1329.             Form.addParameter('w.BeaconType','WPAand11i');
  1330.             setCoverSsidNotifyFlag(Wlan[ssidIdx].BeaconType, 'WPAand11i');
  1331.             
  1332.             beaconType = "WPAand11i";
  1333.             Form.addParameter('w.MixAuthenticationMode','PSKAuthentication');
  1334.             setCoverSsidNotifyFlag(Wlan[ssidIdx].X_HW_WPAand11iAuthenticationMode, 'PSKAuthentication');
  1335.             
  1336.             Form.addParameter('w.MixEncryptionModes',getSelectVal('WlanPwdMode_select'));
  1337.             setCoverSsidNotifyFlag(Wlan[ssidIdx].X_HW_WPAand11iEncryptionModes, getSelectVal('WlanPwdMode_select'));
  1338.         }
  1339.     }
  1340.     var KeyBit = getSelectVal('WlanKeyBit_select');   
  1341.     Form.addParameter('w.WEPEncryptionLevel',(KeyBit-24)+'-bit');
  1342.     setCoverSsidNotifyFlag(Wlan[ssidIdx].EncypBit, (KeyBit-24)+'-bit');
  1343.    
  1344.     //var keyIndex = getSelectVal('wlKeyIndex');
  1345.     var keyIndex = 1;
  1346.     Form.addParameter('w.WEPKeyIndex', keyIndex);            
  1347.    
  1348.     var weppsdModifyFLag = false;
  1349.     var key;
  1350.     if (1 == keyIndex)
  1351.     {
  1352.         key = getValue('wlKeys1');
  1353.         weppsdModifyFLag = wep1PsdModFlag;
  1354.     }
  1355.     else if (2 == keyIndex)
  1356.     {
  1357.         key = getValue('wlKeys2');
  1358.         weppsdModifyFLag = wep2PsdModFlag;
  1359.     }
  1360.     else if (3 == keyIndex)
  1361.     {
  1362.         key = getValue('wlKeys3');
  1363.         weppsdModifyFLag = wep3PsdModFlag;
  1364.     }
  1365.     else  if (4 == keyIndex)
  1366.     {
  1367.         key = getValue('wlKeys4');
  1368.         weppsdModifyFLag = wep4PsdModFlag;
  1369.     }

  1370.     if ("Basic" != beaconType)
  1371.     {
  1372.         key = getValue('WlanPassword_password');
  1373.     }   
  1374.    
  1375.     if (wifiPasswordMask == '1')
  1376.     {
  1377.         if ("Basic" != beaconType)
  1378.         {
  1379.             if ( (key != "********") || (pskPsdModFlag == true) )
  1380.             {
  1381.                 Form.addParameter('w.Key', key);
  1382.             }
  1383.         }
  1384.         else
  1385.         {
  1386.             if ('WEPEncryption' == getSelectVal('WlanPwdMode_select'))
  1387.             {
  1388.                 if (KeyBit == '128')
  1389.                 {
  1390.                     if ( (key != "*************") || (weppsdModifyFLag == true) )
  1391.                     {                        
  1392.                         Form.addParameter('w.Key', key);
  1393.                     }
  1394.                 }
  1395.                 else
  1396.                 {
  1397.                     if ( (key != "*****") || (weppsdModifyFLag == true) )
  1398.                     {
  1399.                         Form.addParameter('w.Key', key);
  1400.                     }
  1401.                 }
  1402.             }
  1403.         }
  1404.     }
  1405.     else
  1406.     {
  1407.         Form.addParameter('w.Key', key);
  1408.     }
  1409.    

  1410.     if ("Basic" != beaconType)
  1411.     {
  1412.         setCoverSsidNotifyFlag(wpaPskKey[ssidIdx].value, key);
  1413.     }
  1414.     else
  1415.     {
  1416.         if (('WEPEncryption' == getSelectVal('WlanPwdMode_select')) && (1 <= keyIndex) && (keyIndex <= 4))
  1417.         {
  1418.             setCoverSsidNotifyFlag(Wlan[ssidIdx].KeyIndex, keyIndex);
  1419.             setCoverSsidNotifyFlag(g_keys[ssidIdx * 4 + (keyIndex - 1)].value, key);
  1420.         }
  1421.     }
  1422.    
  1423.     return true;
  1424. }

  1425. function SubmitForm()
  1426. {
  1427.     var Form = new webSubmitForm();

  1428.     if (addParameter1(Form) == false)
  1429.     {
  1430. setDisable('Save_button',0);
  1431.     setDisable('Cancel_button',0);
  1432. return;
  1433.     }
  1434.    
  1435.     if (addParameter2(Form) == false)
  1436.     {
  1437. setDisable('Save_button',0);
  1438.     setDisable('Cancel_button',0);   
  1439.         return;
  1440.     }
  1441.    
  1442.     if (AddParaForCover(Form) == false)
  1443.     {
  1444.     setDisable('Save_button',0);
  1445.     setDisable('Cancel_button',0);     
  1446.         return;
  1447.     }
  1448.    
  1449.     var wlandomain = Wlan[ssidIdx].domain;
  1450.     var AuthMode = getSelectVal('WlanAuthMode_select');

  1451.     if (isWifiCoverSsid(getWlanInstFromDomain(wlandomain)))
  1452.     {
  1453.         if (false == ConfirmEx(cfg_wificover_basic_language['amp_wificover_ssid_change_notify']))
  1454.         {
  1455.             guiCoverSsidNotifyFlag = 0;
  1456.             setDisable('Save_button',0);
  1457.             setDisable('Cancel_button',0);           
  1458.             return;
  1459.         }
  1460.     }      


  1461. var url;

  1462. if (AuthMode == 'open')
  1463. {
  1464. url = 'set.cgi?w=InternetGatewayDevice.X_HW_DEBUG.AMP.WifiCoverSetWlanBasic&y=' + wlandomain;
  1465. }
  1466.     else if (AuthMode == 'shared')
  1467.     {
  1468.         url = 'set.cgi?w=InternetGatewayDevice.X_HW_DEBUG.AMP.WifiCoverSetWlanBasic&y=' + wlandomain
  1469.                     + '&k1=' + wlandomain + '.WEPKey.1'
  1470.                     + '&k2=' + wlandomain + '.WEPKey.2'
  1471.                     + '&k3=' + wlandomain + '.WEPKey.3'
  1472.                     + '&k4=' + wlandomain + '.WEPKey.4';
  1473.     }
  1474.     else if (AuthMode == 'wpa' || AuthMode == 'wpa2' || AuthMode == 'wpa/wpa2')
  1475.     {
  1476. url = 'set.cgi?w=InternetGatewayDevice.X_HW_DEBUG.AMP.WifiCoverSetWlanBasic&y=' + wlandomain;
  1477.     }
  1478.     else if (AuthMode == 'wpa-psk' || AuthMode == 'wpa2-psk' || AuthMode == 'wpa/wpa2-psk')
  1479.     {
  1480.         url = 'set.cgi?w=InternetGatewayDevice.X_HW_DEBUG.AMP.WifiCoverSetWlanBasic&y=' + wlandomain
  1481.                     + '&k=' + wlandomain + '.PreSharedKey.1';
  1482.     }
  1483. else if(AuthMode == 'wapi' || AuthMode == 'wapi-psk')
  1484. {
  1485. url = 'set.cgi?w=InternetGatewayDevice.X_HW_DEBUG.AMP.WifiCoverSetWlanBasic&y=' + wlandomain
  1486.    +'&k=' + wlandomain + '.PreSharedKey.1';
  1487. }
  1488.     else
  1489.     {
  1490. url = 'set.cgi?w=InternetGatewayDevice.X_HW_DEBUG.AMP.WifiCoverSetWlanBasic&x=InternetGatewayDevice.LANDevice.1'
  1491.                     + '&y=' + wlandomain;
  1492.     }

  1493. url += '&RequestFile=html/amp/wlanbasic/e8cWlanBasic.asp';
  1494. Form.setAction(url);

  1495.     setDisable('Save_button',1);
  1496.     setDisable('Cancel_button',1);
  1497. Form.addParameter('x.X_HW_Token', getValue('onttoken'));
  1498.     Form.submit();
  1499. }

  1500. function WlanBasic(enable)
  1501. {
  1502. setDisplay('wlanBasicCfg',1);
  1503. setCheck('WlanEnable_checkbox', enable);

  1504. if ((1 == enable) && (WlanArr[0] != null))
  1505. {
  1506.     ssidIdx = 0;

  1507. if ((1 == DoubleFreqFlag) && ("5G" == wlanpage) && (uiTotal5gNum > 0))
  1508. {
  1509. FirstRecordFor5G();
  1510. selectLine('record_' + RecordFor5G);

  1511. }
  1512.         else if((1 == DoubleFreqFlag) && ("2G" == wlanpage) && ((uiTotal2gNum > 0)))
  1513.         {
  1514. FirstRecordFor2G();
  1515. selectLine('record_' + RecordFor2G);
  1516.         }
  1517. else if (uiTotalNum > 0)
  1518. {
  1519. selectLine('record_0');
  1520. }

  1521.     setDisplay('wlanCfg',1);
  1522.     var authMode = Wlan[ssidIdx].BeaconType;
  1523. beaconTypeChange(authMode);
  1524. }
  1525. else
  1526. {
  1527.     setDisplay('wlanCfg',0);
  1528. }
  1529. }

  1530. function BindPsdModifyEvent()
  1531. {
  1532.     $('#wlKeys1').bind("propertychange input", function(){
  1533.         var KeyBit = getSelectVal('WlanKeyBit_select');
  1534.         if (KeyBit == '128')
  1535.         {
  1536.             if (getValue('wlKeys1') != "*************")
  1537.             {
  1538.                 wep1PsdModFlag = true;
  1539.             }            
  1540.         }
  1541.         else
  1542.         {
  1543.             if(getValue('wlKeys1') != "*****")
  1544.             {
  1545.                 wep1PsdModFlag = true;
  1546.             }
  1547.         }
  1548.     } );

  1549.     $('#WlanPassword_password').bind("propertychange input", function(){
  1550.         if(getValue('WlanPassword_password') != "********")
  1551.         {
  1552.             pskPsdModFlag = true;
  1553.         }
  1554.     } );

  1555.     $('#wlRadiusKey').bind("propertychange input", function(){
  1556.         if(getValue('wlRadiusKey') != "********")
  1557.         {
  1558.             radPsdModFlag = true;
  1559.         }
  1560.     } );
  1561. }



  1562. function LoadFrame()
  1563. {   
  1564. var flag5G =0;
  1565. var flag2G =0;

  1566. Total2gNum();

  1567. if (enbl == '')
  1568.     {
  1569.         setDisplay('wlanBasicCfg',0);
  1570.     }
  1571.     else
  1572.     {
  1573. setDisplay('ConfigForm',1);
  1574.         if (1 == DoubleFreqFlag)
  1575. {
  1576.     FirstRecordFor5G();

  1577.             if ('2G' == wlanpage)
  1578.             {
  1579.                 WlanBasic(enbl2G);
  1580.             }

  1581.             if ('5G' == wlanpage)
  1582.             {
  1583.                 WlanBasic(enbl5G);
  1584.             }
  1585. }
  1586. else
  1587. {
  1588. WlanBasic(enbl);
  1589. }
  1590.     }

  1591. if (1 == DoubleFreqFlag)
  1592. {
  1593. if("2G" == wlanpage)
  1594. {
  1595. for(var j = 0; j < WlanMap.length; j++)
  1596. {
  1597. if(WlanMap[j].portIndex < 4 )
  1598. {
  1599. flag2G++
  1600. }
  1601. }
  1602. if(flag2G > 0)
  1603. {
  1604. setDisplay('ssidDetail',1);
  1605. }
  1606. else
  1607. {
  1608. setDisplay('ssidDetail',0);
  1609. }
  1610. }

  1611. if("5G" == wlanpage)
  1612. {
  1613. for(var j = 0; j < WlanMap.length; j++)
  1614. {
  1615. if(WlanMap[j].portIndex >= 4 )
  1616. {
  1617. flag5G++
  1618. }
  1619. }
  1620. if(flag5G > 0)
  1621. {
  1622. setDisplay('ssidDetail',1);
  1623. }
  1624. else
  1625. {
  1626. setDisplay('ssidDetail',0);
  1627. }
  1628. }
  1629. }
  1630. else
  1631.     {
  1632. if(0 == WlanMap.length)
  1633. {
  1634.         setDisplay('ssidDetail',0);
  1635. }
  1636.     }

  1637.     addAuthModeOption();

  1638. WlanKeyBit_selectChange();

  1639. if (1 == '0')
  1640. {
  1641. setDisable("WlanPwdMode_select",1);
  1642. setDisable("WlanAuthMode_select",1);
  1643. }

  1644.     if (wifiPasswordMask == 1)
  1645.     {
  1646.         BindPsdModifyEvent();
  1647.         
  1648.     setDisable('hidewlRadiusKey', 1);
  1649.     setDisable('hidewlKeys', 1);
  1650.     setDisable('CheckoutPassword_button', 1);   
  1651.     }

  1652. var all = document.getElementsByTagName("td");
  1653. for (var i = 0; i <all.length ; i++)
  1654. {
  1655. var b = all[i];
  1656. if(b.getAttribute("BindText") == null)
  1657. {
  1658. continue;
  1659. }

  1660. if (cfg_wlancfgbasic_language[b.getAttribute("BindText")]) {
  1661. b.innerHTML = cfg_wlancfgbasic_language[b.getAttribute("BindText")];
  1662. } else if (cfg_wlancfgdetail_language[b.getAttribute("BindText")]) {
  1663. b.innerHTML = cfg_wlancfgdetail_language[b.getAttribute("BindText")];
  1664. } else if (cfg_wlancfgadvance_language[b.getAttribute("BindText")]) {
  1665. b.innerHTML = cfg_wlancfgadvance_language[b.getAttribute("BindText")];
  1666. } else if (cfg_wlancfgother_language[b.getAttribute("BindText")]) {
  1667. b.innerHTML = cfg_wlancfgother_language[b.getAttribute("BindText")];
  1668. } else if (cfg_wlanzone_language[b.getAttribute("BindText")]) {
  1669. b.innerHTML = cfg_wlanzone_language[b.getAttribute("BindText")];
  1670. }
  1671. }

  1672. if (g_keys[0] != null)
  1673.     {
  1674.         document.getElementById('wlKeys1').title = posswordComplexTitle;
  1675.         document.getElementById('twlKeys1').title = posswordComplexTitle;  
  1676.     }
  1677.     document.getElementById('WlanPassword_password').title = posswordComplexTitle;
  1678.     document.getElementById('tWlanPassword_password').title = posswordComplexTitle;
  1679.     document.getElementById('wlRadiusKey').title = posswordComplexTitle;
  1680.     document.getElementById('twlRadiusKey').title = posswordComplexTitle;
  1681. }

  1682. function ApplySubmit1()
  1683. {
  1684.     var Form = new webSubmitForm();   

  1685.     if (addParameter1(Form) == false)
  1686.     {
  1687.         setDisable('Save_button',0);
  1688.         setDisable('Cancel_button',0);
  1689.         return;
  1690.     }
  1691.    
  1692. if (1 == DoubleFreqFlag)
  1693. {
  1694. if ("2G" == wlanpage)
  1695. {
  1696.   Form.addParameter('y.LowerLayers', node2G);
  1697. Form.setAction('add.cgi?y=InternetGatewayDevice.LANDevice.1.WLANConfiguration'
  1698.                + '&RequestFile=html/amp/wlanbasic/e8cWlanBasic.asp');
  1699. }
  1700. else if ("5G" == wlanpage)
  1701. {
  1702.   Form.addParameter('y.LowerLayers', node5G);
  1703. Form.setAction('add.cgi?y=InternetGatewayDevice.LANDevice.1.WLANConfiguration'
  1704.                + '&RequestFile=html/amp/wlanbasic/e8cWlanBasic.asp');
  1705. }
  1706. else
  1707. {}

  1708. }
  1709. else
  1710. {
  1711.         Form.setAction('add.cgi?y=InternetGatewayDevice.LANDevice.1.WLANConfiguration'
  1712.                        + '&RequestFile=html/amp/wlanbasic/e8cWlanBasic.asp');
  1713. }

  1714.     setDisable('Save_button',1);
  1715.     setDisable('Cancel_button',1);
  1716. Form.addParameter('x.X_HW_Token', getValue('onttoken'));
  1717.     Form.submit();
  1718. }

  1719. function ApplySubmit2()
  1720. {
  1721.     SubmitForm();
  1722. }

  1723. function ApplySubmit()
  1724. {
  1725.     if (AddFlag == true)
  1726.     {
  1727.         setDisable('BtnAdd', 1);
  1728.         setDisable('BtnRemove', 1);
  1729.         setDisable('Save_button',1);
  1730.         setDisable('Cancel_button',1);

  1731.         ApplySubmit1();
  1732.     }
  1733.     else
  1734.     {
  1735.         ApplySubmit2();
  1736.     }
  1737. }

  1738. function EnableSubmit()
  1739. {
  1740.     setDisable('WlanEnable_checkbox', 1);
  1741.     AddFlag = false;
  1742.     var Form = new webSubmitForm();
  1743.     var enable = getCheckVal('WlanEnable_checkbox');
  1744. var url;

  1745.     setDisable('Save_button', 1);
  1746.     setDisable('Cancel_button', 1);

  1747.     if (1 == DoubleFreqFlag)
  1748.     {
  1749.         if ("2G" == wlanpage)
  1750.         {
  1751.         Form.addParameter('x.Enable',enable);
  1752.     if ('InternetGatewayDevice.LANDevice.1.WiFi.Radio.1' == node2G)
  1753.     {
  1754. url = 'set.cgi?x=InternetGatewayDevice.LANDevice.1.WiFi.Radio.1';
  1755.     }
  1756.     else
  1757.     {
  1758. url = 'set.cgi?x=InternetGatewayDevice.LANDevice.1.WiFi.Radio.2';
  1759.     }
  1760.         }
  1761.         else if ("5G" == wlanpage)
  1762.         {
  1763.         Form.addParameter('x.Enable',enable);
  1764.       if ('InternetGatewayDevice.LANDevice.1.WiFi.Radio.1' == node5G)
  1765.     {
  1766. url = 'set.cgi?x=InternetGatewayDevice.LANDevice.1.WiFi.Radio.1';
  1767.     }
  1768.     else
  1769.     {
  1770. url = 'set.cgi?x=InternetGatewayDevice.LANDevice.1.WiFi.Radio.2';
  1771.     }
  1772.         }
  1773. else
  1774. {

  1775. }
  1776. }
  1777.     else
  1778.     {
  1779.     Form.addParameter('x.X_HW_WlanEnable',enable);
  1780. url = 'set.cgi?x=InternetGatewayDevice.LANDevice.1';
  1781.     }

  1782. url += '&RequestFile=html/amp/wlanbasic/e8cWlanBasic.asp';
  1783. Form.setAction(url);

  1784. Form.addParameter('x.X_HW_Token', getValue('onttoken'));
  1785.     Form.submit();
  1786. }

  1787. function showWlan(currentWlan)
  1788. {
  1789.     with (document.forms[0])
  1790.     {
  1791.         ShowSsidEnable(currentWlan);
  1792.         setText('WlanSsid_text',currentWlan.ssid);
  1793.         if (ssidAccessAttr.indexOf('Subscriber') < 0)
  1794.         {
  1795.             setDisable('WlanSsid_text',1);
  1796.         }

  1797.         beaconTypeChange(currentWlan.BeaconType);
  1798.     }
  1799. }

  1800. function setControl(idIndex)
  1801. {   
  1802.     if (-1 == idIndex)
  1803.     {   
  1804.         if (1 == SingleFreqFlag)
  1805. {
  1806. if (Wlan.length >= maxSingleWLAN.MAX_ID)
  1807. {
  1808. setDisplay('cfg_table', 0);
  1809. AlertEx(cfg_wlancfgother_language['amp_ssid_4max']);
  1810. return;
  1811. }
  1812. }
  1813. else if (1 == DoubleFreqFlag)
  1814. {
  1815. Total2gNum();

  1816. if ("2G" == wlanpage)
  1817. {
  1818. if ((uiTotal2gNum >= 4) || (uiTotalNum >= 8))
  1819. {
  1820. setDisplay('cfg_table', 0);
  1821. AlertEx(cfg_wlancfgother_language['amp_ssid_4max']);
  1822. return;
  1823. }
  1824. }

  1825. else if("5G" == wlanpage)
  1826. {
  1827. if ((uiTotal5gNum >= 4) || (uiTotalNum >= 8))
  1828. {
  1829. setDisplay('cfg_table', 0);
  1830. AlertEx(cfg_wlancfgother_language['amp_ssid_4max']);
  1831. return;
  1832. }
  1833. }
  1834. }
  1835.    
  1836.         ssidIdx = -1;
  1837.         AddFlag = true;

  1838.         currentWlan = new stWlan('','','','',1,32,1,'','','','','','','','','','','','','','','');

  1839.         setDisplay('ssidDetail', 1);
  1840.         setDisplay('securityCfg',0);
  1841.     }
  1842.     else
  1843.     {
  1844.         setDisplay('cfg_table', 1);
  1845.         setDisplay('securityCfg',1);
  1846.         ssidIdx = parseInt(WlanMap[idIndex].index);
  1847.         AddFlag = false;

  1848.         currentWlan = Wlan[ssidIdx];
  1849.     }

  1850.     showWlan(currentWlan);

  1851.     setDisable('Save_button', 0);
  1852.     setDisable('Cancel_button', 0);

  1853. var curWlanInst = getWlanInstFromDomain(currentWlan.domain);

  1854. if ((1 == isSsidForIsp(curWlanInst)) && (1 == ShowISPSsidFlag))
  1855. {
  1856. if ('CMCC' != CurrentBin.toUpperCase() )
  1857.         {
  1858. setDisable('Save_button', 1);
  1859.        setDisable('Cancel_button', 1);
  1860. }
  1861. }


  1862.     ClearPsdModFlag();

  1863. if (1 == MngtJsCmcc && 1 != curWlanInst && 5 != curWlanInst)
  1864. {
  1865. setDisable('Save_button', 1);
  1866.        setDisable('Cancel_button', 1);
  1867. }
  1868. }

  1869. function selectRemoveCnt(curCheck)
  1870. {
  1871. }

  1872. function Cancel_buttonValue()
  1873. {
  1874. var temp1 =0;
  1875. var temp2 =0;
  1876.     if (AddFlag == true)
  1877.     {
  1878.         var tableRow = getElement("wlanInst");
  1879. if ((1 == DoubleFreqFlag) && ("5G" == wlanpage))
  1880. {
  1881. FirstRecordFor5G();
  1882. selectLine('record_' + RecordFor5G);

  1883. for(var i = 0; i < WlanMap.length; i++)
  1884. {
  1885. if(WlanMap[i].portIndex >3)
  1886. {
  1887. temp1++;
  1888. }
  1889. }
  1890. if(temp1==0)
  1891. {
  1892. setDisplay('ssidDetail',0);
  1893. }
  1894. }
  1895. else if((1 == DoubleFreqFlag) && ("2G" == wlanpage))
  1896. {
  1897. FirstRecordFor2G();
  1898. selectLine('record_' + RecordFor2G);

  1899. for(var j = 0; j < WlanMap.length; j++)
  1900. {
  1901. if(WlanMap[j].portIndex < 4)
  1902. {
  1903. temp2++;
  1904. }
  1905. }
  1906. if(temp2==0)
  1907. {
  1908. setDisplay('ssidDetail',0);
  1909. }
  1910.            
  1911.         }
  1912. else
  1913. {
  1914. selectLine('record_0');
  1915. }
  1916.         
  1917.         tableRow.deleteRow(tableRow.rows.length-1);
  1918.     }
  1919.     else
  1920.     {
  1921.         var currentWlan = Wlan[ssidIdx];
  1922.         showWlan(currentWlan);
  1923.     }

  1924.     ClearPsdModFlag();
  1925. }

  1926. var authmode = cfg_wlancfgdetail_language['amp_authmode_help'];
  1927. var encryption = cfg_wlancfgdetail_language['amp_encrypt_help'];
  1928. var ssid = cfg_wlancfgdetail_language['amp_ssid_help'];
  1929. var posswordComplexTitle = cfg_wlancfgdetail_language['amp_wlanpasswordcomplex_title'];

  1930. </script>
复制代码


我这有台移不动HG8545M,JS里是这样的
发表于 2023-1-26 12:22:17 | 显示全部楼层
感谢大佬分享!666
*滑块验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|小黑屋|宽带技术网 |网站地图 粤公网安备44152102000001号

GMT+8, 2025-8-13 13:36 , Processed in 0.029213 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表