Location: PHPKode > projects > O - OpenSource GroupWare > osgw/users/password.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/
/*$Id: password.php,v 1.10 2003/12/08 05:30:18 rthomp Exp $*/
include("./data.php");
$service['add_header'] = TRUE;
include("../config.inc.php");
include($here. "/class.preferences.php");
$prefs = new preferences;
echo $layout->page_header;
echo $layout->service_header($text['service_name'], $prefs->nav_buttons(), $text['change_password']);

if(isset($_POST['update_password']))
{
	

	if($security->update_password($_POST))
	{
		$flag = TRUE;
		echo "Password successfully updated";
	} else {
		#echo $password_update_fail;
		echo "Failed to update password";
		$flag = FALSE;
	}

}
?>
<script>
	function check_passwords(form_data)
	{
	
		if(form_data.new_password.value != form_data.confirm_password.value)
		{
			alert('<?php echo $passwords_dont_match?>');
			return false;
		} else {
			return true;
		}

	}
</script>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" onSubmit="return check_passwords(this)">

<table style="width:325px;border:1px solid black;padding:0px" align="center">
<tr>
	<td class="input_header" width="150">Old Password:</td>
	<td align="right"><input type="password" name="old_password" id="dark_text" value="" size="25"></td>
</tr>
<tr>
	<td class="input_header" width="150">New Password:</td>
	<td align="right"><input type="password" name="new_password" id="dark_text" value="" size="25"></td>
</tr>
<tr>
	<td class="input_header" width="150">Confirm Password:</td>
	<td align="right"><input type="password" name="confirm_password" id="dark_text" value="" size="25"></td>
</tr>
<tr>
	<td width="150"><input type="submit" value="Update Password" name="update_password" class="button1"></td>
	<td align="left"><input type="submit" value="Cancel" name="cancel" class="button1"></td>
</tr>

</table>
</form>

<?php echo $layout->create_footer();?>
Return current item: O - OpenSource GroupWare