예제 #1
0
 protected function _parseHourly()
 {
     throw Horde_Exception('Not currently implemented.');
 }
예제 #2
0
파일: view.php 프로젝트: raz0rsdge/horde
    // No permissions to this ticket.
    Horde::url($registry->get('webroot', 'horde') . '/login.php', true)->add('url', Horde::selfUrl(true))->redirect();
}
// Check permissions on this ticket.
if (!count(Whups::permissionsFilter($whups_driver->getHistory($id), 'comment', Horde_Perms::READ))) {
    throw new Horde_Exception(sprintf(_("You are not allowed to view ticket %d."), $id));
}
try {
    $vfs = $injector->getInstance('Horde_Core_Factory_Vfs')->create();
} catch (Horde_Exception $e) {
    throw new Horde_Exception(_("The VFS backend needs to be configured to enable attachment uploads."));
}
try {
    $data = $vfs->read(Whups::VFS_ATTACH_PATH . '/' . $id, $filename);
} catch (Horde_Vfs_Exception $e) {
    throw Horde_Exception(sprintf(_("Access denied to %s"), $filename));
}
$mime_part = new Horde_Mime_Part();
$mime_part->setType(Horde_Mime_Magic::extToMime($type));
$mime_part->setContents($data);
$mime_part->setName($filename);
// We don't know better.
$mime_part->setCharset('US-ASCII');
$ret = $injector->getInstance('Horde_Core_Factory_MimeViewer')->create($mime_part)->render('full');
reset($ret);
$key = key($ret);
if (empty($ret)) {
    $browser->downloadHeaders($filename, null, false, strlen($data));
    echo $data;
} elseif (strpos($ret[$key]['type'], 'text/html') !== false) {
    $page_output->topbar = $page_output->sidebar = false;