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 | 3 | simandl | if ($config->multiViews) { |
58 | | | $rep =& $config->findRepository(@$_REQUEST["repname"]); |
59 | | | if ($rep == null) { |
60 | | | include("$locwebsvnreal/index.php"); |
61 | | | exit; |
62 | | | } |
63 | | | } |
64 | | | |
65 | | | $url = $config->getURL($rep, "", "dir"); |
66 | 1 | simandl | $url = html_entity_decode($url); |
67 | | | |
68 | | | if ($config->multiViews) { |
69 | | | redirect($url); |
70 | | | } else { |
71 | | | redirect($basedir.$url); |
72 | | | } |
73 | | | } |