Bug 26701: Remove unused C4/SIP scripts

Those scripts are not known to be used, we can remove them from the Koha
codebase.

Test plan:
Confirm that the scripts removed by this patch are not used anywhere
from Koha.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-01-07 15:23:17 +01:00
parent 1d61203fab
commit 3569731261
8 changed files with 0 additions and 226 deletions

View file

@ -1,42 +0,0 @@
import operator
import socket
from time import strftime;
def SipSocket(host='localhost', port=5300):
so = socket.socket()
so.connect((host, port))
return so
def login(so, uname='scclient', passwd='clientpwd', locn='The basement',
seqno=0):
port = so.getpeername()[1]
if port == 5300:
resp = send(so, '9300CN%s|CO%s|CP%s|' % (uname, passwd, locn), seqno)
print "Received", repr(resp)
print "Verified: ", verify(resp)
else:
raise "Logging in is only support for the raw transport on port 5300"
def send(so, msg, seqno=0):
if seqno:
msg += 'AY' + str(seqno)[0] + 'AZ'
msg += ('%04X' % calculate_cksum(msg))
msg += '\r'
print 'Sending', repr(msg)
so.send(msg)
resp = so.recv(1000)
return resp, verify(resp)
def calculate_cksum(msg):
return (-reduce(operator.add, map(ord, msg)) & 0xFFFF)
def sipdate():
return(strftime("%Y%m%d %H%M%S"))
def verify(msg):
if msg[-1] == '\r': msg = msg[:-2]
if msg[-6:-4] == 'AZ':
cksum = calculate_cksum(msg[:-4])
return (msg[-4:] == ('%04X' % cksum))
# If there's no checksum, then the message is ok
return True

View file

@ -1,16 +0,0 @@
#!/bin/bash
perl -I ./ -e '
use Data::Dumper;
use C4::SIP::ILS;
use C4::SIP::Sip::Configuration;
my $code = "MAIN";
my $conf = C4::SIP::Sip::Configuration->new("SIPconfig.xml");
my $ils = C4::SIP::ILS->new($conf->{institutions}->{$code});
print "XML for $code: ", Dumper($conf->{institutions}->{$code}), "\n";
print "ILS for $code: ", Dumper($ils), "\n";
print "\$ils->checkout_ok(): ", ($ils->checkout_ok() ? "Y" : "N"), "\n";
print "\$ils->checkin_ok() : ", ($ils->checkin_ok() ? "Y" : "N"), "\n";
print "\$ils->offline_ok() : ", ($ils->offline_ok() ? "Y" : "N"), "\n";
print "\n";
'

View file

@ -1,44 +0,0 @@
#!/usr/bin/perl
#
use warnings;
use strict;
use C4::SIP::ILS::Item;
use Data::Dumper;
my $compare = (@ARGV) ? shift : 0;
while (1) {
print "Enter item barcode: ";
my $in = <>;
defined($in) or last;
chomp($in);
last unless $in;
my $item = C4::SIP::ILS::Item->new($in);
unless ($item) {
print "No item ($in)";
next;
}
for (qw(marc marcxml)) { # Letting it just in case but should not longer be useful
$item->{$_} = 'suppressed...';
}
my $queue = $item->hold_queue();
print "Item ($in): ", Dumper($item);
print "hold_queue: ", Dumper($queue);
my $holdernumber;
if ($queue and scalar(@$queue)) {
$holdernumber = $queue->[0]->{borrowernumber};
print "first borrowernumber: $holdernumber\n";
}
if ($compare) {
print "Enter patron barcode: ";
my $barcode = <>;
defined($barcode) or next;
chomp($barcode);
next unless $barcode;
my $x = ILS::Item::_barcode_to_borrowernumber($barcode) || 'UNDEF';
print " converts to: $x\n";
printf " compares as: %s\n",
($item->barcode_is_borrowernumber($barcode,$holdernumber) ? 'TRUE' : 'FALSE');
}
}

View file

@ -1,26 +0,0 @@
#!/usr/bin/perl
#
use warnings;
use strict;
use C4::SIP::ILS::Patron;
use C4::SIP::Sip qw(sipbool);
use Data::Dumper;
while (1) {
print "Enter patron barcode: ";
my $in = <>;
defined($in) or last;
chomp($in);
last unless $in;
my $patron = C4::SIP::ILS::Patron->new($in);
print Dumper($patron);
$patron or next;
print "Enter patron password: ";
$in = <>;
chomp($in);
print "Raw password is: " . $patron->{password}, "\n";
print " check_password: " . $patron->check_password($in), "\n";
print " sipbool: " . sipbool($patron->check_password($in)), "\n";
}

View file

@ -1,18 +0,0 @@
#!/usr/bin/perl
#
use warnings;
use strict;
use C4::SIP::ILS::Patron;
use Data::Dumper;
while (1) {
print "Enter patron barcode: ";
my $in = <>;
defined($in) or last;
chomp($in);
last unless $in;
my $patron = C4::SIP::ILS::Patron->new($in);
print "Patron ($in):\n", Dumper($patron);
}

View file

@ -1,22 +0,0 @@
#!/usr/bin/perl
#
use warnings;
use strict;
use C4::SIP::ILS::Transaction::RenewAll;
use Data::Dumper;
while (1) {
print "Enter patron barcode: ";
my $in = <>;
defined($in) or last;
chomp($in);
last unless $in;
my $patron = ILS::Patron->new($in);
print "Patron before: \n " . Dumper($patron);
my $action = C4::SIP::ILS::Transaction::RenewAll->new();
$action->do_renew_all();
print "\n\nTransaction::RenewAll: " . Dumper($action);
print "\n", "=" x 35, "\n";
}

View file

@ -1,27 +0,0 @@
97AZFEF5
2300120071003 084235AOkohalibrary|AArch|ACkoha|ADkoha|
2300120060101 084236AOUWOLS|AAmjandkilde|ACterminal password|ADuser password|
2300120060101 084237AOUWOLS|AAdjfiander|ACterminal password|ADuser password|
9300CNLoginUserID|COLoginPassword|CPLocationCode|
11YN20060329 203000 AOUWOLS|AAdjfiander|AB1565921879|AC|
09Y20060102 08423620060113 084235APUnder the bed|AOUWOLS|AB1565921879|ACterminal password|
01N20060102 084238AOUWOLS|ALHe's a jerk|AAdjfiander|ACterminal password|
2520060102 084238AOUWOLS|AAdjfiander|ACterminal password|AD6789|
9910302.00
3520060110 084237AOkohalibrary|AArch|ADkoha|
1720060110 215612AOUWOLS|AB1565921879|
patron information:
6300020060329 201700Y AOkohalibrary|AArch|ACkoha|ADkoha|
15+20060415 110158BW20060815 110158|BSTaylor|BY2|AOUWOLS|AAdjfiander|AB1565921879|
15-20060415 110158AOUWOLS|AAdjfiander|AB1565921879|
29NN20060415 110158 AOUWOLS|AAdjfiander|AD6789|AB1565921879|
6520060415 110158AOUWOLS|AAdjfiander|AD6789|
working:
9300CNkoha|COkoha|CPkohalibrary|

View file

@ -1,31 +0,0 @@
#!/usr/bin/perl
#
# This file reads a SIPServer xml-format configuration file and dumps it
# to stdout. Just to see what the structures look like.
#
# The 'new XML::Simple' option must agree exactly with the configuration
# in Sip::Configuration.pm
#
use strict;
use warnings;
use English;
use XML::Simple qw(:strict);
use Data::Dumper;
my $parser = XML::Simple->new( KeyAttr => { login => '+id',
institution => '+id',
service => '+port', },
GroupTags => { listeners => 'service',
accounts => 'login',
institutions => 'institution', },
ForceArray=> [ 'service',
'login',
'institution' ],
ValueAttr => { 'error-detect' => 'enabled',
'min_servers' => 'value',
'max_servers' => 'value'} );
my $ref = $parser->XMLin(@ARGV ? shift : 'SIPconfig.xml');
print Dumper($ref);