From 5d308abbe4d2a9f77d2fa9d692c78b841d2f6579 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Mon, 26 Aug 2002 17:08:56 +0000 Subject: [PATCH] Removed hard coded directories (as reported by Ville Huhtala). --- admin-home.pl | 6 +++++- admin/templates.pl | 6 +++++- catalogue-home.pl | 8 ++++++-- groups.pl | 7 ++++++- members-home.pl | 5 ++++- reports-home.pl | 6 +++++- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/admin-home.pl b/admin-home.pl index a03e6e9f4f..0f6b09e21e 100755 --- a/admin-home.pl +++ b/admin-home.pl @@ -4,6 +4,10 @@ use strict; use CGI; use C4::Auth; use C4::Output; +use C4::Database; + +my $configfile=configfile(); +my $intranetdir=$configfile->{'intranetdir'}; my $query = new CGI; my ($loggedinuser, $cookie, $sessionID) = checkauth($query); @@ -16,7 +20,7 @@ print startmenu('catalogue'); print "

Logged in as: $loggedinuser [Log Out]

\n"; -open H, "/usr/local/koha/intranet/htdocs/admin/index.html"; +open H, "$intranetdir/htdocs/admin/index.html"; while () { print $_; } diff --git a/admin/templates.pl b/admin/templates.pl index 16767735f1..079999303d 100755 --- a/admin/templates.pl +++ b/admin/templates.pl @@ -14,6 +14,10 @@ use C4::Auth; my $input = new CGI; +my $configfile=configfile(); +my $includes=$configfile->{'includes'}; + + my $dbh=C4Connect(); if ($input->param('settemplate')) { @@ -33,7 +37,7 @@ $sth->execute; my ($template)=$sth->fetchrow; my $templateoptions=''; -opendir D, "/usr/local/koha/intranet/htdocs/includes/templates"; +opendir D, "$includes/templates"; my @dirlist=readdir D; foreach (@dirlist) { (next) if (/^\./); diff --git a/catalogue-home.pl b/catalogue-home.pl index a722ae925e..72c0ebb3b5 100755 --- a/catalogue-home.pl +++ b/catalogue-home.pl @@ -4,6 +4,10 @@ use strict; use CGI; use C4::Auth; use C4::Output; +use C4::Database; + +my $configfile=configfile(); +my $intranetdir=$configfile->{'intranetdir'}; my $query = new CGI; my ($loggedinuser, $cookie, $sessionID) = checkauth($query); @@ -16,11 +20,11 @@ print startmenu('catalogue'); print "

Logged in as: $loggedinuser [Log Out]

\n"; my $classlist=''; -open C, "/usr/local/koha/intranet/htdocs/includes/cat-class-list.inc"; +open C, "$intranetdir/htdocs/includes/cat-class-list.inc"; while () { $classlist.=$_; } -open H, "/usr/local/koha/intranet/htdocs/catalogue/index.html"; +open H, "$intranetdir/htdocs/catalogue/index.html"; while () { s//$classlist/; print $_; diff --git a/groups.pl b/groups.pl index 5e0f368529..aac7316da9 100755 --- a/groups.pl +++ b/groups.pl @@ -9,6 +9,11 @@ use C4::Groups; use C4::Circulation::Circ2; use C4::Print; use DBI; +use C4::Database; + +my $configfile=configfile(); +my $intranetdir=$configfile->{'intranetdir'}; + my $input=new CGI; my $time=$input->param('time'); @@ -213,7 +218,7 @@ sub printgroup { my $type=shift; $output= "Overdue list for $groups->{$group}
\n"; my $members=groupmembers($env, $group); - ($type eq 'overdues') && ($output.="
\n"); + ($type eq 'overdues') && ($output.="
\n"); $output.= "\n"; my $typetext=''; ($type eq 'overdues') ? ($typetext="Overdues") : ($typetext="Issues"); diff --git a/members-home.pl b/members-home.pl index 4f767b45da..f2a81f475e 100755 --- a/members-home.pl +++ b/members-home.pl @@ -4,7 +4,10 @@ use strict; use CGI; use C4::Auth; use C4::Output; +use C4::Database; +my $configfile=configfile(); +my $intranetdir=$configfile->{'intranetdir'}; my $query = new CGI; my $flagsrequired; $flagsrequired->{borrowers}=1; @@ -17,7 +20,7 @@ print startmenu('member'); print "

Logged in as: $loggedinuser [Log Out]

\n"; -open H, "/usr/local/koha/intranet/htdocs/members/index.html"; +open H, "$intranetdir/htdocs/members/index.html"; while () { print $_; } diff --git a/reports-home.pl b/reports-home.pl index 0e46379e57..87b0b657e1 100755 --- a/reports-home.pl +++ b/reports-home.pl @@ -4,6 +4,10 @@ use strict; use CGI; use C4::Auth; use C4::Output; +use C4::Database; + +my $configfile=configfile(); +my $intranetdir=$configfile->{'intranetdir'}; my $query = new CGI; my ($loggedinuser, $cookie, $sessionID) = checkauth($query); @@ -15,7 +19,7 @@ print startmenu('report'); print "

Logged in as: $loggedinuser [Log Out]

\n"; -open H, "/usr/local/koha/intranet/htdocs/reports/index.html"; +open H, "$intranetdir/htdocs/reports/index.html"; while () { print $_; } -- 2.39.5