Merge branch 'bug-1383' into testserver-stable
[cacert-devel.git] / www / src-lic.php
1 <? /*
2 LibreSSL - CAcert web application
3 Copyright (C) 2004-2008 CAcert Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 if(array_key_exists('iagree',$_REQUEST) && $_REQUEST['iagree'] == "yes")
19 {
20 $output_file = $fname = readlink("../tarballs/current.tar.bz2");
21
22 header('Pragma: public');
23
24 header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
25 header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
26 header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
27 header('Content-Transfer-Encoding: none');
28 header('Content-Type: application/octetstream; name="' . $output_file . '"'); //This should work for IE & Opera
29 header('Content-Type: application/octet-stream; name="' . $output_file . '"'); //This should work for the rest
30 header('Content-Disposition: inline; filename="' . $output_file . '"');
31 header("Content-length: ".intval(filesize($_SESSION['_config']['filepath']."/tarballs/$fname")));
32 readfile($_SESSION['_config']['filepath']."/tarballs/$fname");
33 exit;
34 }
35 loadem("index");
36 showheader(_("CAcert Source License"));
37 ?>
38 <body>
39 <p align="center">CAcert Inc.<br>
40 Source Code License Terms</p>
41 <pre>
42 <? include("../LICENSE"); ?>
43 </pre>
44 <form method="post">
45 <input type="checkbox" name="iagree" value="yes"> Tick this box to acknowledge you agree to these terms and conditions<br>
46 <input type="submit" name="process" value="Confirm, I agree to these terms and conditions">
47 </form>
48 <? showfooter(); ?>