31 lines
1.2 KiB
PHP
31 lines
1.2 KiB
PHP
<?php
|
|
# PAPERWEB - GPLv3 licence
|
|
# Copyright 2016 Yves Gablin
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
$CONF = parse_ini_file('paperweb.ini.php');
|
|
|
|
$datearg = escapeshellarg($_REQUEST['doThumbnails']);
|
|
$json = exec("sudo -u {$CONF['USER']} {$CONF['PATH']} -M {$datearg}");
|
|
$meta = json_decode($json, true);
|
|
$knownetag = trim(@$_SERVER['HTTP_IF_NONE_MATCH'], ' "');
|
|
if ($meta['etag'] == $knownetag) {
|
|
header('HTTP/1.1 304 Not Modified');
|
|
} else {
|
|
header("ETag: \"{$meta['etag']}\"");
|
|
header("Cache-Control: public");
|
|
?>
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?php
|
|
require('thumbs.inc.php');
|
|
}
|