<?php
if (isset($_REQUEST['selectedUser'])) {
$selectedUser = intval($_REQUEST['selectedUser']);
$newUser = intval($_REQUEST['newUser']);
if (isset($_REQUEST['confirm'])) {
$update[0]['action'] = "delete";
$update[0]['tableName'] = "users";
$update[0]['uniqueRow'] = "uid";
$update[0]['rowid'] = $selectedUser;
$update[1]['action'] = "change";
$update[1]['tableName'] = "tickets";
$update[1]['uniqueRow'] = "owner";
$update[1]['rowid'] = $selectedUser;
$update[1]['modify'][0]['fieldName'] = "owner";
$update[1]['modify'][0]['fieldValue'] = $newUser;
$update[2]['action'] = "change";
$update[2]['tableName'] = "tickets";
$update[2]['uniqueRow'] = "creator";
$update[2]['rowid'] = $selectedUser;
$update[2]['modify'][0]['fieldName'] = "creator";
$update[2]['modify'][0]['fieldValue'] = $newUser;
$bugDatabase->alterDb($update);
if (!$options['norefresh']) {
header("Location: {$options['baseURL']}?area=admin&action=uedit");
}
}
$userName = htmlentities($bugDatabase->lists['user'][$selectedUser]['name']);
}
?>