home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / JanaSetup.exe / admin / pruefen_js / ftp_user_anlegen.js < prev    next >
Encoding:
Text File  |  2006-05-08  |  3.5 KB  |  170 lines

  1. function pwfeld()
  2. {
  3.     if (document.formular.T1.value != '')
  4.         document.formular.T2.value = parent.header.document.dummy.feld.value;
  5. }
  6.  
  7. /**/
  8.  
  9. function send()
  10. {
  11.     if (pruefen() == true)
  12.         document.formular.submit();
  13. }
  14.  
  15. /**/
  16.  
  17. function pruefen()
  18. {
  19.     var f1 = document.formular.T1.value;
  20.     var f2 = document.formular.T2.value;
  21.     var f3 = document.formular.T3.value;
  22.     var fe = new Array('T1', 'T2');
  23.     var va = new Array('\'', '"', ',');
  24.  
  25.     for (e = 0; e < fe.length; e++)
  26.     {
  27.         for (f = 0; f < va.length; f++)
  28.         {
  29.             var ei = document.formular.elements[fe[e]];
  30.  
  31.             if (ei.value.indexOf(va[f]) != -1)
  32.             {
  33.                 alert(txt[5][7] + va[f] + txt[5][8]);
  34.                 ei.select();
  35.                 ei.focus();
  36.                 return false;
  37.             }
  38.         }
  39.     }
  40.  
  41.     if (f2 == 'ANY')
  42.     {
  43.         if (f1 == '')
  44.         {
  45.             alert(txt[19][9] + txt[33][1] + txt[33][9]);
  46.             document.formular.T1.select();
  47.             document.formular.T1.focus();
  48.             return false;
  49.         }
  50.     }
  51.     else
  52.     {
  53.         if (f1.length < 4)
  54.         {
  55.             alert(txt[19][9] + txt[33][1] + txt[33][6]);
  56.             document.formular.T1.select();
  57.             document.formular.T1.focus();
  58.             return false;
  59.         }
  60.  
  61.         if (f2.length < 4)
  62.         {
  63.             alert(txt[19][9] + txt[27][2] + txt[33][7]);
  64.             document.formular.T2.select();
  65.             document.formular.T2.focus();
  66.             return false;
  67.         }
  68.     }
  69.  
  70.     var tea = f3.split(',');
  71.     var teb = tea[0].split('\\');
  72.  
  73.     if (tea[0].charAt(tea[0].length - 1) == '\\')
  74.     {
  75.         alert(tea[0] + '\n\n' + txt[28][26]);
  76.         document.formular.T3.select();
  77.         document.formular.T3.focus();
  78.         return false;
  79.     }
  80.  
  81.     if (tea[0].substr(0, 2) != '\\\\')
  82.     {
  83.         if (/^([c-z])+([:])$/i.test(teb[0]) == false)
  84.         {
  85.             alert(teb[0] + '\n\n' + txt[28][22]);
  86.             document.formular.T3.select();
  87.             document.formular.T3.focus();
  88.             return false;
  89.         }
  90.     }
  91.  
  92.     var y = (tea[0].substr(0, 2) != '\\\\') ? 1 : 2;
  93.  
  94.     for (i = y; i < teb.length; i++)
  95.     {
  96.         if (/^([_a-z0-9- .]+)$/i.test(teb[i]) == false)
  97.         {
  98.             alert(teb[i] + '\n\n' + txt[28][23]);
  99.             document.formular.T3.select();
  100.             document.formular.T3.focus();
  101.             return false;
  102.         }
  103.     }
  104.  
  105.     if (tea.length > 1)
  106.     {
  107.         for (j = 1; j < tea.length; j++)
  108.         {
  109.             var tec = tea[j].split('=');
  110.             var ted = tec[1].split('\\');
  111.  
  112.             if ((tec[0].charAt(0) == '[') && (tec[0].charAt(tec[0].length - 1) == ']'))
  113.             {
  114.                 var tst = tec[0].substr(1, tec[0].length - 2)
  115.  
  116.                 if (/^([_a-z0-9- ]+)$/i.test(tst) == false)
  117.                 {
  118.                     alert(tst + '\n\n' + txt[28][27]);
  119.                     document.formular.T3.select();
  120.                     document.formular.T3.focus();
  121.                     return false;
  122.                 }
  123.             }
  124.             else
  125.             {
  126.                 if (/^([_a-z0-9- ]+)$/i.test(tec[0]) == false)
  127.                 {
  128.                     alert(tec[0] + '\n\n' + txt[28][27]);
  129.                     document.formular.T3.select();
  130.                     document.formular.T3.focus();
  131.                     return false;
  132.                 }
  133.             }
  134.  
  135.             if (tec[1].charAt(tec[1].length - 1) == '\\')
  136.             {
  137.                 alert(tec[1] + '\n\n' + txt[28][26]);
  138.                 document.formular.T3.select();
  139.                 document.formular.T3.focus();
  140.                 return false;
  141.             }
  142.  
  143.             if (tec[1].substr(0, 2) != '\\\\')
  144.             {
  145.                 if (/^([c-z])+([:])$/i.test(ted[0]) == false)
  146.                 {
  147.                     alert(ted[0] + '\n\n' + txt[28][22]);
  148.                     document.formular.T3.select();
  149.                     document.formular.T3.focus();
  150.                     return false;
  151.                 }
  152.             }
  153.  
  154.             var z = (tec[1].substr(0, 2) != '\\\\') ? 1 : 2;
  155.  
  156.             for (k = z; k < ted.length; k++)
  157.             {
  158.                 if (/^([_a-z0-9- .]+)$/i.test(ted[k]) == false)
  159.                 {
  160.                     alert(ted[k] + '\n\n' + txt[28][23]);
  161.                     document.formular.T3.select();
  162.                     document.formular.T3.focus();
  163.                     return false;
  164.                 }
  165.             }
  166.         }
  167.     }
  168.  
  169.     return true;
  170. }