View | Details | Raw Unified | Return to bug 4289
Collapse All | Expand All

(-)a/C4/Auth.pm (-1 / +5 lines)
Lines 456-461 sub get_template_and_user { Link Here
456
            SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
456
            SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
457
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
457
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
458
        );
458
        );
459
460
        $template->param(OpacPublic => '1') if ($template->param( 'loggedinusername') || C4::Context->preference("OpacPublic"));
459
    }
461
    }
460
	$template->param(listloop=>[{shelfname=>"Freelist", shelfnumber=>110}]);
462
	$template->param(listloop=>[{shelfname=>"Freelist", shelfnumber=>110}]);
461
    return ( $template, $borrowernumber, $cookie, $flags);
463
    return ( $template, $borrowernumber, $cookie, $flags);
Lines 943-950 sub checkauth { Link Here
943
        TemplateEncoding   => C4::Context->preference("TemplateEncoding"),
945
        TemplateEncoding   => C4::Context->preference("TemplateEncoding"),
944
        IndependantBranches=> C4::Context->preference("IndependantBranches"),
946
        IndependantBranches=> C4::Context->preference("IndependantBranches"),
945
        AutoLocation       => C4::Context->preference("AutoLocation"),
947
        AutoLocation       => C4::Context->preference("AutoLocation"),
946
		wrongip            => $info{'wrongip'}
948
		wrongip            => $info{'wrongip'},
947
    );
949
    );
950
951
    $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
948
    $template->param( loginprompt => 1 ) unless $info{'nopermission'};
952
    $template->param( loginprompt => 1 ) unless $info{'nopermission'};
949
953
950
    if ($cas) { 
954
    if ($cas) { 
(-)a/installer/data/mysql/updatedatabase.pl (+6 lines)
Lines 3744-3749 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3744
    SetVersion ($DBversion);
3744
    SetVersion ($DBversion);
3745
}
3745
}
3746
3746
3747
$DBversion = "3.00.xx.xxx";
3748
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3749
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacPublic','1','If set to OFF and user is not logged in, all  OPAC pages require authentication, and OPAC searchbar is removed)','','YesNo')");
3750
    print "Upgrade to $DBversion done (added 'OpacNotPublic' syspref)\n";
3751
    SetVersion ($DBversion);
3752
}
3747
3753
3748
=item DropAllForeignKeys($table)
3754
=item DropAllForeignKeys($table)
3749
3755
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc (+4 lines)
Lines 25-30 Link Here
25
   <!-- /TMPL_IF --><a href="/cgi-bin/koha/opac-main.pl"><!-- TMPL_IF NAME="LibraryName" --><!-- TMPL_VAR NAME="LibraryName" --><!-- TMPL_ELSE -->Koha Online Catalog<!-- /TMPL_IF --></a></h1>
25
   <!-- /TMPL_IF --><a href="/cgi-bin/koha/opac-main.pl"><!-- TMPL_IF NAME="LibraryName" --><!-- TMPL_VAR NAME="LibraryName" --><!-- TMPL_ELSE -->Koha Online Catalog<!-- /TMPL_IF --></a></h1>
26
26
27
<div id="fluid">
27
<div id="fluid">
28
29
<!-- TMPL_IF NAME="OpacPublic" -->
28
<div id="fluid-offset">
30
<div id="fluid-offset">
29
<!-- TMPL_UNLESS NAME="advsearch" --><form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
31
<!-- TMPL_UNLESS NAME="advsearch" --><form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
30
    <label for="masthead_search" class="left"> Search 
32
    <label for="masthead_search" class="left"> Search 
Lines 120-125 Link Here
120
 </div>
122
 </div>
121
</div>
123
</div>
122
124
125
<!-- /TMPL_IF -->  <!-- OpacPublic --> 
126
123
<!-- TMPL_IF NAME="opacbookbag" --><div id="cartDetails">Your cart is empty.</div><!-- /TMPL_IF -->
127
<!-- TMPL_IF NAME="opacbookbag" --><div id="cartDetails">Your cart is empty.</div><!-- /TMPL_IF -->
124
128
125
<!-- TMPL_IF NAME="virtualshelves" -->
129
<!-- TMPL_IF NAME="virtualshelves" -->
(-)a/opac/opac-ISBDdetail.pl (-1 / +1 lines)
Lines 64-70 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
64
        template_name   => "opac-ISBDdetail.tmpl",
64
        template_name   => "opac-ISBDdetail.tmpl",
65
        query           => $query,
65
        query           => $query,
66
        type            => "opac",
66
        type            => "opac",
67
        authnotrequired => 1,
67
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
68
        debug           => 1,
68
        debug           => 1,
69
    }
69
    }
70
);
70
);
(-)a/opac/opac-MARCdetail.pl (-1 / +1 lines)
Lines 70-76 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
70
        template_name   => "opac-MARCdetail.tmpl",
70
        template_name   => "opac-MARCdetail.tmpl",
71
        query           => $query,
71
        query           => $query,
72
        type            => "opac",
72
        type            => "opac",
73
        authnotrequired => 1,
73
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
74
        debug           => 1,
74
        debug           => 1,
75
    }
75
    }
76
);
76
);
(-)a/opac/opac-addbybiblionumber.pl (-1 / +1 lines)
Lines 59-65 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
59
        template_name   => "opac-addbybiblionumber.tmpl",
59
        template_name   => "opac-addbybiblionumber.tmpl",
60
        query           => $query,
60
        query           => $query,
61
        type            => "opac",
61
        type            => "opac",
62
        authnotrequired => 1,
62
        authnotrequired =>( C4::Context->preference("OpacPublic") ? 1 : 0 ),
63
    }
63
    }
64
);
64
);
65
65
(-)a/opac/opac-alert-subscribe.pl (-1 / +1 lines)
Lines 46-52 my $biblionumber = $query->param('biblionumber'); Link Here
46
        template_name   => "opac-alert-subscribe.tmpl",
46
        template_name   => "opac-alert-subscribe.tmpl",
47
        query           => $query,
47
        query           => $query,
48
        type            => "opac",
48
        type            => "opac",
49
        authnotrequired => 1,
49
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
50
        debug           => 1,
50
        debug           => 1,
51
    }
51
    }
52
);
52
);
(-)a/opac/opac-authorities-home.pl (-1 / +1 lines)
Lines 151-157 else { Link Here
151
            template_name   => "opac-authorities-home.tmpl",
151
            template_name   => "opac-authorities-home.tmpl",
152
            query           => $query,
152
            query           => $query,
153
            type            => 'opac',
153
            type            => 'opac',
154
            authnotrequired => 1,
154
            authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
155
            debug           => 1,
155
            debug           => 1,
156
        }
156
        }
157
    );
157
    );
(-)a/opac/opac-authoritiesdetail.pl (-1 / +1 lines)
Lines 63-69 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
63
        template_name   => "opac-authoritiesdetail.tmpl",
63
        template_name   => "opac-authoritiesdetail.tmpl",
64
        query           => $query,
64
        query           => $query,
65
        type            => "opac",
65
        type            => "opac",
66
        authnotrequired => 1,
66
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
67
        debug           => 1,
67
        debug           => 1,
68
    }
68
    }
69
);
69
);
(-)a/opac/opac-basket.pl (-1 / +1 lines)
Lines 32-38 my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( Link Here
32
        template_name   => "opac-basket.tmpl",
32
        template_name   => "opac-basket.tmpl",
33
        query           => $query,
33
        query           => $query,
34
        type            => "opac",
34
        type            => "opac",
35
        authnotrequired => 1,
35
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
36
        flagsrequired   => { borrow => 1 },
36
        flagsrequired   => { borrow => 1 },
37
    }
37
    }
38
);
38
);
(-)a/opac/opac-browser.pl (-1 / +1 lines)
Lines 44-50 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
44
        template_name   => "opac-browser.tmpl",
44
        template_name   => "opac-browser.tmpl",
45
        query           => $query,
45
        query           => $query,
46
        type            => "opac",
46
        type            => "opac",
47
        authnotrequired => 1,
47
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
48
        debug           => 1,
48
        debug           => 1,
49
    }
49
    }
50
);
50
);
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 55-61 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
55
        template_name   => "opac-detail.tmpl",
55
        template_name   => "opac-detail.tmpl",
56
        query           => $query,
56
        query           => $query,
57
        type            => "opac",
57
        type            => "opac",
58
        authnotrequired => 1,
58
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
59
        flagsrequired   => { borrow => 1 },
59
        flagsrequired   => { borrow => 1 },
60
    }
60
    }
61
);
61
);
(-)a/opac/opac-main.pl (-1 / +1 lines)
Lines 36-42 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
36
        template_name   => "opac-main.tmpl",
36
        template_name   => "opac-main.tmpl",
37
        type            => "opac",
37
        type            => "opac",
38
        query           => $input,
38
        query           => $input,
39
        authnotrequired => 1,
39
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
40
        flagsrequired   => { borrow => 1 },
40
        flagsrequired   => { borrow => 1 },
41
    }
41
    }
42
);
42
);
(-)a/opac/opac-review.pl (-1 / +1 lines)
Lines 36-42 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
36
        template_name   => "opac-review.tmpl",
36
        template_name   => "opac-review.tmpl",
37
        query           => $query,
37
        query           => $query,
38
        type            => "opac",
38
        type            => "opac",
39
        authnotrequired => 1,
39
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
40
    }
40
    }
41
);
41
);
42
42
(-)a/opac/opac-search.pl (-1 / +1 lines)
Lines 80-86 else { Link Here
80
    template_name => $template_name,
80
    template_name => $template_name,
81
    query => $cgi,
81
    query => $cgi,
82
    type => "opac",
82
    type => "opac",
83
    authnotrequired => 1,
83
    authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
84
    }
84
    }
85
);
85
);
86
86
(-)a/opac/opac-sendbasket.pl (-1 / +1 lines)
Lines 38-44 my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( Link Here
38
        template_name   => "opac-sendbasketform.tmpl",
38
        template_name   => "opac-sendbasketform.tmpl",
39
        query           => $query,
39
        query           => $query,
40
        type            => "opac",
40
        type            => "opac",
41
        authnotrequired => 0,
41
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
42
        flagsrequired   => { borrow => 1 },
42
        flagsrequired   => { borrow => 1 },
43
    }
43
    }
44
);
44
);
(-)a/opac/opac-shelves.pl (-1 / +1 lines)
Lines 29-35 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ Link Here
29
        template_name   => "opac-shelves.tmpl",
29
        template_name   => "opac-shelves.tmpl",
30
        query           => $query,
30
        query           => $query,
31
        type            => "opac",
31
        type            => "opac",
32
        authnotrequired => 1,
32
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
33
    });
33
    });
34
$template->param(listsview => 1);
34
$template->param(listsview => 1);
35
# if $loggedinuser is not defined, set it to -1, which should
35
# if $loggedinuser is not defined, set it to -1, which should
(-)a/opac/opac-showmarc.pl (-1 / +1 lines)
Lines 48-54 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ Link Here
48
        template_name   => "opac-showmarc.tmpl",
48
        template_name   => "opac-showmarc.tmpl",
49
        query           => $input,
49
        query           => $input,
50
        type            => "opac",
50
        type            => "opac",
51
        authnotrequired => 1,
51
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
52
        debug           => 1,
52
        debug           => 1,
53
});
53
});
54
54
(-)a/opac/opac-showreviews.pl (-1 / +1 lines)
Lines 34-40 my ( $template, $borrowernumber, $cookie ) = &get_template_and_user( Link Here
34
        template_name   => "opac-showreviews.tmpl",
34
        template_name   => "opac-showreviews.tmpl",
35
        query           => $query,
35
        query           => $query,
36
        type            => "opac",
36
        type            => "opac",
37
        authnotrequired => 1,
37
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
38
    }
38
    }
39
);
39
);
40
40
(-)a/opac/opac-suggestions.pl (-1 / +1 lines)
Lines 44-50 if ( C4::Context->preference("AnonSuggestions") ) { Link Here
44
            template_name   => "opac-suggestions.tmpl",
44
            template_name   => "opac-suggestions.tmpl",
45
            query           => $input,
45
            query           => $input,
46
            type            => "opac",
46
            type            => "opac",
47
            authnotrequired => 1,
47
            authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
48
        }
48
        }
49
    );
49
    );
50
    if ( !$$suggestion{suggestedby} ) {
50
    if ( !$$suggestion{suggestedby} ) {
(-)a/opac/opac-tags_subject.pl (-1 / +1 lines)
Lines 44-50 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
44
        template_name   => "opac-tags_subject.tmpl",
44
        template_name   => "opac-tags_subject.tmpl",
45
        query           => $query,
45
        query           => $query,
46
        type            => "opac",
46
        type            => "opac",
47
        authnotrequired => 1,
47
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
48
        debug           => 1,
48
        debug           => 1,
49
    }
49
    }
50
);
50
);
(-)a/opac/opac-topissues.pl (-1 / +1 lines)
Lines 48-54 my ($template, $borrowernumber, $cookie) Link Here
48
	= get_template_and_user({template_name => 'opac-topissues.tmpl',
48
	= get_template_and_user({template_name => 'opac-topissues.tmpl',
49
				query => $input,
49
				query => $input,
50
				type => "opac",
50
				type => "opac",
51
				authnotrequired => 1,
51
               authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
52
				debug => 1,
52
				debug => 1,
53
				});
53
				});
54
my $dbh = C4::Context->dbh;
54
my $dbh = C4::Context->dbh;
(-)a/opac/opac-user.pl (-1 / +1 lines)
Lines 47-53 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
47
        template_name   => "opac-user.tmpl",
47
        template_name   => "opac-user.tmpl",
48
        query           => $query,
48
        query           => $query,
49
        type            => "opac",
49
        type            => "opac",
50
        authnotrequired => 0,
50
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
51
        flagsrequired   => { borrow => 1 },
51
        flagsrequired   => { borrow => 1 },
52
        debug           => 1,
52
        debug           => 1,
53
    }
53
    }
(-)a/opac/opac-userupdate.pl (-2 / +1 lines)
Lines 40-46 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
40
        template_name   => "opac-userupdate.tmpl",
40
        template_name   => "opac-userupdate.tmpl",
41
        query           => $query,
41
        query           => $query,
42
        type            => "opac",
42
        type            => "opac",
43
        authnotrequired => 0,
43
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
44
        flagsrequired   => { borrow => 1 },
44
        flagsrequired   => { borrow => 1 },
45
        debug           => 1,
45
        debug           => 1,
46
    }
46
    }
47
- 

Return to bug 4289