1 | 1 | simandl | <?php |
2 | | | // WebSVN - Subversion repository viewing via the web using PHP |
3 | | | // Copyright (C) 2004-2006 Tim Armes |
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; either version 2 of the License, or |
8 | | | // (at your option) any later version. |
9 | | | // |
10 | | | // This program is distributed in the hope that it will be useful, |
11 | | | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | | | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | | | // GNU General Public License for more details. |
14 | | | // |
15 | | | // You should have received a copy of the GNU General Public License |
16 | | | // along with this program; if not, write to the Free Software |
17 | | | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | | | // |
19 | | | // -- |
20 | | | // |
21 | | | // form.php |
22 | | | // |
23 | | | // Handling of WebSVN forms |
24 | | | |
25 | | | require_once("include/setup.php"); |
26 | | | require_once("include/utils.php"); |
27 | | | |
28 | | | // Generic redirect handling |
29 | | | |
30 | | | function redirect($loc) { |
31 | | | $url = getFullURL($loc); |
32 | | | |
33 | | | // technically, a die(header('Location: '.$url)); would suffice for all web browsers... ~J |
34 | | | header("Location: $url"); |
35 | | | echo "<html>\n"; |
36 | | | echo " <head>\n"; |
37 | | | echo " <title>Redirecting...</title>\n"; |
38 | | | echo " <meta http-equiv=\"refresh\" content=\"0; url=$url\" />\n"; |
39 | | | echo " <script type='application/x-javascript'><![CDATA[ window.location.href = '$url'; ]]></script>\n"; |
40 | | | echo " </head>\n"; |
41 | | | echo " <body>\n"; |
42 | | | echo " <p>If you are not automatically redirected, please click <a href=\"$url\">here</a> to continue.</p>\n"; |
43 | | | echo " </body>\n"; |
44 | | | echo "</html>"; |
45 | | | } |
46 | | | |
47 | | | // Handle project selection |
48 | | | |
49 | | | if (@$_REQUEST["selectproj"]) { |
50 | | | $basedir = dirname($_SERVER["PHP_SELF"]); |
51 | | | if ($basedir != "" && $basedir != DIRECTORY_SEPARATOR && $basedir != "\\" && $basedir != "/" ) { |
52 | | | $basedir .= "/"; |
53 | | | } else { |
54 | | | $basedir = "/"; |
55 | | | } |
56 | | | |
57 | | | $url = $config->getURL($rep, "/", "dir"); |
58 | | | $url = html_entity_decode($url); |
59 | | | |
60 | | | if ($config->multiViews) { |
61 | | | redirect($url); |
62 | | | } else { |
63 | | | redirect($basedir.$url); |
64 | | | } |
65 | | | } |