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

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