function addUser()
{
    global $mainframe;
    $database =& JFactory::getDBO();
    $error_num = 0;
    cleanMessageQueue();
    if (!isset($_POST['user']) || !isset($_POST['profile'])) {
        $mainframe->redirect("index2.php?option=com_joomla_flash_uploader&act=user", JText::_('MES_MAP_NOSEL'));
    }
    foreach ($_POST['user'] as $singleuser) {
        $row = new joomla_flash_uploader_user($database);
        $row->profile = $_POST['profile'];
        $row->user = $singleuser;
        if (!$row->store()) {
            $error_num++;
        }
    }
    $row->bind($_POST);
    $_SESSION['LAST_PROFILE'] = $row->profile;
    if ($error_num > 0) {
        $mainframe->redirect("index2.php?option=com_joomla_flash_uploader&act=user", $error_num . JText::_('MES_EXISTS'));
    } else {
        $mainframe->redirect("index2.php?option=com_joomla_flash_uploader&act=user", JText::_('MES_MAP_SAVED'));
    }
}