Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

carandraug

By: a guest on Sep 7th, 2011  |  syntax: HTML  |  size: 7.08 KB  |  views: 51  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3.   <head>
  4.     <title>SVN repositories - User management</title>
  5.     <meta name="generator" content="gedit 2.30.2">
  6.     <meta name="author" content="Carnë Draug">
  7.     <meta name="description" content="User management for subversion repositories">
  8.     <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
  9.     <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  10.     <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
  11.     <meta http-equiv="content-style-type" content="text/css">
  12.     <meta http-equiv="expires" content="0">
  13.  
  14.     <script type="text/javascript">
  15.       function check_new(){
  16.         // This function checks if all the fields are fit, and when they are
  17.         // good (real_check, user_check, pass_check), enables the button
  18.         var real       = document.getElementById('new_realname');
  19.         var user       = document.getElementById('new_username');
  20.         var pass1      = document.getElementById('new_password1');
  21.         var pass2      = document.getElementById('new_password2');
  22.         var msg_pass   = document.getElementById('new_password_msg');
  23.         var msg_user   = document.getElementById('new_username_msg');
  24.         var button     = document.getElementById('register');
  25.         var good_color = "#66cc66";   // good color is green
  26.         var bad_color  = "#ff6666";   // bad color is red
  27.         // Check real name field (just needs to exist)
  28.         if(real.value.length < 1){
  29.          real.style.backgroundColor  = bad_color;
  30.          var real_check              = 0;
  31.        }else{
  32.          real.style.backgroundColor  = good_color;
  33.          var real_check              = 1;
  34.        }
  35.        // Check username field
  36.        if(user.value.length < 4){
  37.          user.style.backgroundColor  = bad_color;
  38.          msg_user.innerHTML          = "At least 4 characters";
  39.          var user_check              = 0;
  40.        }else{
  41.          user.style.backgroundColor  = good_color;
  42.          msg_user.innerHTML          = "";
  43.          var user_check              = 1;
  44.        }
  45.        // Check password field
  46.        if(pass1.value.length < 4){
  47.          pass2.style.backgroundColor = bad_color;
  48.          msg_pass.innerHTML          = "At least 4 characters";
  49.          var pass_check              = 0;
  50.        } else if (pass1.value != pass2.value){
  51.          pass2.style.backgroundColor = bad_color;
  52.          msg_pass.innerHTML          = "Passwords do not match";
  53.          var pass_check              = 0;
  54.        } else {
  55.          pass2.style.backgroundColor = good_color;
  56.          msg_pass.innerHTML          = "";
  57.          var pass_check              = 1;
  58.        }
  59.        // If passes in both fields, activate the button
  60.        if (real_check && pass_check && user_check) {
  61.          button.disabled             = false;
  62.        } else {
  63.          button.disabled             = true;
  64.        }
  65.      }
  66.  
  67.      function check_old(){
  68.        // This function checks if all the fields are fit, and when they are
  69.        // good (real_check, user_check, pass_check), enables the button
  70.        var real       = document.getElementById('new_realname');
  71.        var user       = document.getElementById('change_username');
  72.        var oldpass    = document.getElementById('change_password_old');
  73.        var pass1      = document.getElementById('change_password1');
  74.        var pass2      = document.getElementById('change_password2');
  75.        var msg_pass   = document.getElementById('change_password_msg');
  76.        var msg_user   = document.getElementById('change_username_msg');
  77.        var button     = document.getElementById('change');
  78.        var good_color = "#66cc66";   // good color is green
  79.        var bad_color  = "#ff6666";   // bad color is red
  80.  
  81.      }
  82.    </script>
  83.   </head>
  84.   <body>
  85.  
  86.   <!-- It is possible to use the display property of each table to hide or shows them
  87.        
  88.         hidden     style="display:none"
  89.         visible    style="display:block"
  90.        
  91.         It is also possible to get a JavaScript to change this property
  92.        
  93.         document.getElementById(id).style.display="none"
  94.         document.getElementById(id).style.display="block"
  95.  -->
  96.  
  97.     <form method="post" action="/cgi-bin/htpasswd_new.cgi" style="display:inline">
  98.       <table summary="Register new user table" style="margin:auto">
  99.         <tr>
  100.           <td colspan="2" style="text-align:center">Register new user</td>
  101.         </tr>
  102.         <tr>
  103.           <td>Repository:</td>
  104.           <td>
  105.             <select name="repository">
  106.               <option value="ariel">Ariel</option>
  107.             </select>
  108.           </td>
  109.         </tr>
  110.         <tr>
  111.           <td>Real name:</td>
  112.           <td><input type="text" id="new_realname" name="real_name" onkeyup="check_new()"></td>
  113.         </tr>
  114.         <tr>
  115.           <td>Username:</td>
  116.           <td><input type="text" id="new_username" name="username" onkeyup="check_new()"></td>
  117.         </tr>
  118.         <tr>
  119.           <td colspan="2" id="new_username_msg" style="text-align:center"></td>
  120.         </tr>
  121.         <tr>
  122.           <td>Password:</td>
  123.           <td><input type="password" id="new_password1" name="password1" onkeyup="check_new()"></td>
  124.         </tr>
  125.         <tr>
  126.           <td>Repeat password:</td>
  127.           <td><input type="password" id="new_password2" name="password2" onkeyup="check_new()"></td>
  128.         </tr>
  129.         <tr>
  130.           <td colspan="2" id="new_password_msg" style="text-align:center"></td>
  131.         </tr>
  132.         <tr>
  133.           <td></td>
  134.           <td><input type="submit" id="register" value="Register" disabled="disabled"></td>
  135.         </tr>
  136.       </table>
  137.     </form>
  138.  
  139.     <form method="post" action="/cgi-bin/htpasswd_change.pl" style="display:inline">
  140.       <table summary="Change user password table" style="margin:auto">
  141.         <tr>
  142.           <td colspan="2" style="text-align:center">Change password</td>
  143.         </tr>
  144.         <tr>
  145.           <td>Username:</td>
  146.           <td><input type="text" id="change_username" name="username" onkeyup="check_change()"></td>
  147.         </tr>
  148.         <tr>
  149.           <td colspan="2" id="change_username_msg" style="text-align:center"></td>
  150.         </tr>
  151.         <tr>
  152.           <td>Current password:</td>
  153.           <td><input type="password" id="change_password_old" name="password_old" onkeyup="check_change()"></td>
  154.         </tr>
  155.         <tr>
  156.           <td>New password:</td>
  157.           <td><input type="password" id="change_password1" name="password1" onkeyup="check_change()"></td>
  158.         </tr>
  159.         <tr>
  160.           <td>Repeat password:</td>
  161.           <td><input type="password" id="change_password2" name="password2" onkeyup="check_change()"></td>
  162.         </tr>
  163.         <tr>
  164.           <td colspan="2" id="change_password_msg" style="text-align:center"></td>
  165.         </tr>
  166.         <tr>
  167.           <td></td>
  168.           <td><input type="submit" id="change" value="Change" disabled="disabled"></td>
  169.         </tr>
  170.       </table>
  171.     </form>
  172.  
  173.   </body>
  174. </html>