var sslcc_record_next_index = 0;
var sslcc_max_number = 2 + 1;
var sslcc_count =0;
var sslcc_record_csid = new Array(
""
,"N002011B1"
,"N002011B2"
)
var sslcc_record_index = new Array(
""
,""
,""
)
var sslcc_tunlname_v = new Array(
""
,""
,""
)
var sslcc_tunlname_csid = new Array(
""
,"S009C4021"
,"S009C4022"
)
var sslcc_tunen_csid = new Array(
""
,"N009C4011"
,"N009C4012"
)
var sslcc_record_length = 0;
for(var g=1;g<sslcc_record_index.length;g++)
{
var cun0 = "";
if(sslcc_record_index[g] == "")
{
sslcc_record_length = g;
cun0 ++
break;
}
if(((sslcc_record_index.length -1)==g)&&(cun0 == "")){ sslcc_record_length = sslcc_max_number }
}
function add_sslcc_account(obj)
{
if(sslcc_record_length != sslcc_max_number)
{
obj.form.action = "opvpncliadd.htm";
obj.form.Ntid.value = sslcc_record_next_index;
obj.form.Nopvpnlen.value = sslcc_record_length;
obj.form.Nrule.value = sslcc_record_next_index;
obj.form.submit();
}
else
{
alert(GetElmCont("pptps_0","Rule could not be added anymore."));
}
}
function del_tunnel()
{
var tmp_del = document.getElementsByName("sslcc_del");
var del_arr = new Array();
var index = 0;
var new_index = 1;
var sent_str ="opvpncli.htm?";
for(var t=0;t<tmp_del.length;t++)
{
if(tmp_del[t].checked)
{
del_arr[index] = tmp_del[t].value;
index++;
}
}
if(del_arr.length == 0)
{
alert(GetElmCont("lb_0","Please choose one or more rule."));
return false;
}
for(var r=1;r<sslcc_record_index.length;r++)
{
for(var n=0;n<del_arr.length;n++)
{
if(sslcc_record_index[r] == del_arr[n])
{
sslcc_record_index[r] = "";
}
}
}
for(var a=1;a<sslcc_record_index.length;a++)
{
if(sslcc_record_index[a] != "")
{
sent_str += (sent_str == "opvpncli.htm?")?sslcc_record_csid[new_index]+"="+sslcc_record_index[a]:"&"+sslcc_record_csid[new_index]+"="+sslcc_record_index[a];
new_index++;
}
}
for(var c=new_index;c<sslcc_record_csid.length;c++)
{
sent_str += (sent_str == "opvpncli.htm?")?sslcc_record_csid[c]+"=":"&"+sslcc_record_csid[c]+"=";
}
for(var r=0;r<del_arr.length;r++)
{
var tunlname_index = del_arr[r];
sent_str += "&"+sslcc_tunlname_csid[tunlname_index]+"="
+"&"+sslcc_tunen_csid[tunlname_index]+"=0";
}
sent_str += "&_cce=0x809C000A";
GURL(sent_str);
}
function ck_MaxTuns(){
var int0 = sslcc_record_length
gobj0 = document.getElementById('tunnelno')
if(gobj0.value < int0){
alert(GetElmCont("opvpnclilang_0","Not be less than the number of currently Tunnel List has been established."));
gobj0.focus();
return false;
}
return true;
}
function cli_AUTH_MODE(obj){
var gs0_lip = document.getElementById('stacky0_lip')
var gs0_rip = document.getElementById('stacky0_rip')
var gs0_sk = document.getElementById('stacky0_sk')
var gtls1 = document.getElementById('tls1')
var gid0 = document.getElementById('tr_tls_ak')
var gid1 = document.getElementById('tr_tls_un')
var gid2 = document.getElementById('tr_tls_pw')
var gid3 = document.getElementById('tr_tls_cip')
var gid4 = document.getElementById('tr_tls_nsCV')
var gid5 = document.getElementById('tr_tls_rtime')
gs0_lip.style.display = (obj.value == 0)?"":"none";
gs0_rip.style.display = (obj.value == 0)?"":"none";
gs0_sk.style.display = (obj.value == 0)?"":"none";
gtls1.style.display = (obj.value == 1)?"":"none";
gid0.style.display = (obj.value == 1)?"":"none";
gid1.style.display = (obj.value == 1)?"":"none";
gid2.style.display = (obj.value == 1)?"":"none";
gid3.style.display = (obj.value == 1)?"":"none";
gid4.style.display = (obj.value == 1)?"":"none";
gid5.style.display = (obj.value == 1)?"":"none";
}
function setcli_AuthMode(obj){
var gobjid0 = document.getElementById('s_sslvpn_cli_tun_authmode')
var gobjid1 = document.getElementById('c_sslvpn_cli_nat_en')
/*
obj=TAP = 1 selected ,Static Key = 0 off , TLS = 1 on
obj=TUN = 0 selected ,Static Key = 0 on , TLS = 1 on
*/
if(obj.value != 0){
for(var a=0;a<gobjid0.length;a++){
if(gobjid0.options[a].value == 0){ gobjid0.options[a].disabled = true ; }
}
gobjid0.value = (gobjid0.value == 0)?1:gobjid0.value
}
else{
for(var a=0;a<gobjid0.length;a++){
if(gobjid0.options[a].value == 0){ gobjid0.options[a].disabled = false ; }
}
}
/* gobjid1.disabled = (obj.value == 0) //for h81: set NAT	 */
/*if(obj.value == 0){ //for h81: set NAT
gobjid1.checked = false;
SetCkBox(gobjid1,1,0)
}
*/
cli_AUTH_MODE(gobjid0);
setb_tapto();
setcliIP();
/* swRedir_InTraffic(); //for h81: set Redirect Internet Traffic */
}
function swRedir_InTraffic(){ //for h81: set Redirect Internet Traffic
var obj1 = document.getElementById('c_sslvpn_cli_redirect_en');
var obj2 = document.getElementById('c_remo_subnet_en');
var obj3 = document.getElementById('s_sslvpn_cli_tun_dev');
var sw1 = ((obj3.value == 0)&&(obj2.checked));
obj1.disabled =sw1;
if(sw1){
obj1.checked = false ;
SetCkBox(obj1,1,0); // C_SSLVPN_CLIENT_TUN_REDIRECT_ENABLE[%i].value =0
}
}
function setcliIP(){
var gobjid0 = document.getElementById('s_sslvpn_cli_tun_dev');
var gobjid1 = document.getElementById('s_sslvpn_cli_tun_authmode')
var gobjid2 = document.getElementById('s_sslvpn_cli_ip_type')
var gobjid3 = document.getElementById('sip')
gobjid2.disabled = ((gobjid0.value == 0) && (gobjid1.value == 0))
gobjid3.style.display = ((gobjid2.value == 1)&&(!gobjid2.disabled))?"":"none";
}
function setb_tapto(){
var gobjid0 = document.getElementById('s_sslvpn_cli_tun_dev')
var gobjid1 = document.getElementById('s_sslvpn_cli_bridge_vlan')
var gobjid2 = document.getElementById('c_sslvpn_cli_nat_en')
var gobjid3 = document.getElementById('h_sslvpn_cli_bridge_vlan')
var gobjid4 = document.getElementById('c_sslvpn_cli_firewall_en')
gobjid1.disabled = (!((!gobjid2.checked)&&(gobjid0.value==1)));
gobjid3.value = (gobjid1.disabled)?0:1;
gobjid4.disabled = (!gobjid2.checked);
}
function add_sslcc_po(obj){
var gobj0 = document.getElementById('t_sslvpn_cli_tun_port');
var gobj1 = document.getElementById('t_sslvpn_cli_udpfment');
var gobj2 = document.getElementById('c_sslvpn_cli_mss_fix_en');
if(arguments.length == 1){
gobj0.value = (obj.value == 1)?443:1194;
chkN(gobj0,'q');
}
gobj1.disabled = (obj.value == 1)
gobj2.disabled = (obj.value == 1)
}
function setdns_en(obj){
var gobj0 = document.getElementById('h_dns_auto');
var gobj1 = document.getElementById('h_dns_m');
var gobj2 = document.getElementById('dns_m_cked');
gobj0.value = (obj.value==0)?1:0;
gobj1.value = (obj.value==0)?0:1;
gobj2.style.display = (obj.value==0)?"none":"";
}
function sw_advcfig(obj,sw){
var gobj0 = document.getElementById('tb_advcfig');
var gobj1 = document.getElementById('h_advcfig');
var _sw = "none" ;
if(sw!=null){
_sw = (gobj0.style.display == "none")?'':"none";
gobj1.value = (_sw == '')?1:0;
}
else{  _sw = (obj.value == 1)?"":"none"; }
gobj0.style.display = _sw
}
function chk(obj){
var gobj0 = document.getElementById('s_sslvpn_cli_tun_authmode');
var gobj1 = document.getElementById('t_sslvpn_cli_username');
var gobj2 = document.getElementById('p_sslvpn_cli_pw');
var gobj3 = document.getElementById('t_sslvpn_cc_tname');
var gobj4 = document.getElementById('t_sslvpn_client_tun_r_sub');
var gobj5 = document.getElementById("auth_msg");
var gobj6 = document.getElementById('c_remo_subnet_en');
var hid_span = document.getElementById('h_sslvpn_client_tun_r_sub');
var str_meg = "";
var sw0 = false;
if(!((gobj1.value == "" )&&(gobj2.value == "" ))){
sw0 =(!((gobj1.value != "" )&&(gobj2.value != "" )))
}
if(gobj3.value == "" ){ str_meg = GetElmCont("opvpnclilang_0","SSL VPN Client Name can not be empty") }
else if((gobj0.value == 1)&& sw0){ str_meg = GetElmCont("opvpnclilang_0","User Name or Password can not be empty") }
else if((!gobj4.disabled)&&(gobj4.value == "" )){ str_meg = GetElmCont("opvpnclilang_0","Remote Subnet can not be empty") }
else if((gobj0.value == 1)&&(gobj5.innerHTML!='')){ str_meg = GetElmCont("_0","Please set the Certificate.") }
if(str_meg != ""){
alert(str_meg);
return false;
}
if(gobj4.disabled){ hid_span.innerHTML ="<input type=text name='"+gobj4.name+"' value='"+gobj4.value+"'>" ; }
return true;
}
function setalter(obj){
var gobj0 = document.getElementById("fr_cli")
gobj0.name = (obj.checked)?'':'N80720000'
}
function sw_remo_subnet(obj){
var obj1 = document.getElementById("t_sslvpn_client_tun_r_sub")
var obj2 = document.getElementById("s_sslvpn_client_tun_r_ms")
obj1.disabled = (!obj.checked);
obj2.disabled = (!obj.checked);
if(!obj.checked){ obj1.value = ''; clear_valchk(obj1); }
/* swRedir_InTraffic(); //for h81: set Redirect Internet Traffic */
}