Location: PHPKode > projects > Ptk-forensics > ptk/lib/modal_update_profile.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("lib_std.php");
include("sanitize.php");
include("loggerClass.php");
$id = sanitize($_GET['id'],INT);
$user = user_info($id);
if (($_SESSION['user'] != $user['username']) && $_SESSION['user']!='admin') {
	new AuditLog('Unauthorized access to modal_update_profile ');
        header("location: goto_home.php");
}else{
	$inv_token = md5(uniqid(rand(), TRUE));
	$_SESSION['inv_token'] = $inv_token;
	$_SESSION['inv_token_time'] = time();
?>
<b style="float:left"><?echo $user['username']?> - Edit your profile</b>
<img style="float:right; cursor: pointer" src="../img/cancel.png" onclick="closeMessage()">
<br><hr>
<form method="post" action="update_profile.php" name="myform" onsubmit="return(checkInvestigator('update_self'))">
	<table class="form">
		<input type="hidden" id="username" name="username" value="<?echo $user['username']?>">
		<input type=hidden name=ptktoken VALUE="<?=$inv_token?>"/>
		<tr><td>*Name: </td><td> <input name="name" id="name" style="width:220px" value="<?echo RemoveXSS(stripslashes($user['name']))?>"></td></tr>
		<tr><td>*Surname: </td><td> <input name="surname" id="surname" style="width:220px" value="<?echo RemoveXSS(stripslashes($user['surname']))?>"></td></tr>
		<tr><td>*Primary mail: </td><td> <input name="mail1" id="mail1" style="width:220px" value="<?echo RemoveXSS(stripslashes($user['mail1']))?>"></td></tr>
		<tr><td>Secondary mail: &nbsp;&nbsp;&nbsp;</td><td> <input name="mail2" style="width:220px" value="<?echo RemoveXSS(stripslashes($user['mail2']))?>"></td></tr>
		<tr><td>*Phone: </td><td> <input name="phone1" id="phone1" style="width:220px" value="<?echo RemoveXSS(stripslashes($user['phone1']))?>"></td></tr>
		<tr><td>Mobile: </td><td> <input name="phone2" style="width:220px" value="<?echo RemoveXSS(stripslashes($user['phone2']))?>"></td></tr>		
		<tr><td></td></tr>
		<tr><td></td></tr>
		<tr><td></td><td style="text-align: right"><input type="submit" value="Save"></td></tr>
	</table>
</form>

<hr>

<form method="post" action="update_profile_password.php" name="myform" onsubmit="return(check_update_password())">
	<table class="form">
		<input type="hidden" id="username" name="username" value="<?echo $user['username']?>">
		<input type=hidden name=ptktoken VALUE="<?=$inv_token?>"/>
		<tr><td>*Old password: </td><td> <input type="password" autocomplete="off" name="password0" id="password0" style="width:220px"></td></tr>
		<tr><td>*New password: </td><td> <input type="password" autocomplete="off" name="password1" id="password1" style="width:220px"></td></tr>
		<tr><td>*Confirm password: </td><td> <input type="password" name="password2" id="password2" style="width:220px"></td></tr>
		<tr><td></td></tr>
		<tr><td></td></tr>
		<tr><td></td><td style="text-align: right"><input type="submit" value="Save"></td></tr>		
	</table>
</form>

<script type="text/javascript">
document.myform.name.focus();
</script>	
<?}?>
Return current item: Ptk-forensics