~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/lib/Foswiki/Configure/Checkers/DispScriptUrlPath.pm

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# See bottom of file for license and copyright information
 
2
package Foswiki::Configure::Checkers::DispScriptUrlPath;
 
3
 
 
4
use strict;
 
5
 
 
6
use Foswiki::Configure::Checker;
 
7
 
 
8
use base 'Foswiki::Configure::Checker';
 
9
 
 
10
sub check {
 
11
    my $this = shift;
 
12
 
 
13
    # Check Script URL Path against REQUEST_URI
 
14
    my $n;
 
15
    my $val = $Foswiki::cfg{DispScriptUrlPath};
 
16
    my $guess = $ENV{REQUEST_URI} || $ENV{SCRIPT_NAME} || '';
 
17
    $guess =~ s(/+configure[^/]*$)();
 
18
 
 
19
    if ( !defined($val) || $val eq 'NOT SET' ) {
 
20
        $Foswiki::cfg{DispScriptUrlPath} = $Foswiki::cfg{ScriptUrlPath};
 
21
        return $this->guessed(0);
 
22
    }
 
23
    return '';
 
24
}
 
25
 
 
26
1;
 
27
__DATA__
 
28
#
 
29
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
 
30
#
 
31
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
 
32
# Foswiki Contributors are listed in the AUTHORS file in the root
 
33
# of this distribution. NOTE: Please extend that file, not this notice.
 
34
#
 
35
# Additional copyrights apply to some or all of the code in this
 
36
# file as follows:
 
37
#
 
38
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
 
39
# TWiki Contributors are listed in the AUTHORS file in the root
 
40
# of this distribution. NOTE: Please extend that file, not this notice.
 
41
#
 
42
# This program is free software; you can redistribute it and/or
 
43
# modify it under the terms of the GNU General Public License
 
44
# as published by the Free Software Foundation; either version 2
 
45
# of the License, or (at your option) any later version. For
 
46
# more details read LICENSE in the root of this distribution.
 
47
#
 
48
# This program is distributed in the hope that it will be useful,
 
49
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
50
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
51
#
 
52
# As per the GPL, removal of this notice is prohibited.