adding authentification with Auth.pm
(note : i want to stay the 1st commiter in december as in november :-) )
This commit is contained in:
parent
d10e9b539c
commit
5f3749d437
|
|
@ -8,9 +8,14 @@ use C4::Database;
|
|||
use HTML::Template;
|
||||
|
||||
my $query = new CGI;
|
||||
my ($loggedinuser, $cookie, $sessionID) = checkauth($query);
|
||||
|
||||
my $template = gettemplate("parameters/admin-home.tmpl");
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/admin-home.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
$template->param(loggeninuser => $loggedinuser);
|
||||
|
||||
print $query->header(-cookie => $cookie),$template->output;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
use C4::Search;
|
||||
|
|
@ -73,7 +74,15 @@ my $pagesize=20;
|
|||
my $op = $input->param('op');
|
||||
$searchfield=~ s/\,//g;
|
||||
|
||||
my $template = gettemplate("parameters/aqbookfund.tmpl",0);
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/aqbookfund.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
if ($op) {
|
||||
$template->param(script_name => $script_name,
|
||||
$op => 1); # we show only the TMPL_VAR names $op
|
||||
|
|
@ -196,6 +205,4 @@ if ($op eq 'add_form') {
|
|||
$template->param(bookfund => \@loop_data);
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
use C4::Search;
|
||||
|
|
@ -75,7 +76,15 @@ my $pagesize=20;
|
|||
my $op = $input->param('op');
|
||||
$searchfield=~ s/\,//g;
|
||||
|
||||
my $template = gettemplate("parameters/aqbudget.tmpl",0);
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/aqbudget.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
if ($op) {
|
||||
$template->param(script_name => $script_name,
|
||||
$op => 1); # we show only the TMPL_VAR names $op
|
||||
|
|
@ -217,4 +226,5 @@ if ($op eq 'add_form') {
|
|||
$template->param(budget => \@loop_data);
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
use C4::Search;
|
||||
|
|
@ -55,7 +56,14 @@ my $offset=$input->param('offset');
|
|||
my $script_name="/cgi-bin/koha/admin/authorised_values.pl";
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
||||
my $template = gettemplate("parameters/authorised_values.tmpl",0);
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/authorised_values.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
my $pagesize=20;
|
||||
my $op = $input->param('op');
|
||||
|
||||
|
|
@ -180,4 +188,4 @@ if ($op eq 'add_form') {
|
|||
}
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
use HTML::Template;
|
||||
|
|
@ -42,7 +43,14 @@ my $input = new CGI;
|
|||
my $branchcode=$input->param('branchcode');
|
||||
my $op = $input->param('op');
|
||||
|
||||
my $template = gettemplate("parameters/branches.tmpl",0);
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/branches.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
if ($op) {
|
||||
$template->param(script_name => $script_name,
|
||||
$op => 1); # we show only the TMPL_VAR names $op
|
||||
|
|
@ -53,7 +61,7 @@ $template->param(script_name => $script_name,
|
|||
$template->param(action => $script_name);
|
||||
|
||||
if ($op eq 'add') {
|
||||
# If the user has pressed the "add new branch" button.
|
||||
# If the user has pressed the "add new branch" button.
|
||||
heading("Branches: Add Branch");
|
||||
editbranchform();
|
||||
|
||||
|
|
@ -368,4 +376,4 @@ sub checkdatabasefor {
|
|||
return $message;
|
||||
}
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
use strict;
|
||||
use C4::Output;
|
||||
use C4::Auth;
|
||||
use CGI;
|
||||
use C4::Search;
|
||||
use C4::Context;
|
||||
|
|
@ -33,7 +34,14 @@ my $kohafield = $input->param('kohafield');
|
|||
my $op=$input->param('op');
|
||||
my $script_name = 'koha2marclinks.pl';
|
||||
|
||||
my $template = gettemplate("parameters/koha2marclinks.tmpl",0);
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/koha2marclinks.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
if ($op) {
|
||||
$template->param(script_name => $script_name,
|
||||
|
|
@ -127,4 +135,4 @@ if ($op eq 'add_form') {
|
|||
);
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
use strict;
|
||||
use C4::Output;
|
||||
use C4::Auth;
|
||||
use CGI;
|
||||
use C4::Search;
|
||||
use C4::Context;
|
||||
|
|
@ -55,7 +56,14 @@ my $reqdel="delete from marc_subfield_structure where tagfield='$tagfield' and t
|
|||
my $offset=$input->param('offset');
|
||||
my $script_name="/cgi-bin/koha/admin/marc_subfields_structure.pl";
|
||||
|
||||
my $template = gettemplate("parameters/marc_subfields_structure.tmpl",0);
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/marc_subfields_structure.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
my $pagesize=30;
|
||||
my $op = $input->param('op');
|
||||
$tagfield=~ s/\,//g;
|
||||
|
|
@ -339,4 +347,4 @@ if ($op eq 'add_form') {
|
|||
}
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
use C4::Search;
|
||||
|
|
@ -55,7 +56,14 @@ my $script_name="/cgi-bin/koha/admin/marctagstructure.pl";
|
|||
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
||||
my $template = gettemplate("parameters/marctagstructure.tmpl",0);
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/marctagstructure.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
my $pagesize=20;
|
||||
my $op = $input->param('op');
|
||||
$searchfield=~ s/\,//g;
|
||||
|
|
@ -186,4 +194,5 @@ if ($op eq 'add_form') {
|
|||
}
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
$template->param(loggeninuser => $loggedinuser);
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
use C4::Search;
|
||||
|
|
@ -73,7 +74,14 @@ my $reqdel="delete from systempreferences where $pkfield='$searchfield'";
|
|||
my $offset=$input->param('offset');
|
||||
my $script_name="/cgi-bin/koha/admin/systempreferences.pl";
|
||||
|
||||
my $template = gettemplate("parameters/systempreferences.tmpl",0);
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/systempreferences.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
my $pagesize=20;
|
||||
my $op = $input->param('op');
|
||||
$searchfield=~ s/\,//g;
|
||||
|
|
@ -176,4 +184,4 @@ if ($op eq 'add_form') {
|
|||
}
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
use C4::Search;
|
||||
|
|
@ -43,7 +44,15 @@ my $script_name="/cgi-bin/koha/admin/thesaurus.pl";
|
|||
my $dbh = C4::Context->dbh;
|
||||
my $authoritysep = C4::Context->preference("authoritysep");
|
||||
|
||||
my $template = gettemplate("parameters/thesaurus.tmpl",0);
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
= get_template_and_user({template_name => "parameters/thesaurus.tmpl",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
my $pagesize=20;
|
||||
|
||||
my $prevpage = $offset-$pagesize;
|
||||
|
|
@ -247,4 +256,4 @@ if ($op eq 'add_form') {
|
|||
}
|
||||
} #---- END $OP eq DEFAULT
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
print $input->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
|
|
@ -8,8 +8,14 @@ use C4::Database;
|
|||
use HTML::Template;
|
||||
|
||||
my $query = new CGI;
|
||||
my ($loggedinuser, $cookie, $sessionID) = checkauth($query);
|
||||
my $template = gettemplate("catalogue/catalogue-home.tmpl");
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "catalogue/catalogue-home.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
my $classlist='';
|
||||
#open C, "$intranetdir/htdocs/includes/cat-class-list.inc";
|
||||
|
|
@ -18,6 +24,6 @@ my $classlist='';
|
|||
#}
|
||||
$template->param(loggedinuser => $loggedinuser,
|
||||
classlist => $classlist,
|
||||
opac => 0);
|
||||
type => 'intranet',);
|
||||
|
||||
print $query->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
11
mainpage.pl
11
mainpage.pl
|
|
@ -8,8 +8,13 @@ use CGI;
|
|||
use C4::Auth;
|
||||
|
||||
my $query = new CGI;
|
||||
my ($loggedinuser, $cookie, $sessionID) = checkauth($query);
|
||||
|
||||
my $template = gettemplate("intranet-main.tmpl");
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "intranet-main.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
print $query->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
15
userpage.pl
15
userpage.pl
|
|
@ -26,11 +26,16 @@ use CGI;
|
|||
use C4::Search;
|
||||
use C4::Auth;
|
||||
|
||||
my $query=new CGI;
|
||||
my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 0);
|
||||
my $query = new CGI;
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "user/userpage.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {parameters => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
my $template = gettemplate("user/userpage.tmpl",0);
|
||||
|
||||
$template->param(loggedinuser => $loggedinuser);
|
||||
warn "userloggedin : $loggedinuser (".$query->param('userid')." et ".$query->param('password');
|
||||
|
||||
print $query->header(-cookie => $cookie), $template->output;
|
||||
|
|
|
|||
Loading…
Reference in New Issue