[Koha-cvs] koha/intranet/cgi-bin .htaccess about.pl get-im... [rel_TG]

Tumer Garip tgarip at neu.edu.tr
Sat Mar 10 02:06:21 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_TG
Changes by:	Tumer Garip <tgarip1957>	07/03/10 01:06:21

Added files:
	intranet/cgi-bin: .htaccess about.pl get-imdb.php help.pl 
	                  logout.pl mainpage.pl plugin_launcher.pl 

Log message:
	committing fresh files for rel_TG

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/.htaccess?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/about.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/get-imdb.php?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/help.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/logout.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/mainpage.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/plugin_launcher.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1

Patches:
Index: .htaccess
===================================================================
RCS file: .htaccess
diff -N .htaccess
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .htaccess	10 Mar 2007 01:06:21 -0000	1.1.2.1
@@ -0,0 +1,9 @@
+# .htaccess
+
+ErrorDocument 400 /cgi-bin/koha/koha-tmpl/errors/400.pl
+ErrorDocument 401 /cgi-bin/koha/koha-tmpl/errors/401.pl
+ErrorDocument 403 /cgi-bin/koha/koha-tmpl/errors/403.pl
+ErrorDocument 404 /cgi-bin/koha/koha-tmpl/errors/404.pl
+ErrorDocument 500 /cgi-bin/koha/koha-tmpl/errors/500.pl
+
+

Index: about.pl
===================================================================
RCS file: about.pl
diff -N about.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ about.pl	10 Mar 2007 01:06:21 -0000	1.1.2.1
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+use HTML::Template;
+use strict;
+require Exporter;
+use C4::Database;
+use C4::Output;  # contains gettemplate
+use C4::Interface::CGI::Output;
+use C4::Auth;
+use C4::Context;
+use CGI;
+
+my $query = new CGI;
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "about.tmpl",
+			     query => $query,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {parameters => 1},
+			     debug => 1,
+			     });
+
+my $kohaVersion = C4::Context->config("kohaversion");
+my $osVersion = `uname -a`;
+my $perlVersion = $];
+my $mysqlVersion = `mysql -V`;
+my $apacheVersion =  `httpd -v`;
+$apacheVersion =  `httpd2 -v` unless $apacheVersion;
+
+$template->param(
+					kohaVersion => $kohaVersion,
+					osVersion          => $osVersion,
+					perlVersion        => $perlVersion,
+					mysqlVersion       => $mysqlVersion,
+					apacheVersion      => $apacheVersion,
+		);
+
+output_html_with_http_headers $query, $cookie, $template->output;

Index: get-imdb.php
===================================================================
RCS file: get-imdb.php
diff -N get-imdb.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ get-imdb.php	10 Mar 2007 01:06:21 -0000	1.1.2.1
@@ -0,0 +1,98 @@
+<?php
+/*
+* Example using "file_get_contents"
+* note: allow_url_fopen = On in your php.ini should be On
+* safemode off
+*/
+
+$website=$_GET['website'];
+$oldbiblionumber=$_GET['oldbiblionumber'];
+$websitesummary=$website."/plotsummary";
+$imdb_website_summary = file_get_contents("${websitesummary}"); //movie Summary
+
+$imdb_website = file_get_contents("${website}"); //movie PI
+
+$filename=substr($website,27,9).".xml";
+//include the parser-class
+require("classes/class.imdb_parser.php");
+
+//init the class
+$IMDB_Parser = new IMDB_Parser;
+
+// output movie-picture (html)
+print "<p>".$IMDB_Parser->getMoviePictureHtml($imdb_website)."</p>";
+
+// output movie-languages (array)
+ $xml='<?xml version="1.0" encoding="UTF-8"?>';
+$xml=$xml.'<record>';
+$xml.="<leader>     naa a22     7ar4500</leader>";
+foreach($IMDB_Parser->getMovieLanguage($imdb_website) as $value)
+{
+   $xml=$xml.'<datafield tag="40"><subfield code="a">'.$value.'</subfield></datafield>';
+}
+// output movie-title 
+$title=$IMDB_Parser->getMovieTitle($imdb_website);
+$date=substr($title,strlen($title)-5,4);
+$title= '<datafield tag="245"><subfield code="a">'.substr($title,0,strlen($title)-6).'</subfield>';
+$xml=$xml.$title;
+// output movie-directed by
+ $xml=$xml.'<subfield code="c">'.$IMDB_Parser->getMovieDirectedBy($imdb_website).'</subfield><subfield code="h">DVD</subfield></datafield>';
+// output movie-country (array)
+
+foreach($IMDB_Parser->getMovieCountry($imdb_website) as $value)
+{
+   $xml=$xml.'<datafield tag="260"><subfield code="a">'.$value.'</subfield><subfield code="c">'.$date.'</subfield></datafield>';
+}
+
+
+// output movie-tagline
+$xml=$xml.'<datafield tag="500"> <subfield code="a">'.$IMDB_Parser->getMovieTagline($imdb_website).'</subfield></datafield>';
+
+// output movie-plot
+$xml=$xml.'<datafield tag="520"> <subfield code="a">'.$IMDB_Parser->getMoviePlot($imdb_website).'</subfield></datafield>';
+// output movie-summary
+foreach($IMDB_Parser->getMovieSummary($imdb_website_summary) as $value)
+{
+$xml=$xml.'<datafield tag="520"> <subfield code="a">'.$value.'</subfield></datafield>';
+}
+// output movie-genres (array)
+
+foreach($IMDB_Parser->getMovieGenres($imdb_website) as $value)
+{
+   $xml=$xml.'<datafield tag="650"> <subfield code="a">'.$value.'</subfield></datafield>';
+}
+
+// output movie-actors (array)
+foreach($IMDB_Parser->getMovieActors($imdb_website) as $value)
+{
+ $xml=$xml.'<datafield tag="700"><subfield code="a">'.$value.'</subfield></datafield>';
+}
+
+
+
+
+// output movie-color
+//print "<br />Color: ".$IMDB_Parser->getMovieColor($imdb_website);
+
+$xml=$xml.'<datafield tag="856"><subfield code="u">'.$website.'</subfield></datafield>';
+
+// output movie-picture path
+ $xml=$xml.'<datafield tag="956"> <subfield code="u">'.$IMDB_Parser->getMoviePicture($imdb_website).'</subfield></datafield>';
+$xml=$xml.'</record>';
+
+$dvd=fopen('c:/webservices/koha/intranet/htdocs/uploaded-files/tmp-pdf/'.$filename,'w');
+fwrite($dvd,$xml);
+fclose($dvd);
+
+
+print  "<a href=\"javascript:Import()\">Get: $title</a>
+<script language=\"JavaScript\" type=\"text/javascript\">
+	function Import() {
+		opener.document.location=\"cataloguing/addbiblio.pl?z3950=1&DVDid=$filename&oldbiblionumber=$oldbiblionumber\";
+		self.close();
+		return false;
+	}
+</script>"
+;
+//header("Location: /cgi-bin/koha/mainpage.pl?xml=$xml");
+?>

Index: help.pl
===================================================================
RCS file: help.pl
diff -N help.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ help.pl	10 Mar 2007 01:06:21 -0000	1.1.2.1
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+use strict;
+
+use C4::Interface::CGI::Output;
+ use C4::Auth;
+use C4::Context;
+use C4::Koha;
+use CGI;
+my $query = new CGI;
+
+# find the script that called the online help using the CGI referer()
+
+my $refer  = $query->referer();
+$refer =~ /.*koha\/(.*)\.pl.*/;
+my $from = "help/$1.tmpl";
+my ($template, $loggedinuser, $cookie)    = get_template_and_user({template_name => $from,
+			     query => $query,
+			     type => "intranet",
+			     authnotrequired => 1,
+			     flagsrequired => {borrow=> 1},
+			     debug => 1,
+			     });
+
+#my $template = gethelptemplate($from,"intranet");
+# my $template
+output_html_with_http_headers $query, $cookie, $template->output;
+
+
+

Index: logout.pl
===================================================================
RCS file: logout.pl
diff -N logout.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ logout.pl	10 Mar 2007 01:06:21 -0000	1.1.2.1
@@ -0,0 +1,75 @@
+#!/usr/bin/perl
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use CGI;
+use C4::Context;
+
+my $query=new CGI;
+
+my $sessionID=$query->cookie('sessionID');
+
+my $sessions;
+open (S, "/tmp/sessions");
+while (my ($sid, $u, $lasttime) = split(/:/, <S>)) {
+    chomp $lasttime;
+    (next) unless ($sid);
+    (next) if ($sid eq $sessionID);
+    $sessions->{$sid}->{'userid'}=$u;
+    $sessions->{$sid}->{'lasttime'}=$lasttime;
+}
+open (S, ">/tmp/sessions");
+foreach (keys %$sessions) {
+    my $userid=$sessions->{$_}->{'userid'};
+    my $lasttime=$sessions->{$_}->{'lasttime'};
+    print S "$_:$userid:$lasttime\n";
+}
+
+my $dbh = C4::Context->dbh;
+
+# Check that this is the ip that created the session before deleting it
+
+my $sth=$dbh->prepare("select userid,ip from sessions where sessionID=?");
+$sth->execute($sessionID);
+my ($userid, $ip);
+if ($sth->rows) {
+    ($userid,$ip) = $sth->fetchrow;
+    if ($ip ne $ENV{'REMOTE_ADDR'}) {
+       # attempt to logout from a different ip than cookie was created at
+       exit;
+    }
+}
+
+$sth=$dbh->prepare("delete from sessions where sessionID=?");
+$sth->execute($sessionID);
+open L, ">>/tmp/sessionlog";
+my $time=localtime(time());
+printf L "%20s from %16s logged out at %30s (manual log out).\n", $userid, $ip, $time;
+close L;
+
+my $cookie=$query->cookie(-name => 'sessionID',
+			  -value => '',
+			  -expires => '+1y');
+
+# Should redirect to intranet home page after logging out
+
+print $query->redirect("mainpage.pl");
+exit;
+
+

Index: mainpage.pl
===================================================================
RCS file: mainpage.pl
diff -N mainpage.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mainpage.pl	10 Mar 2007 01:06:21 -0000	1.1.2.1
@@ -0,0 +1,41 @@
+#!/usr/bin/perl 
+use strict;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Auth;
+use C4::Suggestions;
+use C4::Koha;
+use C4::BookShelves;
+use C4::NewsChannels;
+use C4::Context;
+my $query =  CGI->new();
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "intranet-main.tmpl",
+			     query => $query,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {catalogue => 1, circulate => 1,
+			     				parameters => 1, borrowers => 1,
+							permissions =>1, reserveforothers=>1,
+							editcatalogue => 1, updatecharges => 1, },
+			     debug => 1,
+			     });
+
+my $lang = "koha";
+my $error=$query->param('error');
+$template->param(error        =>$error);
+my ($opac_news_count, $all_opac_news) = &get_opac_news(undef, $lang);
+# if ($opac_news_count > 4) {$template->param(more_opac_news => 1);}
+$template->param(opac_news        => $all_opac_news);
+$template->param(opac_news_count  => $opac_news_count);
+
+my $marc_p = C4::Context->boolean_preference("marc");
+$template->param(NOTMARC => !$marc_p);
+my $new_suggestions = &CountSuggestion("ASKED");
+$template->param(new_suggestions => $new_suggestions);
+
+
+my $count_pending_request = CountShelfRequest(undef, "PENDING");
+$template->param(count_pending_request => $count_pending_request);
+output_html_with_http_headers($query, $cookie, $template->output());
+

Index: plugin_launcher.pl
===================================================================
RCS file: plugin_launcher.pl
diff -N plugin_launcher.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ plugin_launcher.pl	10 Mar 2007 01:06:21 -0000	1.1.2.1
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+# $Id: plugin_launcher.pl,v 1.1.2.1 2007/03/10 01:06:21 tgarip1957 Exp $
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use CGI;
+use C4::Context;
+use C4::Search;
+use C4::Output;
+
+my $input = new CGI;
+#my $plugin_name=$input->param("plugin_name");
+my $cgidir = C4::Context->intranetdir ."/cgi-bin/value_builder";
+		unless (opendir(DIR, "$cgidir")) {
+			$cgidir = C4::Context->intranetdir."/value_builder";
+		} 
+		my $plugin_name=$cgidir."/".$input->param("plugin_name");
+
+
+do $plugin_name;
+&plugin($input);





More information about the Koha-cvs mailing list