home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / JanaSetup.exe / admin / pruefen_js / generelle_email_parameter.js < prev    next >
Encoding:
Text (UTF-16)  |  2006-05-08  |  15.3 KB  |  345 lines

  1. function feld_disabled()
  2. {
  3.     with (document.formular)
  4.     {
  5.         var c1 = C1.checked;
  6.         var c8 = C8.checked;
  7.         var c6 = C6.checked;
  8.         var c9 = C9.checked;
  9.  
  10.         if (c1 == true)
  11.         {
  12.             C3.checked  = false;
  13.             C3.disabled  = true;
  14.             T11.disabled = true;
  15.         }
  16.         else
  17.         {
  18.             C3.disabled  = false;
  19.             T11.disabled = false;
  20.         }
  21.  
  22.         if (c8 == true)
  23.         {
  24.             T10.disabled = false;
  25.             T13.disabled = false;
  26.         }
  27.         else
  28.         {
  29.             T10.disabled = true;
  30.             T13.disabled = true;
  31.         }
  32.  
  33.         if ((c6 == true) || (c9 == true))
  34.         {
  35.             T7.disabled = false;
  36.             T8.disabled = false;
  37.             C10.disabled = false;
  38.         }
  39.         else
  40.         {
  41.             T7.disabled = true;
  42.             T8.disabled = true;
  43.             C10.disabled = true;
  44.         }
  45.     }
  46. }
  47.  
  48. /**/
  49.  
  50. function test_email()
  51. {
  52.     var f1 = document.formular.T3;
  53.  
  54.     if (f1.value.search(/janaserver/i) != -1)
  55.     {
  56.         alert(txt[41][26]);
  57.         f1.select();
  58.         f1.focus();
  59.         return false;
  60.     }
  61.  
  62.     if (f1.value.search(/\*\*\*\*\*\*\*\*\*\*/) != -1)
  63.     {
  64.         var repl = f1.value.replace(/\*\*\*\*\*\*\*\*\*\*/, 'janaserver');
  65.         f1.value = repl;
  66.     }
  67.  
  68.     return true;
  69. }
  70.  
  71. /**/
  72.  
  73. function send()
  74. {
  75.     if ((pruefen() == true))
  76.     {
  77.         with (document.formular)
  78.         {
  79.             var c1 = C1.checked;
  80.             var c8 = C8.checked;
  81.             var c6 = C6.checked;
  82.             var c9 = C9.checked;
  83.  
  84.             C3.disabled  = false;
  85.             T11.disabled = (c1 == true) ? true : false;
  86.             T10.disabled = ((c8 == true) || (T10.value == '')) ? false : true;
  87.             T13.disabled = ((c8 == true) || (T13.value == '')) ? false : true;
  88.             T7.disabled  = ((c6 == true) || (c9 == true) || (T7.value == '')) ? false : true;
  89.             T8.disabled  = ((c6 == true) || (c9 == true) || (T8.value == '')) ? false : true;
  90.             C10.disabled = false;
  91.  
  92.             submit();
  93.         }
  94.     }
  95. }
  96.  
  97. /**/
  98.  
  99. function pruefen()
  100. {
  101.     var f1 = document.formular.T1.value;
  102.     var f2 = document.formular.T2.value;
  103.     var f3 = document.formular.T3.value;
  104.     var f4 = document.formular.T4.value;
  105.     var f5 = document.formular.T5.value;
  106.     var f6 = document.formular.T6.value;
  107.     var f7 = document.formular.T7.value;
  108.     var f8 = document.formular.T8.value;
  109.     var f9 = document.formular.T9.value;
  110.     var f11 = document.formular.T11.value;
  111.     var f12 = document.formular.T12.value;
  112.     var f13 = document.formular.T13.value;
  113.     var f14 = document.formular.T14.value;
  114.     var c1 = document.formular.C1.checked;
  115.     var c8 = document.formular.C8.checked;
  116.     var c6 = document.formular.C6.checked;
  117.     var c9 = document.formular.C9.checked;
  118.     var fe = new Array('T10');
  119.     var va = new Array('\'', '"');
  120.  
  121.     if (test_email() == false)
  122.         return false;
  123.  
  124.     for (i = 0; i < fe.length; i++)
  125.     {
  126.         for (j = 0; j < va.length; j++)
  127.         {
  128.             var ei = document.formular.elements[fe[i]];
  129.  
  130.             if (ei.value.indexOf(va[j]) != -1)
  131.             {
  132.                 alert(txt[5][7] + va[j] + txt[5][8]);
  133.                 ei.select();
  134.                 ei.focus();
  135.                 return false;
  136.             }
  137.         }
  138.     }
  139.  
  140.     var fe = new Array('T7', 'T14');
  141.     var va = new Array('\'', ',');
  142.  
  143.     for (i = 0; i < fe.length; i++)
  144.     {
  145.         for (j = 0; j < va.length; j++)
  146.         {
  147.             var ei = document.formular.elements[fe[i]];
  148.  
  149.             if (ei.value.indexOf(va[j]) != -1)
  150.             {
  151.                 alert(txt[5][7] + va[j] + txt[5][8]);
  152.                 ei.select();
  153.                 ei.focus();
  154.                 return false;
  155.             }
  156.         }
  157.     }
  158.  
  159.     if (f1.charAt(f1.length - 1) == '\\')
  160.     {
  161.         alert(f1 + '\n\n' + txt[28][26]);
  162.         document.formular.T1.select();
  163.         document.formular.T1.focus();
  164.         return false;
  165.     }
  166.  
  167.     var tea = f1.split('\\');
  168.  
  169.     if (/^([c-z])+([:])$/i.test(tea[0]) == false)
  170.     {
  171.         alert(tea[0] + '\n\n' + txt[28][22]);
  172.         document.formular.T1.select();
  173.         document.formular.T1.focus();
  174.         return false;
  175.     }
  176.  
  177.     for (k = 1; k < tea.length; k++)
  178.     {
  179.         if (/^([_a-z0-9- .]+)$/i.test(tea[k]) == false)
  180.         {
  181.             alert(tea[k] + '\n\n' + txt[28][23]);
  182.             document.formular.T1.select();
  183.             document.formular.T1.focus();
  184.             return false;
  185.         }
  186.     }
  187.  
  188.     if (f3.search(/\*\*\*\*\*\*\*\*\*\*/) == -1)
  189.     {
  190.         if (/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-áàăâåäãąāæćĉčċçďđéèĕêěëėęēğĝġģĥħíìĭîïĩįīıĵķĺľļłńňñņŋóòŏôöőõøōœĸŕřŗśŝšşťţŧúùŭûůüűũųūŵýŷÿźžżðþ]+\.)+([a-zA-Z0-9]+)$/.test(f3) == false)
  191.         {
  192.             alert(txt[41][26]);
  193.             document.formular.T3.select();
  194.             document.formular.T3.focus();
  195.             return false;
  196.         }
  197.     }
  198.  
  199.     if ((f2 != -1) && ((f2.match(/\D/) != null) || (f2 < 1)))
  200.     {
  201.         alert(txt[19][9] + txt[41][4] + ' "\t\n' + txt[41][27]);
  202.         document.formular.T2.select();
  203.         document.formular.T2.focus();
  204.         return false;
  205.     }
  206.  
  207.     if ((f4 == '') || (f4.match(/\D/) != null) || (f4 < 0) || (f4 > 3600))
  208.     {
  209.         alert(txt[19][9] + txt[41][8] + ' ... "\t\n' + txt[41][28]);
  210.         document.formular.T4.select();
  211.         document.formular.T4.focus();
  212.         return false;
  213.     }
  214.  
  215.     if ((f9 == '') || (f9.match(/\D/) != null) || (f9 < 0) || (f9 > 3600))
  216.     {
  217.         alert(txt[19][9] + txt[41][29] + ' ... "\t\n' + txt[41][28]);
  218.         document.formular.T9.select();
  219.         document.formular.T9.focus();
  220.         return false;
  221.     }
  222.  
  223.     if (c1 == true && ((f11 == '') || (f11.match(/\D/) != null) || (f11 < 0) || (f11 > 99)))
  224.     {
  225.         alert(txt[19][9] + txt[41][30] + ' ... "\t\n' + txt[41][31]);
  226.         document.formular.T11.select();
  227.         document.formular.T11.focus();
  228.         return false;
  229.     }
  230.  
  231.     if (f12.indexOf('\'') != -1)
  232.     {
  233.         alert(txt[5][7] + '  \'  ' + txt[5][8]);
  234.         document.formular.T12.select();
  235.         document.formular.T12.focus();
  236.         return false;
  237.     }
  238.  
  239.     if ((f5 == '') || (f5.match(/\D/) != null) || (f5 < 0) || (f5 > 3600))
  240.     {
  241.         alert(txt[19][9] + txt[41][16] + ' "\t\n' + txt[41][28]);
  242.         document.formular.T5.select();
  243.         document.formular.T5.focus();
  244.         return false;
  245.     }
  246.  
  247.     if ((f6 == '') || (f6.match(/\D/) != null) || (f6 < 0) || (f6 > 3600))
  248.     {
  249.         alert(txt[19][9] + txt[41][32] + ' "\t\n' + txt[41][28]);
  250.         document.formular.T6.select();
  251.         document.formular.T6.focus();
  252.         return false;
  253.     }
  254.  
  255.     if ((c8 == true) && (f13 != ''))
  256.     {
  257.         var test = f13.split(',');
  258.  
  259.         for (i = 0; i < test.length; i++)
  260.         {
  261.             var ip = test[i].split('.');
  262.  
  263.             for (k = 0; k < ip.length; k++)
  264.             {
  265.                 if ((test[i] == '255.255.255.255') || (ip.length != 4) || (ip[k] == '') || (ip[k].match(/\D/) != null) || (ip[k] < 0) || (ip[k] > 255))
  266.                 {
  267.                     alert('\t' + test[i] + '\t\n\n' + txt[18][27]);
  268.                     document.formular.T13.select();
  269.                     document.formular.T13.focus();
  270.                     return false;
  271.                 }
  272.             }
  273.         }
  274.     }
  275.  
  276.     if ((c6 == true) || (c9 == true))
  277.     {
  278.         if (f7.indexOf('"') != -1)
  279.             var ganz = (f7.match(/\"/g).length) % 2;
  280.         else
  281.             var ganz = 0;
  282.  
  283.         if (ganz != 0)
  284.         {
  285.             alert(txt[20][43]);
  286.             document.formular.T7.select();
  287.             document.formular.T7.focus();
  288.             return false;
  289.         }
  290.         else
  291.         {
  292.             var z   = (f7.charAt(0) != '"') ? 0 : 1;
  293.             var LW1 = f7.charAt(z);
  294.             var LW2 = f7.substr((1 + z), 2);
  295.  
  296.             if (((f7.substr(z, 2) != '\\\\') && ((/^([c-z])$/i.test(LW1) != true) || (LW2 != ':\\'))) || (f7.indexOf('.') == -1))
  297.             {
  298.                 alert(txt[19][9] + txt[41][33] + txt[20][37]);
  299.                 document.formular.T7.select();
  300.                 document.formular.T7.focus();
  301.                 return false;
  302.             }
  303.         }
  304.  
  305.         if ((f8 == '') || (f8.match(/\D/) != null))
  306.         {
  307.             alert(txt[19][9] + txt[41][34]);
  308.             document.formular.T8.select();
  309.             document.formular.T8.focus();
  310.             return false;
  311.         }
  312.     }
  313.  
  314.     if (f14 != '')
  315.     {
  316.         if (f14.indexOf('"') != -1)
  317.             var ganz = (f14.match(/\"/g).length) % 2;
  318.         else
  319.             var ganz = 0;
  320.  
  321.         if (ganz != 0)
  322.         {
  323.             alert(txt[20][43]);
  324.             document.formular.T14.select();
  325.             document.formular.T14.focus();
  326.             return false;
  327.         }
  328.         else
  329.         {
  330.             var z   = (f14.charAt(0) != '"') ? 0 : 1;
  331.             var LW1 = f14.charAt(z);
  332.             var LW2 = f14.substr((1 + z), 2);
  333.  
  334.             if (((f14.substr(z, 2) != '\\\\') && ((/^([c-z])$/i.test(LW1) != true) || (LW2 != ':\\'))) || (f14.indexOf('.') == -1))
  335.             {
  336.                 alert(txt[19][9] + txt[41][33] + txt[20][37]);
  337.                 document.formular.T14.select();
  338.                 document.formular.T14.focus();
  339.                 return false;
  340.             }
  341.         }
  342.     }
  343.  
  344.     return true;
  345. }