Exemple #1
0
/**
 * function called when you submit while editing a group
 * @param $postArr $_POST array of the page
 */
function _mail_changeGroup($postArr)
{
    $group = $postArr["groupname"];
    if (hasZarafaSupport($group)) {
        setZarafaGroup($postArr["groupname"], isset($postArr["zarafaGroup"]));
    }
    if (!empty($postArr["mailgroupaccess"])) {
        $mail = $postArr["mailgroupalias"];
        if (hasVDomainSupport()) {
            $vdomain = $postArr["maildomain"];
            $mail .= "@" . $vdomain;
        }
        addMailGroup($group, $mail);
        syncMailGroupAliases($group);
    } else {
        // mail group access is not checked
        if (hasGroupMailObjectClass($group)) {
            deleteMailGroupAliases($group);
            removeMailGroup($group);
        }
    }
}
Exemple #2
0
/**
 * function called when you submit while editing a group
 * @param $postArr $_POST array of the page
 */
function _mail_changeGroup($postArr)
{
    $group = $postArr["groupname"];
    if (hasZarafaSupport($group)) {
        setZarafaGroup($postArr["groupname"], isset($postArr["zarafaGroup"]));
    }
    if (!empty($postArr["mailgroupaccess"])) {
        $mail = $postArr["mailgroupalias"];
        if (hasVDomainSupport()) {
            $vdomain = $postArr["maildomain"];
            if (!$vdomain) {
                $mail = false;
            } else {
                $mail .= "@" . $vdomain;
            }
        }
        if ($mail) {
            addMailGroup($group, $mail);
            syncMailGroupAliases($group);
            $mailhidden = false;
            if ($postArr["mailhidden"] == "on") {
                $mailhidden = true;
            }
            changeMailGroupHidden($group, $mailhidden);
            return true;
        } else {
            new NotifyWidgetFailure(_T("Mail domain is empty. Group mail alias wasn't set."));
            return false;
        }
    } else {
        // mail group access is not checked
        if (hasGroupMailObjectClass($group)) {
            deleteMailGroupAliases($group);
            removeMailGroup($group);
        }
    }
    return true;
}