Пример #1
0
function save_transport()
{
    $mailbox = new MailBoxes();
    $domain = $_GET["save_transport"];
    $ou = $_GET["ou"];
    $line = $mailbox->transport_maps_implode($_GET["transport_maps"], $_GET["transport_maps_port"], $_GET["transport_maps_service"]);
    $ldap = new clladp();
    $transport = $ldap->GetTransportTable($domain);
    if ($transport != null) {
        $upd["transport"][0] = $line;
        $ldap->Ldap_modify("cn={$domain},ou={$ou},dc=organizations,{$ldap->suffix}", $upd);
        echo transport_map($domain, $ou);
        return null;
    } else {
        $upd['cn'][0] = $domain;
        $upd['transport'][0] = $line;
        $upd['objectClass'][0] = 'transportTable';
        $upd['objectClass'][1] = 'top';
        $ldap->ldap_add("cn={$domain},ou={$ou},dc=organizations,{$ldap->suffix}", $upd);
        echo transport_map($domain, $ou);
        return null;
    }
}