home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / JanaSetup.exe / admin / pruefen_js / htpasswd.js < prev    next >
Encoding:
Text File  |  2006-05-08  |  899 b   |  48 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.Item.value;
  12.  
  13.     if (f1.charAt(f1.length - 1) == '\\')
  14.     {
  15.         alert(f1 + '\n\n' + txt[28][26]);
  16.         document.formular.Item.select();
  17.         document.formular.Item.focus();
  18.         return false;
  19.     }
  20.  
  21.     var tea = f1.split('\\');
  22.  
  23.     if (f1.substr(0, 2) != '\\\\')
  24.     {
  25.         if (/^([c-z])+([:])$/i.test(tea[0]) == false)
  26.         {
  27.             alert(tea[0] + '\n\n' + txt[28][22]);
  28.             document.formular.Item.select();
  29.             document.formular.Item.focus();
  30.             return false;
  31.         }
  32.     }
  33.  
  34.     var z = (f1.substr(0, 2) != '\\\\') ? 1 : 2;
  35.  
  36.     for (k = z; k < tea.length; k++)
  37.     {
  38.         if (/^([_a-z0-9- .]+)$/i.test(tea[k]) == false)
  39.         {
  40.             alert(tea[k] + '\n\n' + txt[28][23]);
  41.             document.formular.Item.select();
  42.             document.formular.Item.focus();
  43.             return false;
  44.         }
  45.     }
  46.  
  47.     return true;
  48. }