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

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

$company = $_POST['company'];
$user = $_POST['user'];

$password = $_POST['password'];
$aliases = trim($_POST['aliases']);

if (is_company($company))
	echo "<b>{$company}</b>\n\n";
else
	die('Not a real company...');
	
create_user($company,$user,$password);

if (isset($_POST['mailinglist']))
{
	if (isset($_POST['public']))
		set_user_file($company,$user,'public','');
	else
		delete_user_file($company,$user,'public');
	set_user_file($company,$user,'outhost',$_POST['outhost']);
	set_user_file($company,$user,'outlocal',$_POST['outlocal']);
	set_user_file($company,$user,'inhost',$_POST['inhost']);
	set_user_file($company,$user,'outname',$_POST['outname']);
	set_user_mailinglist_key($company,$user);
	set_user_mailinglist_qmailfiles($company,$user);
}
$aliases = preg_split("/\s+/",$aliases,-1,PREG_SPLIT_NO_EMPTY);

$new_aliases = '';

foreach ($aliases as $a => $v)
{
	switch(substr($v,-1))
	{
		case '*':
			$new_aliases .= '+'.substr($v,0,-1)."\n";
			break;
		default:
			$new_aliases .= '='.$v."\n";
	}
}

set_user_aliases($company,$user,$new_aliases);

update_databases();

redir("show_user.php?company={$company}&user={$user}&noc=".time());

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