adding authentification with Auth.pm
authortipaul <tipaul>
Thu, 12 Dec 2002 16:33:58 +0000 (16:33 +0000)
committertipaul <tipaul>
Thu, 12 Dec 2002 16:33:58 +0000 (16:33 +0000)
MARCdetail.pl
koha-tmpl/intranet-tmpl/default/en/acqui.simple/additem.tmpl
koha-tmpl/intranet-tmpl/default/en/user/userpage.tmpl
search.pl
thesaurus_popup.pl
value_builder/unimarc_field_100.pl
value_builder/unimarc_field_225a.pl
value_builder/unimarc_field_700-4.pl
value_builder/unimarc_field_700_701_702.pl

index b82d6fa..28f7c0c 100755 (executable)
@@ -40,6 +40,7 @@ The 10 firsts presents the biblio, the 11th one presents the items attached to t
 
 use strict;
 require Exporter;
+use C4::Auth;
 use C4::Context;
 use C4::Output;
 use CGI;
@@ -61,7 +62,15 @@ my $tagslib = &MARCgettagslib($dbh,1);
 my $record =MARCgetbiblio($dbh,$bibid);
 #warn $record->as_formatted();
 # open template
-my $template = gettemplate("catalogue/MARCdetail.tmpl",0);
+my ($template, $loggedinuser, $cookie)
+               = get_template_and_user({template_name => "catalogue/MARCdetail.tmpl",
+                            query => $query,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {catalogue => 1},
+                            debug => 1,
+                            });
+
 # fill arrays
 my @loop_data =();
 my $tag;
@@ -144,5 +153,5 @@ $template->param(item_loop => \@item_value_loop,
                                                item_header_loop => \@header_value_loop,
                                                biblionumber => $biblionumber,
                                                bibid => $bibid);
-print "Content-Type: text/html\n\n", $template->output;
+print $query->header(-cookie => $cookie),$template->output;
 
index 44d14ef..9cc7f06 100644 (file)
        </tr>
        </tmpl_loop>
 </table>
-<input type="hidden" name="tag" value="<TMPL_VAR name="itemtagfield">">
-<input type="hidden" name="subfield" value="<TMPL_VAR name="itemtagsubfield">">
-<input type="hidden" name="field_value" value="<TMPL_VAR name="itemnum">">
 <input type="hidden" name="itemnum" value="<TMPL_VAR name="itemnum">">
 <TMPL_IF name="opisadd">
 <input type="submit" value="Add item">
 <TMPL_ELSE>
+<input type="hidden" name="tag" value="<TMPL_VAR name="itemtagfield">">
+<input type="hidden" name="subfield" value="<TMPL_VAR name="itemtagsubfield">">
+<input type="hidden" name="field_value" value="<TMPL_VAR name="itemnum">">
 <input type="submit" value="Modify item">
 </TMPL_IF>
 </center>
index 2ae7067..d78fbca 100644 (file)
@@ -1,4 +1,4 @@
-<TMPL_INCLUDE NAME="opac-top.inc">
+<TMPL_INCLUDE NAME="members-top.inc">
 
 <TMPL_IF NAME="loggedinuser">
        <p align=left>Logged in as: <TMPL_VAR NAME="loggedinuser"> [<a href=/cgi-bin/koha/logout.pl>Log Out</a>]</p>
@@ -86,4 +86,4 @@
        </center>
 </TMPL_IF>
 
-<TMPL_INCLUDE NAME="opac-bottom.inc">
+<TMPL_INCLUDE NAME="members-bottom.inc">
index 81677bc..f9dfc5f 100755 (executable)
--- a/search.pl
+++ b/search.pl
@@ -20,6 +20,7 @@
 use strict;
 require Exporter;
 use CGI;
+use C4::Auth;
 use HTML::Template;
 use C4::Context;
 use C4::Search;
@@ -37,12 +38,26 @@ my $startfrom=$query->param('startfrom');
 ($startfrom) || ($startfrom=0);
 
 my $subject=$query->param('subject');
-my $template;
 # if it's a subject we need to use the subject.tmpl
+my ($template, $loggedinuser, $cookie);
 if ($subject) {
-       $template = gettemplate("catalogue/subject.tmpl",0);
+       ($template, $loggedinuser, $cookie)
+               = get_template_and_user({template_name => "catalogue/subject.tmpl",
+                            query => $query,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {catalogue => 1},
+                            debug => 1,
+                            });
 } else {
-       $template = gettemplate("catalogue/searchresults.tmpl", 0);
+       ($template, $loggedinuser, $cookie)
+               = get_template_and_user({template_name => "catalogue/searchresults.tmpl",
+                            query => $query,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {catalogue => 1},
+                            debug => 1,
+                            });
 }
 
 # %env
index 56bcc7f..3038b67 100755 (executable)
@@ -22,6 +22,7 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use CGI;
 use C4::Context;
 use HTML::Template;
@@ -58,8 +59,14 @@ if ($op eq "add") {
        newauthority($dbh,$category,$insert,$insert,'',1,'');
        $search_string=$insert;
 }
-
-my $template = gettemplate("thesaurus_popup.tmpl",0);
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "thesaurus_popup.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {parameters => 1},
+                            debug => 1,
+                            });
 # /search thesaurus terms starting by search_string
 my @freelib;
 my %stdlib;
@@ -86,6 +93,6 @@ $template->param(select_list => $select_list,
                                                category => $category,
                                                index => $index
                                                );
-print "Content-Type: text/html\n\n", $template->output;
+print $input->header(-cookie => $cookie),$template->output;
 
 
index 05a67fa..e2f0f28 100755 (executable)
@@ -20,6 +20,7 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use CGI;
 use C4::Context;
 use HTML::Template;
@@ -64,7 +65,14 @@ my ($input) = @_;
 
        my $dbh = C4::Context->dbh;
 
-       my $template = gettemplate("value_builder/unimarc_field_100.tmpl",0);
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "value_builder/unimarc_field_100.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {parameters => 1},
+                            debug => 1,
+                            });
        my $f1 = substr($result,0,8);
        my $f2 = substr($result,8,1);
        my $f3 = substr($result,9,4);
@@ -74,7 +82,7 @@ my ($input) = @_;
                                                        f3 => $f3,
                                                        "f2$f2" => $f2,
                                                        f4 => $f4);
-       print "Content-Type: text/html\n\n", $template->output;
+       print $input->header(-cookie => $cookie),$template->output;
 }
 
 1;
index 3661703..ee99871 100644 (file)
@@ -20,6 +20,7 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use CGI;
 use C4::Context;
 use HTML::Template;
@@ -78,7 +79,14 @@ my ($input) = @_;
        my $isbn_found = $input->param('isbn_found');
        my $dbh = C4::Context->dbh;
        my $authoritysep = C4::Context->preference("authoritysep");
-       my $template = gettemplate("value_builder/unimarc_field_225a.tmpl",0);
+       my ($template, $loggedinuser, $cookie)
+       = get_template_and_user({template_name => "value_builder/unimarc_field_225a.tmpl",
+                                       query => $input,
+                                       type => "intranet",
+                                       authnotrequired => 0,
+                                       flagsrequired => {parameters => 1},
+                                       debug => 1,
+                                       });
 # builds collection list : search isbn and editor, in parent, then load collections from bibliothesaurus table
        my $sth = $dbh->prepare("select stdlib from bibliothesaurus where father=? and category='EDITORS'");
        my @splited = split //, $isbn_found;
@@ -100,7 +108,7 @@ my ($input) = @_;
                                                                                                );
        $template->param(index => $index,
                                                        collection => $collection);
-       print "Content-Type: text/html\n\n", $template->output;
+       print $input->header(-cookie => $cookie),$template->output;
 }
 
 1;
index e010171..bc0cac0 100755 (executable)
@@ -20,6 +20,7 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use CGI;
 use C4::Context;
 use HTML::Template;
@@ -84,12 +85,19 @@ my ($input) = @_;
 
        my $dbh = C4::Context->dbh;
 
-       my $template = gettemplate("value_builder/unimarc_field_700-4.tmpl",0);
+       my ($template, $loggedinuser, $cookie)
+       = get_template_and_user({template_name => "value_builder/unimarc_field_700-4.tmpl",
+                                       query => $input,
+                                       type => "intranet",
+                                       authnotrequired => 0,
+                                       flagsrequired => {parameters => 1},
+                                       debug => 1,
+                                       });
        $template->param(index => $index,
                                                        index2 => $index2,
                                                        "f1_$result" => "f1_".$result,
                                                        );
-       print "Content-Type: text/html\n\n", $template->output;
+       print $input->header(-cookie => $cookie),$template->output;
 }
 
 1;
index ee30274..24215b4 100644 (file)
@@ -20,6 +20,7 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use CGI;
 use C4::Context;
 use HTML::Template;
@@ -138,7 +139,14 @@ sub plugin {
                                -labels=> \%stdlib
                                );
        }
-       my $template = gettemplate("value_builder/unimarc_field_700_701_702.tmpl",0);
+       my ($template, $loggedinuser, $cookie)
+       = get_template_and_user({template_name => "value_builder/unimarc_field_700_701_702.tmpl",
+                                       query => $input,
+                                       type => "intranet",
+                                       authnotrequired => 0,
+                                       flagsrequired => {parameters => 1},
+                                       debug => 1,
+                                       });
 # builds collection list : search isbn and editor, in parent, then load collections from bibliothesaurus table
        $template->param(index => $index,
                                                        result =>$result,
@@ -148,7 +156,7 @@ sub plugin {
                                                        b => $b,
                                                        c => $c,
                                                        f => $f,);
-       print "Content-Type: text/html\n\n", $template->output;
+       print $input->header(-cookie => $cookie),$template->output;
 }
 
 1;