Example #1
0
	`h`.`host`
FROM
	`vm_msgs` `m` LEFT JOIN
	`hosts` `h` ON (`h`.`id`=`m`.`host_id`)
WHERE
	`m`.`user_id`=\'' . $user_id . '\' AND
	`m`.`folder`=\'' . $DB->escape($fld) . '\' AND
	`m`.`file`=\'' . $DB->escape($file) . '\'');
$info = $rs->fetchRow();
if (!$info) {
    _not_found();
}
$etag = gmDate('Ymd') . '-' . md5($user_id . '-' . $fld . '-' . $file . '-' . $info['host_id'] . '-' . $info['orig_time'] . '-' . $info['dur'] . '-' . $info['cidnum']) . '-' . $fmt;
$fake_filename = preg_replace('/[^0-9a-z\\-_.]/i', '', 'vm_' . $ext . '_' . date('Ymd_Hi', $info['orig_time']) . '_' . subStr(md5(date('s', $info['orig_time']) . $info['cidnum']), 0, 4) . '.' . $formats[$fmt]['ext']);
if (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER) && $_SERVER['HTTP_IF_NONE_MATCH'] === $etag) {
    _not_modified($etag, $attach, $fake_filename);
}
if ($info['dur'] > 900) {
    # 900 s = 15 min
    gs_log(GS_LOG_NOTICE, 'Voicemail too long for web.');
    _server_error('File too long.');
}
if (!gs_get_conf('GS_INSTALLATION_TYPE_SINGLE')) {
    $our_host_ids = @gs_get_listen_to_ids();
    if (!is_array($our_host_ids)) {
        gs_log(GS_LOG_WARNING, 'Failed to get our host IDs.');
        _server_error('Failed to get our host IDs.');
    }
    $vmmsg_is_on_this_host = in_array($info['host_id'], $our_host_ids, true);
} else {
    $vmmsg_is_on_this_host = true;
Example #2
0
require_once dirName(__FILE__) . '/../../../inc/conf.php';
# set paths
#
$GS_URL_PATH = dirName(dirName(@$_SERVER['SCRIPT_NAME']));
if (subStr($GS_URL_PATH, -1, 1) != '/') {
    $GS_URL_PATH .= '/';
}
header('ETag: ' . gmDate('Ymd') . '-' . md5($GS_URL_PATH));
function _not_modified()
{
    header('HTTP/1.0 304 Not Modified', true, 304);
    header('Status: 304 Not Modified', true, 304);
    exit;
}
if (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER) && $_SERVER['HTTP_IF_NONE_MATCH'] === gmDate('Ymd') . '-' . md5($GS_URL_PATH)) {
    _not_modified();
}
/*
$tmp = gmDate('D, d M Y');
if (array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)
&&  subStr($_SERVER['HTTP_IF_MODIFIED_SINCE'],0,strLen($tmp)) == $tmp ) {
	_not_modified();
}
*/
ob_start();
?>
<public:component lightWeight="true">
<public:attach event="onpropertychange" onevent="pngb_property_changed()" />
<public:attach event="onbeforeprint" onevent="pngb_before_print()" for="window" />
<public:attach event="onafterprint" onevent="pngb_after_print()" for="window" />
<script type="text/javascript" language="JavaScript">