Ejemplo n.º 1
0
function main_page()
{
    $mailbox = new MailBoxes();
    $mailbox->Cyrus_load();
    $mailbox_infos = $mailbox->MailBoxes_get_infos($_GET["edit_mailbox"]);
    $server = $mailbox->global_config["_GLOBAL"]["mailboxes_server"];
    $_field_date = "\n\t\t<tr>\n\t<td><strong>{mailbox_created}</strong></td>\n\t<td>{$mailbox_infos->created}</td>\n\t</tr>";
    $_field_maildir = "\n\t\t<tr>\n\t<td><strong>{mailbox_path}</strong></td>\n\t<td>{$mailbox_infos->maildir}</td>\n\t</tr>\n\t";
    if ($mailbox->Cyrus_Exists($_GET["edit_mailbox"])) {
        $tblq = explode('/', $mailbox->Cyrus_hash[$_GET["edit_mailbox"]]["QUOTA"]);
        if ($tblq[0] > 0) {
            $max_quota = $tblq[0] / 1000;
        } else {
            $max_quota = 0;
        }
        if ($tblq[1] > 0) {
            $used_quota = round($tblq[1] / 1000);
        } else {
            $used_quota = 0;
        }
        $field_quota = "<tr>\n\t<td><strong>{quota} {used}:&nbsp;{$used_quota} mb</strong>\n\t</td>\n\t<td><input type='text' id='max_quota' value='{$max_quota}' style='width:30px'> (mb)&nbsp;<i><span style='font-size:9px'>({quota_0})</span><i></td>\n\t</tr>";
    }
    $rowspan = 4;
    if ($server == 'cyrus') {
        $_field_date = null;
        $_field_maildir = null;
        $rowspan = 4;
        $button_set_quotas = "\n&nbsp;<input type='button' value='{bt_set_quota}' OnClick=\"javascript:set_quota('{$_GET["edit_mailbox"]}');\">";
    }
    $html = "\n\t<input type='hidden' id='no_password' value='{ERR_NO_PASS}'>\n\t<input type='hidden' id='password_no_match' value='{ERR_NO_PASS_MATCH}'>\t\n\t<input type='hidden' id='ERR_SET_QUOTA_SUCCESS'  value='{ERR_SET_QUOTA_SUCCESS}'>\n\t<FIELDSET style='width:550px'><LEGEND>\n\t{mailbox_title} {$_GET["edit_mailbox"]}</LEGEND>\n\t<table>\n\t<td style='padding:4px' width=1% valign='top'><img src='img/user-maibox.png'></td>\n\t<td valing='top'>\n\t\t<table>\n\t\t<tr>\n\t\t{$field_date}\t\n\t\t{$_field_maildir}\n\t\t<tr>\n\t\t<td><strong>{mailbox_username}</strong></td>\n\t\t<td>{$_GET["edit_mailbox"]}</td>\n\t\t</tr>\t\n\t\t{$field_quota}\n\t\t<tr>\n\t\t<td><strong>{mailbox_password}</strong></td>\n\t\t<td><input type=password id='password' value=''></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td><strong>{mailbox_confirm_password}</strong></td>\n\t\t<td><input type=password id='password2' value=''></td>\n\t\t</tr>\t\n\t\t\n\t\t</table>\n\t\t<br>\n\t\t<table>\n\t\t<td>\n\t\t<table style='border:0px;width:100px;text-align:center;clear:all' align='center'>\n\t\t\t<tr>\n\t\t\t\t<td style='padding:0px;margin:0px;clear:both'>\n\t\t\t\t\t<input type='button' value='{bt_mailbox_edit}'  OnClick=\"javascript:edit_mailbox_settings('{$_GET["edit_mailbox"]}');\"></td>\n\t\t\t\t\t<td style='padding:0px;margin:0px;clear:both'{$button_set_quotas}</td>\n\t\t\t\t</tr>\n\t\t</table>\n\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t</FIELDSET>\n\t\n\t";
    $tpl = new Templates();
    echo DIV_SHADOW($tpl->_parse_body($html), 'windows');
}