Esempio n. 1
0
// Create a unique number - Each compose screen is unique. Used to
// reference which attachments are for what window. Based on the
// 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;