File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -519,7 +519,32 @@ function cal_panel_block(){
519
519
}
520
520
521
521
522
+ function validForm (){
523
+ var addrobj = document .form .vpn_client_addr ;
524
+ var alert_str = validator .domainName (addrobj);
525
+ if ((addrobj .value != " " ) && (alert_str != " " ) && (! validator .ipv4_addr (addrobj .value ))) {
526
+ alert (" Invalid remote server address!" );
527
+ addrobj .focus ();
528
+ return false ;
529
+ }
530
+
531
+ if (! validator .safeName (document .form .vpn_client_desc ) ||
532
+ ! validator .numberRange (document .form .vpn_client_verb , 0 , 6 ) ||
533
+ ! validator .numberRange (document .form .vpn_client_poll , 0 , 60 ) ||
534
+ ! validator .numberRange (document .form .vpn_client_reneg , - 1 , 2147483647 ) ||
535
+ ! validator .numberRange (document .form .vpn_client_retry , - 1 , 32767 ) ||
536
+ ! validator .numberRange (document .form .vpn_client_port , 1 , 65535 ))
537
+ return false ;
538
+
539
+ return true ;
540
+ }
541
+
542
+
522
543
function applyRule (manual_switch ){
544
+ if (! validForm ()){
545
+ return false ;
546
+ }
547
+
523
548
if (manual_switch == 0 ) {
524
549
showLoading ();
525
550
if (client_state != 0 ) {
@@ -702,6 +727,9 @@ function addRow_Group(upper){
702
727
return false ;
703
728
}
704
729
730
+ if (! validator .safeName (document .form .clientlist_deviceName ))
731
+ return false ;
732
+
705
733
if (document .form .clientlist_ipAddr .value == " " )
706
734
document .form .clientlist_ipAddr .value = " 0.0.0.0" ;
707
735
You can’t perform that action at this time.
0 commit comments