예제 #1
0
function ApplyConfigMbx()
{
    $artica = new artica_general();
    $tpl = new templates();
    if ($artica->RelayType == "single") {
        echo $tpl->_parse_body(Infos('mailbox_main_settings', 'feature_disabled'));
        exit;
    }
    $ldap = new clladp();
    $hash = $ldap->Hash_all_mailboxesActives();
    if (!is_array($hash)) {
        echo $tpl->_parse_body(Infos('mailbox_main_settings', 'no_mailboxes'));
        exit;
    }
    $cyrus = new cyrus();
    $cyrconf = new cyrus_conf();
    $cyrconf->SaveToLdap();
    while (list($uid, $password) = each($hash)) {
        writelogs("Creating Mailbox {$uid}", __FUNCTION__, __FILE__);
        if (!$cyrus->CreateMailbox($uid, 1)) {
            writelogs("Creating Mailbox {$uid} failed aborting", __FUNCTION__, __FILE__);
            echo $tpl->_parse_body(InfosError('mailbox_main_settings', "{error_creating_mailbox} <strong>{$uid}</strong>"));
            exit;
        }
    }
    echo $tpl->_ENGINE_parse_body(Success('mailbox_main_settings'));
}
예제 #2
0
function Save_impad()
{
    $cyrus = new cyrus_conf();
    while (list($num, $ligne) = each($_GET)) {
        $cyrus->impad_array[$num] = $ligne;
    }
    $cyrus->SaveToLdap();
}