Adding authentication calls to intranet scripts

This commit is contained in:
uid41696 2002-09-09 19:45:40 +00:00
parent c90b87fe42
commit 19cece1350
8 changed files with 39 additions and 2 deletions

View File

@ -11,9 +11,13 @@ use CGI;
use C4::Output;
use C4::Acquisitions;
use C4::Biblio;
use C4::Auth;
my $input = new CGI;
#print $input->header;
my $flagsrequired;
$flagsrequired->{editcatalogue}=1;
my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
my $biblio=$input->param('biblio');
@ -24,7 +28,7 @@ my $count=C4::Acquisitions::itemcount($biblio);
#print $count;
if ($count > 0){
print $input->header;
print $input->header(-cookie => $cookie);
print "This biblio has $count items attached, please delete them before deleting this biblio<p>
";
} else {

View File

@ -11,8 +11,13 @@ use CGI;
use C4::Output;
use C4::Acquisitions;
use C4::Biblio;
use C4::Auth;
my $input = new CGI;
my $flagsrequired;
$flagsrequired->{editcatalogue}=1;
my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
#print $input->header;
my $item=$input->param('itemnum');
delitem($item);

View File

@ -4,6 +4,7 @@
use strict; # please develop with the strict pragma
use Install;
$::language='en';
if ($<) {
print "\n\nYou must run koha.upgrade as root.\n\n";

View File

@ -7,11 +7,17 @@ use C4::Acquisitions;
use C4::Biblio;
use C4::Output;
use C4::Search;
use C4::Auth;
my $input= new CGI;
#print $input->header;
#print $input->Dump;
my $flagsrequired;
$flagsrequired->{editcatalogue}=1;
my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
my $bibitemnum = checkinp($input->param('bibitemnum'));
my $bibnum = checkinp($input->param('bibnum'));

View File

@ -6,11 +6,16 @@ use strict;
use C4::Acquisitions;
use C4::Biblio;
use C4::Output;
use C4::Auth;
my $input= new CGI;
#print $input->header;
#print $input->dump;
my $flagsrequired;
$flagsrequired->{editcatalogue}=1;
my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
my $title=checkinp($input->param('Title'));
my $author=checkinp($input->param('Author'));

View File

@ -9,12 +9,17 @@ use strict;
use CGI;
use C4::Output;
use C4::Database;
use C4::Auth;
my $input = new CGI;
#print $input->header;
#print startpage();
#print startmenu('issue');
#
my $flagsrequired;
$flagsrequired->{updatecharges}=1;
my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 0, $flagsrequired);
my $dbh=C4Connect;
#print $input->dump;

View File

@ -8,10 +8,16 @@ use C4::Biblio;
use C4::Output;
use C4::Circulation::Circ2;
use C4::Accounts2;
use C4::Auth;
my $env;
my $input= new CGI;
my $flagsrequired;
$flagsrequired->{editcatalogue}=1;
my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
my $bibnum=checkinp($input->param('bibnum'));
my $itemnum=checkinp($input->param('itemnumber'));
my $copyright=checkinp($input->param('Copyright'));

View File

@ -135,13 +135,15 @@ my %tabledata=(
userflags => [
{ uniquefieldrequired => 'bit', bit => 0, flag => 'superlibrarian', flagdesc => 'Access to all librarian functions', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 1, flag => 'circulate', flagdesc => 'Circulate books', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 2, flag => 'catalogue', flagdesc => 'Catalogue books', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 2, flag => 'catalogue', flagdesc => 'View Catalogue (Librarian Interface)', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 3, flag => 'parameters', flagdesc => 'Set Koha system paramters', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 4, flag => 'borrowers', flagdesc => 'Add or modify borrowers', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 5, flag => 'permissions', flagdesc => 'Set user permissions', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 6, flag => 'reserveforothers', flagdesc => 'Reserve books for patrons', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 7, flag => 'borrow', flagdesc => 'Borrow books', defaulton => 1 },
{ uniquefieldrequired => 'bit', bit => 8, flag => 'reserveforself', flagdesc => 'Reserve books for self', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 9, flag => 'editcatalogue', flagdesc => 'Edit Catalogue (Modify bibliographic/holdings data)', defaulton => 0 },
{ uniquefieldrequired => 'bit', bit => 10, flag => 'updatecharges', flagdesc => 'Update borrower charges', defaulton => 0 },
],
systempreferences => [
{ uniquefieldrequired => 'variable', variable => 'autoMemberNum', value => '1' },
@ -352,6 +354,9 @@ $dbh->disconnect;
exit;
# $Log$
# Revision 1.4.2.20 2002/09/09 19:45:40 uid41696
# Adding authentication calls to intranet scripts
#
# Revision 1.4.2.19 2002/07/26 18:23:54 tonnesen
# Added flags to borrowers table and userflags table. Also, OPAC scripts now
# check for the existence of a file named 'opac' in the directory they are run