-
Notifications
You must be signed in to change notification settings - Fork 127
/
full.php
26 lines (23 loc) · 1 KB
/
full.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/**
* Copyright 2003-2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Chuck Hagenbuch <chuck@horde.org>
*/
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('ansel');
$image = $storage->getImage(Horde_Util::getFormData('image'));
$gallery = $storage->getGallery($image->gallery);
if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ) || !$gallery->canDownload()) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."));
}
/* Sendfile support. Lighttpd < 1.5 only understands the X-LIGHTTPD-send-file header */
if ($conf['vfs']['src'] == 'sendfile') {
$filename = $injector->getInstance('Horde_Core_Factory_Vfs')->create('images')->readFile($image->getVFSPath('full'), $image->getVFSName('full'));
Ansel::doSendFile($filename, $image->getType('full'));
exit;
}
$image->display('full');