#! /usr/local/perl package Dir; use strict; Dir.pm: sub get_list { my $self = (); shift; $self->{base} = "/usr/local/www/uploads/SS7"; $self->{URI} = shift; $self->{path} = ""; $self->{title} = ""; $self->{leaf} = "false"; $self->{names} = (); $self->{urls} = (); bless($self); $self->{title} = $self->{URI}; $self->{path} = $self->{base} . $self->{URI} . "/"; opendir DH, $self->{path}; my @save_files; while (my $line = readdir(DH)) { my $path = $self->{path} . $line; if ((-d $path) && ($line !~ /\.$/)) { $self->{names}{$line} = $line; $self->{names}{$line} =~ tr/_/ /d; $self->{urls}{$line} = $line; } else { push (@save_files, $line); } } my $count = scalar (keys %{$self->{names}}); if ($count == 0) { foreach my $line (@save_files) { next if (-d $line); $self->{names}{$line} = $line; $self->{names}{$line} =~ tr/_/ /d; $self->{names}{$line} =~ tr/.xls//d; $self->{urls}{$line} = $line; } $self->{leaf} = "true"; } return($self); } 1; #### % if (defined $rep->{title}) { % $rep->{title} =~ tr/_/ /; % $rep->{title} =~ tr/\// /;

<& SELF:title &> <% $rep->{title} %>

% } else {

<& SELF:title &>

% } <%method title> SS7: <%once> use Apps::SS7::Dir; use Data::Dumper; <%init> my @mos = ("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"); my $item; my $iter; my $rep = Dir->get_list($ARGS{rep}); ##
## DocumentRoot "/usr/local/www/docs" # # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # features. # Options FollowSymLinks AllowOverride None Order deny,allow Deny from all # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # This should be changed to whatever you set DocumentRoot to. # PerlRequire /usr/local/www/lib/uses.pl PerlSwitches -wT PerlSetVar MasonCompRoot /usr/local/www/docs PerlAddVar MasonDataDir /usr/local/httpd/mason PerlAddVar MasonAllowGlobals $AuthDBH PerlAddVar MasonAllowGlobals $RepDBH PerlAddVar MasonAllowGlobals $SysDBH PerlAddVar MasonAllowGlobals $User PerlModule HTML::Mason::ApacheHandler PerlModule Apache::DBI PerlModule Apache2::Cookie PerlModule CGI PerlModule Apache2::Const SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler # # SetHandler perl-script # PerlHandler "sub { return Apache2::Const::NOT_FOUND }" # # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all