Diff for /rat/client/parameter.html between versions 1.71.2.2 and 1.71.4.1

version 1.71.2.2, 2019/03/02 16:25:56 version 1.71.4.1, 2017/06/21 19:55:03
Line 440  function stringeval() { Line 440  function stringeval() {
    draw();     draw();
 }  }
   
 function ipstringeval() {  
     var patternIp = /^([\[\]a-zA-Z\.\d\*\-]+)$/;  
     var acctypes = new Array;  
     acctypes = ['allow','deny'];  
     svalue = '';  
     for (var i=0; i<acctypes.length; i++) {  
         var items = choices.document.getElementsByName('setip'+acctypes[i]);  
         if (items.length > 0) {  
             for (var j=0; j<items.length; j++) {  
                 if (items[j].type == "text") {  
                     var possip = items[j].value;  
                     possip = possip.replace(/^\s+|\s+$/g,'');  
                     if (patternIp.test(possip)) {  
                         if (acctypes[i] == 'deny') {  
                             possip = '!'+possip;  
                         }  
                         if (svalue == '') {  
                             svalue = possip;  
                         } else {  
                             svalue += ','+possip;  
                         }  
                     }  
                 }  
             }  
         }  
     }  
 }  
   
 function addIpRule(iptype) {  
     var frame = window.frames["choices"];  
     if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {  
         var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);  
         var count = innerDiv.childNodes.length  
         var ipDiv = frame.document.createElement('div');  
         ipDiv.innerHTML = '<input type="text" size="10" name="setip'+iptype+'" onblur="parent.ipstringeval();" />'+  
                           '<a href="#" onclick="parent.removeIpRule(\''+iptype+'\',\''+count+'\')">Remove</a>';  
         frame.document.getElementById('LC_string_ipacc_inner_'+iptype).appendChild(ipDiv);  
     }  
     return false;  
 }  
   
 function removeIpRule(iptype,num) {  
     var frame = window.frames["choices"];  
     if (frame.document.getElementById('LC_string_ipacc_inner_'+iptype)) {  
         var innerDiv = frame.document.getElementById('LC_string_ipacc_inner_'+iptype);  
         for (var i=0; i<innerDiv.childNodes.length; i++) {  
             if (i==num) {  
                 innerDiv.removeChild(innerDiv.childNodes[i]);  
                 ipstringeval();  
                 break;  
             }  
         }  
     }  
 }  
   
 function radiostringeval(newval) {  function radiostringeval(newval) {
    svalue=newval;     svalue=newval;
    draw();     draw();
Line 545  function draw() { Line 490  function draw() {
       choicewrite(' action="javascript:floateval();"');        choicewrite(' action="javascript:floateval();"');
    }     }
    if (ptype=='string') {     if (ptype=='string') {
       if (pscat == 'ip') {        choicewrite(' action="javascript:stringeval();"');
           choicewrite(' action="javascript:ipstringeval();"');  
       } else {  
           choicewrite(' action="javascript:stringeval();"');  
       }  
    }     }
    if (ptype != 'int' && ptype != 'float' && ptype != 'string') {     if (ptype != 'int' && ptype != 'float' && ptype != 'string') {
        choicewrite(' action=""');         choicewrite(' action=""');
Line 900  function draw() { Line 841  function draw() {
            choicewrite(' /> No</label><br />');             choicewrite(' /> No</label><br />');
         }          }
         if (pscat=='ip') {          if (pscat=='ip') {
             var currallow = new Array;             tablestart('IP Number/Name');
             var currdeny = new Array;     choicewrite('<tr><td>Value:</td><td colspan="2">');
             if ((svalue != '') && (svalue != null)) {             choicewrite('<input name="stringval" size="20" value="'+escapeHTML(svalue)+
                 var patternComma = /,/;                      '" onchange="parent.stringeval()" />');
                 var patternAllow = /^([\[\]a-zA-Z\.\d\*\-]+)$/;  
                 var patternDeny = /^\!([\[\]a-zA-Z\.\d\*\-]+)$/;  
                 var current = new Array;  
                 if (patternComma.test(svalue)) {   
                     current = svalue.split(',');  
                 } else {  
                     current = [svalue];  
                 }  
                 for (var i=0; i<current.length; i++) {  
                     if (patternDeny.test(current[i])) {  
                         var denied = current[i].replace(/^!/,'');  
                         currdeny.push(denied);  
                     } else {  
                         if (patternAllow.test(current[i])) {  
                             currallow.push(current[i]);  
                         }  
                     }  
                 }  
             }  
             if (currdeny.length == 0) {  
                 currdeny = ('');  
             }  
             if (currallow.length == 0) {  
                 currallow = ('');  
             }  
             var curripaccess = [currallow,currdeny];  
             tablestart('IP Number/Name');  
             choicewrite('<tr><th>Allow from</th><th>Deny from</th></tr><tr>');  
             var acctypes = ['allow','deny'];  
             for (var i=0; i<acctypes.length; i++) {  
                 choicewrite('<td valign="top">'+  
                             '<div class="LC_string_ipacc_wrap" id="LC_string_ipacc_'+acctypes[i]+'">'+  
                             '<div class="LC_string_ipacc_inner" id="LC_string_ipacc_inner_'+acctypes[i]+'">');  
                 for (var j=0; j<curripaccess[i].length; j++) {  
                     choicewrite('<div><input type="text" size="10" name="setip'+acctypes[i]+'" value="'+curripaccess[i][j]+'" onblur="parent.ipstringeval();" />');  
                     choicewrite('<a href="#" onclick="parent.removeIpRule(\''+acctypes[i]+'\',\''+j+'\')">Remove</a>');  
                     choicewrite('</div>');  
                 }  
                 choicewrite('</div><button onclick="parent.addIpRule(\''+acctypes[i]+'\');">Add item</button>');  
             }  
             choicewrite('</div></td></tr></table>');  
         }          }
         if (pscat=='fileext') {          if (pscat=='fileext') {
             tablestart('Allowed File Extensions');              tablestart('Allowed File Extensions');

Removed from v.1.71.2.2  
changed lines
  Added in v.1.71.4.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>