[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS Update: gleipnir
- To: cvs@lists.cleannorth.org
- Subject: CVS Update: gleipnir
- From: Dan Brosemer <odin@cleannorth.org>
- Date: Fri, 1 Aug 2008 11:23:20 -0400 (EDT)
- List-help: <mailto:cvs-request@lists.cleannorth.org?subject=help>
- List-post: <mailto:cvs@lists.cleannorth.org>
- List-subscribe: <mailto:cvs-request@lists.cleannorth.org?subject=subscribe>
- List-unsubscribe: <mailto:cvs-request@lists.cleannorth.org?subject=unsubscribe>
- Resent-date: Fri, 1 Aug 2008 11:23:33 -0400 (EDT)
- Resent-from: cvs@lists.cleannorth.org
- Resent-message-id: <toKHZD.A.FaC.LqykIB@skroob.cleannorth.org>
- Resent-sender: cvs-request@lists.cleannorth.org
Log Message:
-----------
Write some variables out in to the knowledgebase articles
Modified Files:
--------------
gleipnir/public_html:
kb.pl
Revision Data
-------------
Index: kb.pl
===================================================================
RCS file: /cvs/gleipnir/public_html/kb.pl,v
retrieving revision 1.27
retrieving revision 1.28
diff -Lpublic_html/kb.pl -Lpublic_html/kb.pl -u -r1.27 -r1.28
--- public_html/kb.pl
+++ public_html/kb.pl
@@ -109,6 +109,15 @@
my $topic = $options{-topic};
my $kbdir = $gleipnir->cfetch( dirs => 'kbdir' );
+ my $remote_host = $cgi->remote_host();
+ my @parts = split(/\./, $remote_host);
+ @parts = map {unpack("H2",pack("C1",$_))} @parts;
+ $remote_host = join "", @parts;
+
+ my $server = $cgi->url;
+ $server =~ s|^https?://||;
+ $server =~ s|/.*||;
+
return $gleipnir->error(403) unless $gleipnir->ingroup( Gleipnir::KB::kbread( -file => $topic, -gleipnir => $gleipnir ) );
if ( $topic =~ m/\.tmpl$/ )
@@ -121,7 +130,8 @@
my $body = join( "", <FH> );
close FH;
my $parse = Gleipnir::HTML::GetBody($body);
- my $template = HTML::Template->new( scalarref => \$parse );
+ my $template = HTML::Template->new( scalarref => \$parse, die_on_bad_params => 0 );
+ $template->param( kb_server => $server, kb_remote => $remote_host );
$gleipnir->body( $template->output );
my %h = %{Gleipnir::HTML::GetKV($body)};
$gleipnir->showheader($h{decoration}) if defined($h{decoration});
- Prev by Date: CVS Update: gleipnir
- Next by Date: CVS Update: svartalfheim.net
- Previous by thread: CVS Update: gleipnir
- Next by thread: CVS Update: gleipnir
- Index(es):