Browse Source

adding authentification with Auth.pm

3.0.x
tipaul 20 years ago
parent
commit
9d54a6437b
  1. 19
      boraccount.pl
  2. 17
      jmemberentry.pl
  3. 13
      mancredit.pl
  4. 15
      maninvoice.pl
  5. 12
      member.pl
  6. 12
      memberentry.pl
  7. 14
      members-home.pl
  8. 12
      moremember.pl
  9. 16
      readingrec.pl
  10. 13
      reports-home.pl

19
boraccount.pl

@ -24,6 +24,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Auth;
use C4::Output;
use CGI;
use C4::Search;
@ -32,8 +33,16 @@ use HTML::Template;
my $input=new CGI;
my $theme = $input->param('theme'); # only used if allowthemeoverride is set
my %tmpldata = pathtotemplate ( template => 'boraccount.tmpl', theme => $theme );
my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0);
#my %tmpldata = pathtotemplate ( template => 'boraccount.tmpl', theme => $theme );
#my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0);
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "boraccount.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
my $bornum=$input->param('bornum');
#get borrower details
@ -62,12 +71,12 @@ for (my $i=0;$i<$numaccts;$i++){
push(@accountrows, \%row);
}
$template->param( startmenumember => startmenu('member'),
endmenumember => endmenu('member'),
$template->param( startmenumember => join('', startmenu('member')),
endmenumember => join('', endmenu('member')),
firstname => $data->{'firstname'},
surname => $data->{'surname'},
bornum => $bornum,
total => $total,
accounts => \@accountrows );
print "Content-Type: text/html\n\n", $template->output;
print $input->header(-cookie => $cookie),$template->output;

17
jmemberentry.pl

@ -22,6 +22,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Auth;
use C4::Output;
use CGI;
use C4::Search;
@ -29,7 +30,14 @@ use HTML::Template;
my $input = new CGI;
my $template = gettemplate("members/jmemberentry.tmpl");
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/jmemberentry.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
my $member=$input->param('bornum');
if ($member eq ''){
@ -65,9 +73,10 @@ for (my $i=0;$i<3;$i++){
}
$template->param( startmenumember => startmenu('member'),
$template->param( startmenumember => join('', startmenu('member')),
endmenumember => join('', endmenu('member')),
endmenumember => endmenu('member'),
member => $member,
member => $member,
firstname => $data->{'firstname'},
surname => $data->{'surname'},
cardnumber => $data->{'cardnumber'},
@ -85,4 +94,4 @@ $template->param( startmenumember => startmenu('member'),
titleloop => \@titledata,
cmemloop => \@cmemdata );
print "Content-Type: text/html\n\n", $template->output;
print $input->header(-cookie => $cookie),$template->output;

13
mancredit.pl

@ -22,6 +22,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Auth;
use C4::Output;
use CGI;
use HTML::Template;
@ -43,7 +44,15 @@ if ($add){
manualinvoice($bornum,$itemnum,$desc,$type,$amount);
print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$bornum");
} else {
my $template = gettemplate("mancredit.tmpl");
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "mancredit.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
$template->param( bornum => $bornum);
print "Content-Type: text/html\n\n", $template->output;
print $input->header(-cookie => $cookie),$template->output;
}

15
maninvoice.pl

@ -22,6 +22,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Auth;
use C4::Output;
use CGI;
use C4::Search;
@ -43,7 +44,15 @@ if ($add){
manualinvoice($bornum,$itemnum,$desc,$type,$amount);
print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$bornum");
} else {
my $template=gettemplate("maninvoice.tmpl");
$template->param( bornum => $bornum);
print "Content-Type: text/html\n\n", $template->output;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "maninvoice.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
$template->param(bornum => $bornum);
print $input->header(-cookie => $cookie),$template->output;
}

12
member.pl

@ -24,6 +24,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Auth;
use C4::Output;
use CGI;
use C4::Search;
@ -38,7 +39,14 @@ my $theme = $input->param('theme') || "default";
#my $template = HTML::Template->new( filename => $tmpldata{'path'},
# die_on_bad_params => 0,
# loop_context_vars => 1 );
my $template = gettemplate("members/member.tmpl");
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/member.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
my $member=$input->param('member');
$member=~ s/\,//g;
@ -70,4 +78,4 @@ $template->param( startmenumember => join ('', startmenu('member')),
member => $member,
resultsloop => \@resultsdata );
print "Content-Type: text/html\n\n", $template->output;
print $input->header(-cookie => $cookie),$template->output;

12
memberentry.pl

@ -24,6 +24,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Auth;
use C4::Context;
use C4::Output;
use CGI;
@ -33,7 +34,14 @@ use HTML::Template;
my $input = new CGI;
my $template = gettemplate("members/memberentry.tmpl");
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/memberentry.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
my $member=$input->param('bornum');
if ($member eq ''){
@ -234,7 +242,7 @@ if ($delete){
cardnumber => $cardnumber,
dateofbirth => $data->{'dateofbirth'});
print "Content-Type: text/html\n\n", $template->output;
print $input->header(-cookie => $cookie),$template->output;
}

14
members-home.pl

@ -8,11 +8,13 @@ use C4::Context;
use HTML::Template;
my $query = new CGI;
my $flagsrequired;
$flagsrequired->{borrowers}=1;
my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 0, $flagsrequired);
my $template = gettemplate("members/members-home.tmpl");
$template->param(loggedinuser => $loggedinuser);
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/members-home.tmpl",
query => $query,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
print $query->header(-cookie => $cookie),$template->output;

12
moremember.pl

@ -31,6 +31,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Auth;
use C4::Context;
use C4::Output;
use CGI;
@ -46,7 +47,14 @@ my $dbh = C4::Context->dbh;
my $input = new CGI;
my $template = gettemplate("members/moremember.tmpl");
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/moremember.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
my $bornum=$input->param('bornum');
@ -195,4 +203,4 @@ $template->param(startmenumember => join('', startmenu('member')),
issueloop => \@issuedata,
reserveloop => \@reservedata);
print "Content-Type: text/html\n\n", $template->output;
print $input->header(-cookie => $cookie),$template->output;

16
readingrec.pl

@ -23,6 +23,7 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Auth;
use C4::Output;
use CGI;
use C4::Search;
@ -46,11 +47,14 @@ if ($limit eq 'full'){
}
my ($count,$issues)=allissues($bornum,$order2,$limit);
#print $input->header;
#print startpage();
#print startmenu('member');
my $template = gettemplate("members/readingrec.tmpl");
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/readingrec.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
});
my @loop_reading;
@ -68,7 +72,7 @@ $template->param(title => $data->{'title'},
bornum => $bornum,
limit => $limit,
loop_reading => \@loop_reading);
print "Content-Type: text/html\n\n", $template->output;
print $input->header(-cookie => $cookie),$template->output;

13
reports-home.pl

@ -8,9 +8,12 @@ use C4::Context;
use HTML::Template;
my $query = new CGI;
my ($loggedinuser, $cookie, $sessionID) = checkauth($query);
my $template = gettemplate("reports/reports-home.tmpl");
$template->param(loggedinuser => $loggedinuser);
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "reports/reports-home.tmpl",
query => $query,
type => "intranet",
authnotrequired => 0,
flagsrequired => {permissions => 1},
debug => 1,
});
print $query->header(-cookie => $cookie),$template->output;

Loading…
Cancel
Save