Location: PHPKode > projects > Phpqadmin > phpqadmin-0.4/show_user.php
<?php

require_once('include/functions.php');
@include('include/top.php');

$company = $_GET['company'];

if (!is_company($company))
	die('Not a real company...');
	
$user = $_GET['user'];

$mailinglist = (!is_user($company,$user) && isset($_POST['mailinglist'])) || (is_user_mailinglist($company,$user));

if (!is_user($company,$user))
	echo "<b>New user</b>\n";
if(!$mailinglist){?><form action="update_user.php" method="POST"><input type="hidden" name="company" value="<?php echo($company)?>"><?php if(!is_user($company,$user)) echo("Username:\n");?><input type="<?php echo((is_user($company,$user))?'hidden':'text');?>" name="user" value="<?php echo($user);?>">
Aliases:
<textarea name="aliases" rows=15 cols=40><?php
$aliases = get_user_aliases($company,$user);
if (is_array($aliases))
	foreach ($aliases as $ak => $av)
	{
		$av = trim($av);
		switch(substr($av,0,1))
		{
			case '+':
				echo substr($av,1)."*\n";
				break;
			default:
				echo substr($av,1)."\n";
		}
	}
?></textarea>
Password:
<input type="password" name="password">
<input type="submit" value="Save">
</form>
<?php } else {?>
<form action="update_user.php" method="POST"><input type="hidden" name="company" value="<?php echo($company)?>"><?php if(!is_user($company,$user)) echo("Username:\n");?><input type="<?php echo((is_user($company,$user))?'hidden':'text');?>" name="user" value="<?php echo($user);?>">
<b>This is a mailinglist</b><input type="hidden" name="mailinglist" value="1">
<input type="checkbox" name="public" value="1" <?php echo checked(get_user_file($company,$user,'public',false));?>> Public
Incoming host:
<input type="text" name="inhost" value="<?php echo get_user_file($company,$user,'inhost'); ?>">
Outgoing name:
<input type="text" name="outname" value="<?php echo get_user_file($company,$user,'outname'); ?>">
Outgoing account:
<input type="text" name="outlocal" value="<?php echo get_user_file($company,$user,'outlocal'); ?>">
Outgoing domain:
<input type="text" name="outhost" value="<?php echo get_user_file($company,$user,'outhost'); ?>">
Password:
<input type="password" name="password">
<input type="submit" value="Save">
</form>
<b>Edit files:</b>
<?php

$files = array('bottom','bounce-bottom','bounce-num','bounce-probe','bounce-warn','get-bad','help','sub-bad','sub-confirm','sub-nop','sub-ok','top','unsub-bad','unsub-confirm','unsub-nop','unsub-ok');

foreach ($files as $k => $v)
{
	echo '<a href="show_list_file.php?company='.$company.'&user='.$user.'&file='.$v.'">'.$v.'</a>'."\n";
}


?> 

<?php } ?>
<?
@include('include/bottom.php');
?>
Return current item: Phpqadmin