<commit_before>function submitUser()
{
	var username = document.getElementById("usernameField").value;
	var password = document.getElementById("passwordField").value;
	var password2 = document.getElementById("passwordField2").value;
	var first_name = "";
	var last_name = "";
	var name = document.getElementById("nameField").value;
	var roles = document.getElementsByName("roleField");
	var role = [];
	for (var i=0; i<roles.length; i++)
	{
		if(roles[i].checked)
		{
			role.push(roles[i].value);
		}
	}
	name = name.split(" ");
	first_name = name[0];
	last_name = name[1];
	if (username == "" || username == null || password == "" || password == <PASSWORD> || name == "" || name == null || role == "")
	{
		alert("Please fill in all the fields!");
	}
	if (password!=password2)
	{
		alert("Passwords do not match. Please retype your password.");
		throw new Error("Passwords do not match");
	}
    var token = getCookie("token");
	var toSend = {"username": username, "session": token, "password": password, "first_name": first_name, "last_name": last_name, "role": role};
	//todo in later versions: add actual validation w/ tokens
	toSend.requestType = "addUser";
	console.log(toSend);
	$.post(
	{                                                 
        url:"/cgi-bin/CSAssess/controller/request.py",                                                 
        data: toSend,
        dataType: "json",
        success: console.log("Success!")
	});
}<commit_msg>Fixed POST and removed plaintext password log to console<commit_after>function submitUser()
{
	var username = document.getElementById("usernameField").value;
	var password = document.getElementById("passwordField").value;
	var password2 = document.getElementById("passwordField2").value;
	var first_name = "";
	var last_name = "";
	var name = document.getElementById("nameField").value;
	var roles = document.getElementsByName("roleField");
	var role = [];
	for (var i=0; i<roles.length; i++)
	{
		if(roles[i].checked)
		{
			role.push(roles[i].value);
		}
	}
	name = name.split(" ");
	first_name = name[0];
	last_name = name[1];
	if (username == "" || username == null || password == "" || password == null || name == "" || name == null || role == "")
	{
		alert("Please fill in all the fields!");
	}
	if (password!=password2)
	{
		alert("Passwords do not match. Please retype your password.");
		throw new Error("Passwords do not match");
	}
    var token = getCookie("token");
	var toSend = {"username": username, "session": token, "password": password, "first_name": first_name, "last_name": last_name, "role": role};
	//todo in later versions: add actual validation w/ tokens
	toSend.requestType = "addUser";
	$.post(                        
		"/cgi-bin/CSAssess/controller/request.py",                                                 
        toSend,
        "json",
        console.log("Executed.")
	);
}
{'fraction_non_alphanumeric': 0.1616724738675958, 'fraction_numerical': 0.004181184668989547, 'mean_word_length': 3.191240875912409, 'pattern_counts': {'":': 12, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '947248', 'n_tokens_mistral': 880, 'n_tokens_neox': 855, 'n_words': 216}