Esempio n. 1
0
function expand_domain()
{
    writelogs("receive requests", __FUNCTION__, __FILE__);
    $domain = $_GET["expand_domain"];
    $mailbox = new MailBoxes();
    $html = "<table style='width:250%' align='center' border=0 class='table_little' style='border:1px solid #CCCCCC'>\n\t<tr>\n\t<td align='center' style='border-bottom:1px solid #CCCCCC'>&nbsp;</td>\n\t<td align='center' style='border-bottom:1px solid #CCCCCC'>{expand_domain}</td>\n\t<td align='center' style='border-bottom:1px solid #CCCCCC'>{expand_domain_goto}</td>\n\t<td align='center' style='border-bottom:1px solid #CCCCCC'>{expand_domain_object}</td>\n\t<td align='center' style='border-bottom:1px solid #CCCCCC'>{expand_domain_mailbox}</td>\n\t<td align='center' style='border-bottom:1px solid #CCCCCC'>{expand_domain_target}</td>\n\t<td align='center' style='border-bottom:1px solid #CCCCCC'>&nbsp;</td>\n\t";
    $transport = $mailbox->Get_Transport_maps($domain);
    writelogs("if there is a transport for {$domain} ???->{$transport}", __FUNCTION__, __FILE__);
    if ($transport != null) {
        $transport = str_replace("smtp:", '', $transport);
        $html = $html . "<tr>\n\t\t<td style='width:50px'  valign='MIDDLE' align='center'>&nbsp;<a href=\"javascript:edit_transport('{$domain}');\"  onMouseOver=\"javascript:AffBulle('{js_edit_transport}');\" OnMouseOut=\"javascript:HideBulle();\">\n\t\t\t<img src='img/edit.jpg'>&nbsp;</td>\n\t\t<td style='width:50px'  valign='MIDDLE' align='center'>&nbsp;{$domain}&nbsp;</td>\n\t\t<td style='width:50px' valign='MIDDLE' align='center'>&nbsp;<img src='img/forwd_22.gif'>&nbsp;</td>\n\t\t<td style='width:50px' valign='MIDDLE' align='center'>&nbsp;<img src='img/computer.gif'>&nbsp;</td>\n\t\t<td valign='MIDDLE'  style='width:50px' align='center'>&nbsp;{$transport}</td>\n\t\t<td valign='MIDDLE'  style='width:50px' align='center'>&nbsp;\n\t\t<a href=\"javascript:delete_transport('{$domain}');\"  onMouseOver=\"javascript:AffBulle('{js_del_transport}');\" OnMouseOut=\"javascript:HideBulle();\"><img src='img/deluser.gif'>&nbsp;</td>\n\t\t</tr>";
        $html = $html . "</table>";
        $tpl = new Templates();
        echo $tpl->_parse_body($html);
        exit;
    }
    $virtual_domain = new domain();
    $hash = $mailbox->Hash_get_mailbox_list($domain);
    if (!is_array($hash)) {
        writelogs("INFOS:Array is returned empty by Hash_get_mailbox_list({$domain})", __FUNCTION__, __FILE__);
        return null;
    }
    while (list($num, $ligne) = each($hash)) {
        $address = $ligne["address"];
        $s_address = $ligne["address"];
        $tbl = explode('@', $address);
        if ($tbl[0] == null) {
            $address = "*{$address}";
        }
        $goto = $ligne["goto"];
        $tbl = explode('@', $goto);
        $s_goto = $ligne["goto"];
        if ($mailbox->enable_storage == true) {
            if ($virtual_domain->IsLocalDomain($tbl[1])) {
                $gotourl = "<a href=\"javascript:MailBoxStorage('{$goto}','{$tbl[1]}');\"\n\t\t\t\tonMouseOver=\"javascript:AffBulle('{js_edit_mailbox_storage}');\" \n\t\t\t\tOnMouseOut=\"javascript:HideBulle();\" >";
                if ($mailbox->MailBoxes_isExists($goto)) {
                    $icon_mailbox = "<img src='img/mailbox_sorage.gif'>";
                } else {
                    $icon_mailbox = "&nbsp;";
                }
            }
        }
        if ($tbl[0] == null) {
            $gotourl = null;
            $goto = "*{$goto}";
        }
        $html = $html . "<tr>\n\t\t<td style='width:50px'  valign='MIDDLE' align='center'>&nbsp;\n\t\t\t<a href=\"javascript:adduser('{$domain}','{$s_address}');\" onMouseOver=\"javascript:AffBulle('{js_edit_alias}');\" OnMouseOut=\"javascript:HideBulle();\">\n\t\t\t\t<img src='img/edit.jpg'>&nbsp;\n\t\t</td>\n\t\t<td style='width:50px'  valign='MIDDLE' align='left'>&nbsp;{$address}&nbsp;</td>\n\t\t<td style='width:50px' valign='MIDDLE' align='center'>&nbsp;<img src='img/forwd_22.gif'>&nbsp;</td>\n\t\t<td style='width:50px' valign='MIDDLE' align='center'>&nbsp;<img src='img/mailbox.gif'>&nbsp;</td>\n\t\t<td style='width:50px' valign='MIDDLE' align='center'>&nbsp;{$icon_mailbox}&nbsp;</td>\n\t\t<td valign='MIDDLE'  style='width:50px' align='left'>&nbsp;{$gotourl}{$goto}</a></td>\n\t\t<td valign='MIDDLE'  style='width:50px' align='center'>&nbsp;\n\t\t<a href=\"javascript:delete_alias('{$s_address}','{$domain}');\"  onMouseOver=\"javascript:AffBulle('{js_del_alias}');\" OnMouseOut=\"javascript:HideBulle();\"><img src='img/deluser.gif'>&nbsp;</td>\n\t\t</tr>";
    }
    $html = $html . "</table>";
    $tpl = new Templates();
    echo $tpl->_parse_body($html);
    exit;
}