1 rizwank 1.1 #!/usr/bin/perl -wT
2 #
3 # TWiki Collaboration Platform, http://TWiki.org/
4 #
5 # Copyright (C) 1999-2004 Peter Thoeny, peter@thoeny.com
6 #
7 # Based on parts of Ward Cunninghams original Wiki and JosWiki.
8 # Copyright (C) 1998 Markus Peter - SPiN GmbH (warpi@spin.de)
9 # Some changes by Dave Harris (drh@bhresearch.co.uk) incorporated
10 #
11 # For licensing info read license.txt file in the TWiki root.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License
14 # as published by the Free Software Foundation; either version 2
15 # of the License, or (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details, published at
21 # http://www.gnu.org/copyleft/gpl.html
22 rizwank 1.1
23 BEGIN {
24 # Set default current working directory (needed for mod_perl)
25 if( $ENV{"SCRIPT_FILENAME"} && $ENV{"SCRIPT_FILENAME"} =~ /^(.+)\/[^\/]+$/ ) {
26 chdir $1;
27 }
28 # Set library paths in @INC, at compile time
29 unshift @INC, '.';
30 require 'setlib.cfg';
31 }
32
33 use strict;
34 use CGI::Carp qw( fatalsToBrowser );
35 use CGI;
36 use TWiki::UI::View;
37
38 my $query = new CGI;
39
40 my $thePathInfo = $query->path_info();
41 my $theRemoteUser = $query->remote_user();
42 my $theTopic = $query->param( 'topic' );
43 rizwank 1.1 my $theUrl = $query->url;
44
45 my( $topic, $webName, $scriptUrlPath, $userName ) =
46 TWiki::initialize( $thePathInfo, $theRemoteUser,
47 $theTopic, $theUrl, $query );
48
49 TWiki::UI::View::view( $webName, $topic, $userName, $query );
50
|