Example #1
0
// PID and a random number.
$var['unique'] = $atmail->param_escape('unique');
$var['delete'] = $_REQUEST['delete'];
if (!$var['unique']) {
    $var['unique'] = getmypid() + rand(0, 1000);
}
// Avoid any fake/malformed unique ID, e.g ../ in pathname
$var['unique'] = basename($var['unique']);
// see if something is cached
if (file_exists($atmail->tmpdir . ".ht{$auth->SessionID}")) {
    $var['PgpPass'] = 1;
}
// The From address of our
$var['FromAddress'] = $atmail->loadpersonalities();
// Calculate the height of the menubar ( if the Webadmin user toggles off certain features )
$h = $atmail->calcmenu_height();
foreach ($h as $k => $v) {
    $var[$k] = $v;
}
// Display the attachment modal window
if ($var['func'] == "attachmentmodal") {
    print $atmail->parse("html/{$atmail->Language}/{$atmail->LoginType}/attachmentmodal.html", $var);
} elseif ($var['func'] == "attachmentmodalframe") {
    $var['maxfilesize'] = ini_get('upload_max_filesize');
    if (!is_numeric($var['maxfilesize'])) {
        if (strpos($var['maxfilesize'], 'M') !== false) {
            $var['maxfilesize'] = intval($var['maxfilesize']) * 1024 * 1024;
        } elseif (strpos($var['maxfilesize'], 'K') !== false) {
            $var['maxfilesize'] = intval($var['maxfilesize']) * 1024;
        } elseif (strpos($var['maxfilesize'], 'G') !== false) {
            $var['maxfilesize'] = intval($var['maxfilesize']) * 1024 * 1024 * 1024;
Example #2
0
        } else {
            $var['afterYearOptions'] .= "<option value=\"{$y}\">{$y}</option>\n";
        }
    }
    $y2++;
    for ($y = $y1; $y <= $y2; $y++) {
        if ($y == $y2) {
            $var['beforeYearOptions'] .= "<option value=\"{$y}\" selected>{$y}</option>\n";
        } else {
            $var['beforeYearOptions'] .= "<option value=\"{$y}\">{$y}</option>\n";
        }
    }
}
// Calculate the length of a menu, shrink if we have settings disabled
if ($filename == "html/{$atmail->Language}/xp/toolbar.html" || $filename == "html/{$atmail->Language}/xp/toolbar_abook.html") {
    $var = $atmail->calcmenu_height($filename);
}
// Die if the file is not permitted
if (!$type[$filename]) {
    catcherror("Specified file {$filename} is not allowed");
}
$var['FirstLoad'] = $_REQUEST['FirstLoad'];
// If using the help menu, load the selected help-file or default to the settings
if ($filename == "html/{$atmail->Language}/help/filexp.html" && $_REQUEST['HelpFile']) {
    if ($_REQUEST['HelpFile']) {
        $var['HelpFile'] = $_REQUEST['HelpFile'];
    } else {
        $var['HelpFile'] = 'file.html';
    }
}
if (!$_REQUEST['XUL']) {