Location: PHPKode > projects > Ptk-forensics > ptk/lib/settings.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("header.php");
?>
<?include("message.php");?>
<link rel="stylesheet" type="text/css" href="../css/timeline_table.css"/>
<img src="../img/settings.png" style="vertical-align:text-bottom"> <b>Application settings</b>

<div id="tab_view">

<?if($_SESSION['user']=='admin'){
	$inv_token = md5(uniqid(rand(), TRUE));
        $_SESSION['inv_token'] = $inv_token;
        $_SESSION['inv_token_time'] = time();
 	$log_token = md5(uniqid(rand(), TRUE));
        $_SESSION['log_token'] = $log_token;
?>
	<!--***********************************************
	Investigators settings
	************************************************-->
	<div class="dhtmlgoodies_aTab" style="border:1px solid #919b9c;">
		<div id="add_content" onclick="displayMessage('modal_investigator.php', '365', '335');return false"  title="Add new investigator">
			<img src="../img/add.png" style="vertical-align:text-bottom"><b> Add</b>
		</div>		
	<?$user=array(); $user=user_list();?>
		<table class='users'>
			<th>Username</th>
			<th>Name</th>
			<th>Surname</th>
			<th>Primary mail</th>
			<th>Secondary mail</th>
			<th>Phone</th>
			<th>Mobile</th>
			<th></th>
		<?for($i=0;$i<sizeof($user);$i++){
			if($i%2==0){?>
				<tr onmouseover="showPanel(<?echo $i;?>)" onmouseout="hidePanel(<?echo $i;?>)">
			<?}else{?>
				<tr class="odd" onmouseover="showPanel(<?echo $i;?>)" onmouseout="hidePanel(<?echo $i;?>)">
			<?}?>
			<td><?echo stripslashes(stripslashes(sanitize($user[$i]['username'],PARANOID)));?></td>
			<td><?echo stripslashes(stripslashes(sanitize($user[$i]['name'],PARANOID)));?></td>
			<td><?echo stripslashes(stripslashes(sanitize($user[$i]['surname'],PARANOID)));?></td>
			<td><?echo stripslashes(stripslashes(sanitize($user[$i]['mail1'],PARANOID)));?></td>
			<td><?echo stripslashes(stripslashes(sanitize($user[$i]['mail2'],PARANOID)));?></td>
			<td style="width: 100px"><?echo stripslashes(stripslashes(sanitize($user[$i]['phone1'],PARANOID)));?></td>
			<td style="width: 100px"><?echo stripslashes(stripslashes(sanitize($user[$i]['phone2'],PARANOID)));?></td>
			<td style="text-align: center; width: 50px">
				<?if ($user[$i]['is_locked']==1){?>			
				<img src="../img/lock.png" title="Unlock investigator" onclick="if(confirmSubmit()) location.href = 'lock_investigator.php?id=<?echo $user[$i]['id'];?>&tk=<?=$inv_token?>'">
				<?}else{?>
				<div id="panel<?echo $i;?>" style="display:none">			
					<?if($user[$i]['username']!='admin'){?>
					<img src="../img/lock.png" title="Lock investigator" onclick="if(confirmSubmit()) location.href = 'lock_investigator.php?id=<?echo $user[$i]['id'];?>&tk=<?=$inv_token?>'">
					<?}?>
					<img src="../img/edit.png" title="Edit investigator's details" onclick="displayMessage('modal_update_investigator.php?id=<?echo $user[$i]['id'];?>&tk=<?=$inv_token?>', '390', '335');return false">
				</div>
				<?}?>
			</td>
			</tr>
		<?}?>
		</table>
	</div>
	<!--***********************************************
	Logging settings
	************************************************-->	
	<div class="dhtmlgoodies_aTab" style="border:1px solid #919b9c;">
		<?$log = get_log_list();?>
		<b>Log</b>
		<div style="float:left; border:1px solid grey; height:80%; padding:5px; width:100px;font-size:8pt;overflow:auto">
		<?foreach($log as $log){?>
			<tag style="cursor:pointer" onclick="document.getElementById('title_div').style.display='inline'; document.getElementById('title').innerHTML='<?=$log;?>'; ajax_request('get_log.php?tk=<?=$log_token?>&path=<?=$log;?>&sort=0', 'log_content')"><?=$log;?></tag><br>
		<?}?>
		</div>
		<tag id="title_div" style="display:none">
			<b style="margin-left:95px">Events in <tag id="title"></tag></b>&nbsp;&nbsp;
			<button style="font-size:8pt;vertical-align:top" id="export_log" onclick="window.location='get_log.php?tk=<?=$log_token?>&path='+document.getElementById('title').innerHTML+'&type=export'"  title="Export log file">Export</button>
		</tag>
		<div id="log_content" style="float:left; width:85%; height:83%;overflow:auto;margin-left:10px;">
		</div>
	</div>

<?}else{?>
	<!--***********************************************
	Profile settings
	************************************************-->	
	<div class="dhtmlgoodies_aTab" style="border:1px solid #919b9c;">
		<?
		$user_id = user_id( mysql_real_escape_string($_SESSION['user']));
		$user = user_info($user_id);
		?>
		<br>
		<div style="float: left; margin-left: 20px">
			<img src="../img/unknown.jpg" class="user" >
			<br>
			<button style="margin-top: 10px" onclick="displayMessage('modal_update_profile.php?id=<?echo $user['id'];?>', '370', '400');return false">Edit profile</button>
		</div>
		<table style="float: left; font-size:10pt; margin-left: 20px">
			<tr><td><b>Username:</b></td><td><?=stripslashes(stripslashes(sanitize(RemoveXSS($user['username']),PARANOID)));?></td></tr>
			<tr><td><b>Name:</b></td><td><?=stripslashes(stripslashes(sanitize(RemoveXSS($user['name']),PARANOID)));?></td></tr>
			<tr><td><b>Surname:</b></td><td><?=stripslashes(stripslashes(sanitize(RemoveXSS($user['surname']),PARANOID)));?></td></tr>
			<tr><td><b>Primary mail:</b></td><td><?=stripslashes(stripslashes(sanitize(RemoveXSS($user['mail1']),PARANOID)));?></td></tr>
			<tr><td><b>Secondary mail:</b></td><td><?=stripslashes(stripslashes(sanitize(RemoveXSS($user['mail2']),PARANOID)));?></td></tr>
			<tr><td><b>Primary phone:</b></td><td><?=stripslashes(stripslashes(sanitize(RemoveXSS($user['phone1']),PARANOID)));?></td></tr>
			<tr><td><b>Secondary phone:</b></td><td><?=stripslashes(stripslashes(RemoveXSS($user['phone2'])));?></td></tr>
		</table>		
	</div>	
<?}?>
	
</div>

<?if(isset($_GET['update'])){
	$active = 1;
}else{
	$active = 0;
}?>

<?if($_SESSION['user']=='admin'){?>
<script type="text/javascript">
initTabs('tab_view',Array('Investigators','Logging'),<?=$active?>,"100%","88%",Array(false,false));
</script>
<?}else{?>
<script type="text/javascript">
initTabs('tab_view',Array('My profile'),<?=$active?>,"100%","85%",Array(false));
</script>
<?}?>

<?include("footer.php");?>
Return current item: Ptk-forensics