<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>SVN repositories - User management</title>
<meta name="generator" content="gedit 2.30.2">
<meta name="author" content="Carnë Draug">
<meta name="description" content="User management for subversion repositories">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="expires" content="0">
<script type="text/javascript">
function check_new(){
// This function checks if all the fields are fit, and when they are
// good (real_check, user_check, pass_check), enables the button
var real = document.getElementById('new_realname');
var user = document.getElementById('new_username');
var pass1 = document.getElementById('new_password1');
var pass2 = document.getElementById('new_password2');
var msg_pass = document.getElementById('new_password_msg');
var msg_user = document.getElementById('new_username_msg');
var button = document.getElementById('register');
var good_color = "#66cc66"; // good color is green
var bad_color = "#ff6666"; // bad color is red
// Check real name field (just needs to exist)
if(real.value.length < 1){
real.style.backgroundColor = bad_color;
var real_check = 0;
}else{
real.style.backgroundColor = good_color;
var real_check = 1;
}
// Check username field
if(user.value.length < 4){
user.style.backgroundColor = bad_color;
msg_user.innerHTML = "At least 4 characters";
var user_check = 0;
}else{
user.style.backgroundColor = good_color;
msg_user.innerHTML = "";
var user_check = 1;
}
// Check password field
if(pass1.value.length < 4){
pass2.style.backgroundColor = bad_color;
msg_pass.innerHTML = "At least 4 characters";
var pass_check = 0;
} else if (pass1.value != pass2.value){
pass2.style.backgroundColor = bad_color;
msg_pass.innerHTML = "Passwords do not match";
var pass_check = 0;
} else {
pass2.style.backgroundColor = good_color;
msg_pass.innerHTML = "";
var pass_check = 1;
}
// If passes in both fields, activate the button
if (real_check && pass_check && user_check) {
button.disabled = false;
} else {
button.disabled = true;
}
}
function check_old(){
// This function checks if all the fields are fit, and when they are
// good (real_check, user_check, pass_check), enables the button
var real = document.getElementById('new_realname');
var user = document.getElementById('change_username');
var oldpass = document.getElementById('change_password_old');
var pass1 = document.getElementById('change_password1');
var pass2 = document.getElementById('change_password2');
var msg_pass = document.getElementById('change_password_msg');
var msg_user = document.getElementById('change_username_msg');
var button = document.getElementById('change');
var good_color = "#66cc66"; // good color is green
var bad_color = "#ff6666"; // bad color is red
}
</script>
</head>
<body>
<!-- It is possible to use the display property of each table to hide or shows them
hidden style="display:none"
visible style="display:block"
It is also possible to get a JavaScript to change this property
document.getElementById(id).style.display="none"
document.getElementById(id).style.display="block"
-->
<form method="post" action="/cgi-bin/htpasswd_new.cgi" style="display:inline">
<table summary="Register new user table" style="margin:auto">
<tr>
<td colspan="2" style="text-align:center">Register new user</td>
</tr>
<tr>
<td>Repository:</td>
<td>
<select name="repository">
<option value="ariel">Ariel</option>
</select>
</td>
</tr>
<tr>
<td>Real name:</td>
<td><input type="text" id="new_realname" name="real_name" onkeyup="check_new()"></td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" id="new_username" name="username" onkeyup="check_new()"></td>
</tr>
<tr>
<td colspan="2" id="new_username_msg" style="text-align:center"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" id="new_password1" name="password1" onkeyup="check_new()"></td>
</tr>
<tr>
<td>Repeat password:</td>
<td><input type="password" id="new_password2" name="password2" onkeyup="check_new()"></td>
</tr>
<tr>
<td colspan="2" id="new_password_msg" style="text-align:center"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="register" value="Register" disabled="disabled"></td>
</tr>
</table>
</form>
<form method="post" action="/cgi-bin/htpasswd_change.pl" style="display:inline">
<table summary="Change user password table" style="margin:auto">
<tr>
<td colspan="2" style="text-align:center">Change password</td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" id="change_username" name="username" onkeyup="check_change()"></td>
</tr>
<tr>
<td colspan="2" id="change_username_msg" style="text-align:center"></td>
</tr>
<tr>
<td>Current password:</td>
<td><input type="password" id="change_password_old" name="password_old" onkeyup="check_change()"></td>
</tr>
<tr>
<td>New password:</td>
<td><input type="password" id="change_password1" name="password1" onkeyup="check_change()"></td>
</tr>
<tr>
<td>Repeat password:</td>
<td><input type="password" id="change_password2" name="password2" onkeyup="check_change()"></td>
</tr>
<tr>
<td colspan="2" id="change_password_msg" style="text-align:center"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="change" value="Change" disabled="disabled"></td>
</tr>
</table>
</form>
</body>
</html>