X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=misc%2Fexportauth.pl;h=d6236d21a979cd2e6207ade9cfb97c082eed2542;hb=eba9fe51eed42249fb60d67ff02dcddd00f80dcb;hp=acbc1cf990d1c1d036798cbda4f6dcc1fa24ff57;hpb=a3999812e691110f2e16fffd91ce0ed82d69178c;p=koha_gimpoz diff --git a/misc/exportauth.pl b/misc/exportauth.pl old mode 100644 new mode 100755 index acbc1cf990..d6236d21a9 --- a/misc/exportauth.pl +++ b/misc/exportauth.pl @@ -4,29 +4,26 @@ # use strict; -require Exporter; +#use warnings; FIXME - Bug 2505 +BEGIN { + # find Koha's Perl modules + # test carefully before changing this + use FindBin; + eval { require "$FindBin::Bin/kohalib.pl" }; +} -use C4::Auth; -use C4::Interface::CGI::Output; -use C4::Output; # contains gettemplate +use C4::Context; use C4::Biblio; -use CGI; use C4::Auth; my $outfile = $ARGV[0]; open(OUT,">$outfile") or die $!; -my $query = new CGI; -my $dbh=DBI->connect("DBI:mysql:database=koha2;host=localhost;port=3306","kohaserver","kohaserver") or die $DBI::errmsg; -#$dbh->do("set character_set_client='latin5'"); -#$dbh->do("set character_set_connection='utf8'"); -#$dbh->do("set character_set_results='latin5'"); -#my $dbh=C4::Context->dbh; - my $sth; - - $sth=$dbh->prepare("select marc from auth_header order by authid"); - $sth->execute(); - - while (my ($marc) = $sth->fetchrow) { - - print OUT $marc; - } +my $dbh=C4::Context->dbh; +#$dbh->do("set character_set_client='latin5'"); +$dbh->do("set character_set_connection='utf8'"); +#$dbh->do("set character_set_results='latin5'"); +my $sth=$dbh->prepare("select marc from auth_header order by authid"); +$sth->execute(); +while (my ($marc) = $sth->fetchrow) { + print OUT $marc; + } close(OUT);