<?php
require_once('inc/base.php');
require_once('useraccounts.php');
require_role(array(ROLE_CUSTOMER, ROLE_SYSTEMUSER));
title("System-Benutzeraccounts");
$section = "systemuser_account";
$account = NULL;
$role = $_SESSION['role'];
if ($role & ROLE_CUSTOMER)
{
$account = get_account_details($_GET['uid']);
}
else
{
$account = get_account_details($_SESSION['userinfo']['uid'], $_SESSION['userinfo']['customerno']);
}
headline("Bearbeiten von Benutzer »{$account['username']}«");
#if (customer_useraccount($account['uid']))
# system_failure('Aus Sicherheitsgründen können Sie diesen Account nicht ändern!');
$shells = available_shells();
$defaultname = ($account['name'] ? '' : 'checked="checked" ');
$nondefaultname = ($account['name'] ? 'checked="checked" ' : '');
$customerquota = get_customer_quota();
$maxquota = $customerquota['max'] - $customerquota['assigned'] + $account['quota'];
$customer = get_customer_info($_SESSION['userinfo']['customerno']);
if ($role & ROLE_CUSTOMER)
$customer = $_SESSION['customerinfo'];
$form = '
<h5>Name (E-Mail-Absender, ...)</h5>
<div style="margin-left: 2em;">
<p><input type="radio" name="defaultname" id="defaultname" value="1" '.$defaultname.'/> <label for="defaultname">Kundenname: <strong>'.$customer['name'].'</strong></label></p>
<p><input type="radio" name="defaultname" id="nondefaultname" value="0" '.$nondefaultname.'/> <label for="nondefaultname">Abweichend:</label> <input type="text" name="fullname" id="fullname" value="'.$account['name'].'" /></p>
</div>
';
if ($role & ROLE_CUSTOMER)