Initial revision

This commit is contained in:
JT Smith 2002-05-02 15:54:48 +00:00
parent bb66c11a6a
commit 01e11d7871
41 changed files with 5420 additions and 3155 deletions

View file

@ -16,22 +16,22 @@ use WebGUI::Macro;
#-------------------------------------------------------------------
sub _replacement {
my (@param, $temp, $file);
my (@param, $temp, $file);
@param = WebGUI::Macro::getParams($_[0]);
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /WebGUI.conf/) {
$temp = "SECURITY VIOLATION";
} else {
$file = FileHandle->new($param[0],"r");
if ($file) {
while (<$file>) {
$temp .= $_;
}
$file->close;
} else {
$temp = "INCLUDED FILE DOES NOT EXIST";
}
}
return $temp;
$file = FileHandle->new($param[0],"r");
if ($file) {
while (<$file>) {
$temp .= $_;
}
$file->close;
} else {
$temp = "INCLUDED FILE DOES NOT EXIST";
}
}
return $temp;
}
#-------------------------------------------------------------------

View file

@ -0,0 +1,42 @@
package WebGUI::Macro::RootTitle;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2002 Plain Black Software.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use strict;
use Tie::CPHash;
use WebGUI::Macro;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::URL;
#-------------------------------------------------------------------
sub _recurse {
my ($sth, %data, $output);
tie %data, 'Tie::CPHash';
%data = WebGUI::SQL->quickHash("select pageId,parentId,title,urlizedTitle from page where pageId=$_[0]");
if ($data{parentId} == 0) {
$output = $data{title} || $session{page}{title};
} else {
$output = _recurse($data{parentId},$_[1]);
}
return $output;
}
#-------------------------------------------------------------------
sub process {
my ($output);
$output = $_[0];
$output =~ s/\^RootTitle\;/_recurse($session{page}{parentId})/ge;
return $output;
}
1;