Location: PHPKode > projects > FladsClassifieds > fladsclassifieds-full_091201/user_utility/admin_user.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<title>FladsClassifieds - User utility</title>

<!-- JQuery -->
<script type="text/javascript" src="./jquery.js"></script>
<!-- jQuery validation plug-in and its additional methods  -->
<script type="text/javascript" src="./jquery.validate.js"></script>
<script type="text/javascript" src="./additional-methods.js"></script>

<!-- FL's additional methods -->
<script type="text/javascript" src="./FL-additional-methods.js"></script>

<!-- jslib's crypto (provides md5 hashing) -->
<script type="text/javascript" src="./crypto.js"></script>

<script type="text/javascript">
//<![CDATA[
$.validator.setDefaults({
	submitHandler: function() {
		var dnow = new Date();
		var inow = Math.floor(Number(dnow)/1000);
		var enc_password = calculerMD5($("#password").val());
		var update_str = "<code>UPDATE `users` SET `username` = '" + $("#username").val() +
			"', `password` = '" + enc_password +
			"', `modified` = '" + inow +			
			"' WHERE `id` = '1' AND `level`= '50'</code>";
		$("#db_update").html("Below is the SQL statement to update the first admin user");
		$("#db_update").after(update_str);
		$("#db_update").after("<div>Please use your database administration tool to run this SQL statement.<br />&nbsp;</div>");
	}
});

$(document).ready(function(){
$("#formid").validate({
	rules: {
		username: {
			required: true,
			minlength: 6,
			maxlength: 20,
			alpha_dash: true
		},
		password: {
			required: true,
			minlength: 8,
			maxlength: 15
		},
		password_confirm: {
			required: true,
			equalTo: "#password"
		}
	},
	messages: {
		username: {
			required: "<p>The Username field is required.<\/p>",
			minlength: "<p>The Username field must be at least 6 characters in length.<\/p>",
			maxlength: "<p>The Username field can not exceed 20 characters in length.<\/p>",
			alpha_dash: "<p>The Username field may only contain alpha-numeric characters, underscores, and dashes.<\/p>"
		},
		password: {
			required: "<p>The Password field is required.<\/p>",
			minlength: "<p>The Password field must be at least 8 characters in length.<\/p>",
			maxlength: "<p>The Password field can not exceed 15 characters in length.<\/p>"
		},
		password_confirm: {
			required: "<p>The Password confirmation field is required.<\/p>",
			equalTo: "<p>The Password confirmation field does not match the password field.<\/p>"
		}
	},
	errorLabelContainer: $("#formid div.note")
});

});
//]]>
</script>
<link rel="stylesheet" type="text/css" href="./style.css" />
</head>
<body>

<div id="logo">
	<div style="float: right; font-size: smaller">
</div>
	<div>
		<img src="./flads_logo.jpg" border="0" alt="This site uses FladsClassifieds"  width="240" height="31" />	</div>
	<div style="clear: both; font-size: 2px">
		&nbsp;
	</div>

<div class="page">

<h1>User Utility</h1>

</div>
<div class="page">
<form action="" method="post" id="formid">
<label for="username">Username</label>
<input type="text" name="username" id="username" value="" size="50" />

<label for="password">Password</label>
<input type="password" name="password" id="password" value="" size="50" />

<label for="password_confirm">Password confirmation</label>
<input type="password" name="password_confirm" id="password_confirm" value="" size="50" />

<div class="submit"><input type="submit" name="go" id ="go" value="Submit" /></div>

<div class="note" style="display: none">
</div>

</form>

<h2 id="db_update"></h2>

</div>

<div class="footer">
<div style="float: right">
<a href="http://fladsclassified.sourceforge.net/">
<img src="./small_logo.gif" border="0" alt="FladsClassifieds"  width="104" height="22" />
</a>
</div>
</body>
</html>
Return current item: FladsClassifieds