4 Copyright(c)2008-2010 Internet Archive. Software license AGPL version 3.
6 This file is part of BookReader.
8 BookReader is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Affero General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 BookReader is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Affero General Public License for more details.
18 You should have received a copy of the GNU Affero General Public License
19 along with BookReader. If not, see <http://www.gnu.org/licenses/>.
21 The BookReader source is hosted at http://github.com/openlibrary/bookreader/
24 //$env = 'LD_LIBRARY_PATH=/petabox/sw/lib/lxml/lib PYTHONPATH=/petabox/sw/lib/lxml/lib/python2.5/site-packages:$PYTHONPATH';
26 checkPrivs($_GET['path']);
28 $path = escapeshellarg($_GET['path']);
29 $page = escapeshellarg($_GET['page']);
30 $callback = escapeshellarg($_GET['callback']);
32 header('Content-Type: application/javascript');
33 passthru("python BookReaderGetText.py $path $page $callback");
35 function checkPrivs($filename) {
36 if (!is_readable($filename)) {
37 header('HTTP/1.1 403 Forbidden');