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

(-)a/C4/Auth.pm (-1 / +10 lines)
Lines 1197-1203 sub checkauth { Link Here
1197
    $LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi;
1197
    $LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi;
1198
    $LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
1198
    $LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
1199
1199
1200
    my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt';
1200
    my $template_name;
1201
    if( $type eq 'opac' ) {
1202
        $template_name = 'opac-auth.tt'
1203
    }
1204
    elsif( $type eq 'sco' ){
1205
        $template_name = 'sco-auth.tt'
1206
    }
1207
    else { $template_name = 'auth.tt' }
1201
    my $template = C4::Templates::gettemplate( $template_name, $type, $query );
1208
    my $template = C4::Templates::gettemplate( $template_name, $type, $query );
1202
    $template->param(
1209
    $template->param(
1203
        branchloop                            => GetBranchesLoop(),
1210
        branchloop                            => GetBranchesLoop(),
Lines 1243-1248 sub checkauth { Link Here
1243
        PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
1250
        PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
1244
        persona                               => C4::Context->preference("Persona"),
1251
        persona                               => C4::Context->preference("Persona"),
1245
        opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
1252
        opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
1253
        SCOUserCSS                            => C4::Context->preference("SCOUserCSS"),
1254
        SCOUserJS                             => C4::Context->preference("SCOUserJS"),
1246
    );
1255
    );
1247
1256
1248
    $template->param( OpacPublic => C4::Context->preference("OpacPublic") );
1257
    $template->param( OpacPublic => C4::Context->preference("OpacPublic") );
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/alt-auth.inc (+79 lines)
Line 0 Link Here
1
[% IF ( shibbolethAuthentication ) %]
2
3
    [% IF ( invalidShibLogin ) %]
4
    <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
5
        <div class="alert alert-info">
6
            <p>
7
            Sorry, your Shibboleth identity does not match a valid library identity.
8
            [% IF ( casAuthentication ) %]
9
                [% IF ( invalidCasLogin ) %]
10
                <!-- This is what is displayed if cas login has failed -->
11
                    <p>Sorry, the CAS login also failed, if you have a local login you may use that below.</p>
12
                [% ELSE %]
13
                    If you have a CAS account, you may use that below.
14
                [% END %]
15
            [% ELSE %]
16
                If you have a local account, you may use that below.
17
            [% END %]
18
            </p>
19
        </div>
20
    [% ELSE %]
21
        <h4>Shibboleth Login</h4>
22
        <p>If you have a Shibboleth account,
23
         please <a href="[% shibbolethLoginUrl %]">click here to login</a>
24
    [% END %]
25
26
    [% IF ( casAuthentication ) %]
27
        <h4>CAS login</h4>
28
        <p>If you do not have a Shibboleth account, but you do have a CAS account,
29
    [% ELSE %]
30
        <h4>Local login</h4>
31
        <p>If you do not have a Shibboleth account, but you do have a local login, then you may login below:</p>
32
    [% END %]
33
34
[% END %]
35
36
[% IF ( casAuthentication ) %]
37
    [% IF ( shibbolethAuthentication ) %]
38
        [% IF ( casServerUrl ) %]
39
            please <a href="[% casServerUrl %]">click here to login</a>.<p>
40
        [% END %]
41
        [% IF ( casServersLoop ) %]
42
            please choose against which one you would like to authenticate: </p>
43
            <ul>
44
                [% FOREACH casServer IN casServersLoop %]
45
                    <li><a href="[% casServer.value %]">[% casServer.name %]</a></li>
46
                [% END %]
47
            </ul>
48
        [% END %]
49
    [% ELSE %]
50
        <h4>CAS login</h4>
51
52
           [% IF ( invalidCasLogin ) %]
53
               <!-- This is what is displayed if cas login has failed -->
54
               <p>Sorry, the CAS login failed.</p>
55
           [% END %]
56
57
           <p>If you have a CAS account,
58
           [% IF ( casServerUrl ) %]
59
               please <a href="[% casServerUrl %]">click here to login</a>.<p>
60
           [% END %]
61
 
62
           [% IF ( casServersLoop ) %]
63
               please choose against which one you would like to authenticate: </p>
64
               <ul>
65
                   [% FOREACH casServer IN casServersLoop %]
66
                       <li><a href="[% casServer.value %]">[% casServer.name %]</a></li>
67
                   [% END %]
68
                </ul>
69
           [% END %]
70
    [% END %]
71
72
    [% IF ( shibbolethAuthentication ) %]
73
        <p>Nothing</p>
74
    [% ELSE %]
75
        <h4>Local login</h4>
76
        <p>If you do not have a CAS account, but do have a local account, you can still log in: </p>
77
    [% END %]
78
79
[% END # / IF casAuthentication %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc (-1 / +3 lines)
Lines 37-43 Link Here
37
[% IF ( bidi ) %]
37
[% IF ( bidi ) %]
38
    <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
38
    <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
39
[% END %]
39
[% END %]
40
[% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
40
[% UNLESS template.name.match('sco-auth.tt') %]
41
    [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
42
[% END %]
41
<link rel="unapi-server" type="application/xml" title="unAPI" href="[% OPACBaseURL %]/cgi-bin/koha/unapi" />
43
<link rel="unapi-server" type="application/xml" title="unAPI" href="[% OPACBaseURL %]/cgi-bin/koha/unapi" />
42
[% PROCESS cssinclude %]
44
[% PROCESS cssinclude %]
43
<!-- Respond.js brings responsive layout behavior to IE < v.9 -->
45
<!-- Respond.js brings responsive layout behavior to IE < v.9 -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-1 / +3 lines)
Lines 267-278 $(document).ready(function() { Link Here
267
</script>
267
</script>
268
[% PROCESS jsinclude %]
268
[% PROCESS jsinclude %]
269
269
270
[% IF ( OPACUserJS ) %]
270
[% UNLESS template.name.match('sco-auth.tt') %]
271
    [% IF ( OPACUserJS ) %]
271
    <script type="text/javascript">
272
    <script type="text/javascript">
272
        //<![CDATA[
273
        //<![CDATA[
273
        [% OPACUserJS %]
274
        [% OPACUserJS %]
274
        //]]>
275
        //]]>
275
    </script>
276
    </script>
277
    [% END %]
276
[% END %]
278
[% END %]
277
</body>
279
</body>
278
</html>
280
</html>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt (-80 / +1 lines)
Lines 57-142 Link Here
57
                                </div>
57
                                </div>
58
                            [% END %]
58
                            [% END %]
59
59
60
                            [% IF ( shibbolethAuthentication ) %]
60
                            [% INCLUDE 'alt-auth.inc' %]
61
62
                                [% IF ( invalidShibLogin ) %]
63
                                <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
64
                                <div class="alert alert-info">
65
                                    <p>
66
                                    Sorry, your Shibboleth identity does not match a valid library identity.
67
                                    [% IF ( casAuthentication ) %]
68
                                    [% IF ( invalidCasLogin ) %]
69
                                    <!-- This is what is displayed if cas login has failed -->
70
                                    <p>Sorry, the CAS login also failed, if you have a local login you may use that below.</p>
71
                                    [% ELSE %]
72
                                    If you have a CAS account, you may use that below.
73
                                    [% END %]
74
                                    [% ELSE %]
75
                                    If you have a local account, you may use that below.
76
                                    [% END %]
77
                                    </p>
78
                                </div>
79
                                [% ELSE %]
80
                                <h4>Shibboleth Login</h4>
81
82
                                <p>If you have a Shibboleth account,
83
                                please <a href="[% shibbolethLoginUrl %]">click here to login</a>.</p>
84
                                [% END %]
85
                                [% IF ( casAuthentication ) %]
86
                                <h4>CAS login</h4>
87
                                <p>If you do not have a Shibboleth account, but you do have a CAS account,
88
                                [% ELSE %]
89
                                <h4>Local login</h4>
90
                                <p>If you do not have a Shibboleth account, but you do have a local login, then you may login below:</p>
91
                                [% END %]
92
93
                            [% END %]
94
95
                            [% IF ( casAuthentication ) %]
96
                                [% IF ( shibbolethAuthentication ) %]
97
                                [% IF ( casServerUrl ) %]
98
                                    please <a href="[% casServerUrl %]">click here to login</a>.<p>
99
                                [% END %]
100
101
                                [% IF ( casServersLoop ) %]
102
                                    please choose against which one you would like to authenticate: </p>
103
                                    <ul>
104
                                        [% FOREACH casServer IN casServersLoop %]
105
                                        <li><a href="[% casServer.value %]">[% casServer.name %]</a></li>
106
                                        [% END %]
107
                                    </ul>
108
                                [% END %]
109
                                [% ELSE %]
110
                                <h4>CAS login</h4>
111
112
                                [% IF ( invalidCasLogin ) %]
113
                                    <!-- This is what is displayed if cas login has failed -->
114
                                    <p>Sorry, the CAS login failed.</p>
115
                                [% END %]
116
117
                                <p>If you have a CAS account,
118
                                [% IF ( casServerUrl ) %]
119
                                    please <a href="[% casServerUrl %]">click here to login</a>.<p>
120
                                [% END %]
121
122
                                [% IF ( casServersLoop ) %]
123
                                    please choose against which one you would like to authenticate: </p>
124
                                    <ul>
125
                                        [% FOREACH casServer IN casServersLoop %]
126
                                        <li><a href="[% casServer.value %]">[% casServer.name %]</a></li>
127
                                        [% END %]
128
                                    </ul>
129
                                [% END %]
130
                                [% END %]
131
132
                                [% IF ( shibbolethAuthentication ) %]
133
                                <p>Nothing</p>
134
                                [% ELSE %]
135
                                <h4>Local login</h4>
136
                                <p>If you do not have a CAS account, but do have a local account, you can still log in: </p>
137
                                [% END %]
138
139
                            [% END # / IF casAuthentication %]
140
61
141
                            <form action="/cgi-bin/koha/opac-user.pl" name="auth" id="auth" method="post">
62
                            <form action="/cgi-bin/koha/opac-user.pl" name="auth" id="auth" method="post">
142
                                <input type="hidden" name="koha_login_context" value="opac" />
63
                                <input type="hidden" name="koha_login_context" value="opac" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco-auth.tt (+86 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] self-checkout station &rsaquo;
4
    Self-checkout login
5
</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% BLOCK cssinclude %][% END %]
8
[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %]
9
</head>
10
[% INCLUDE 'bodytag.inc' bodyid='sco-login-page' bodyclass='scrollto' %]
11
[% INCLUDE 'masthead.inc' %] 
12
13
<div class="main">
14
    <ul class="breadcrumb">
15
        <li><a href="/cgi-bin/koha/sco/sco-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
16
        <li><a href="#">Log in</a></li>
17
    </ul>
18
19
   <div class="container-fluid">
20
        <div class="row-fluid">
21
            <div class="span7 offset2">
22
                <div id="sco-auth" class="maincontent">
23
                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
24
                        [% IF ( nopermission ) %]
25
                            <!-- This is what is displayed if user doesnt have permission -->
26
                            <div class="alert">
27
                                <h3>Access denied</h3>
28
                                <p>Sorry, the system doesn't think you have permission to access this page. </p>
29
                            </div>
30
                        [% END %]
31
                     [% END %]
32
                    <!--CONTENT-->
33
                [% IF ( loginprompt ) %]
34
                            <!-- login prompt time-->
35
                            <h3>Log in to your account</h3>
36
37
                            [% IF ( timed_out ) %]
38
                                <!-- This is what is displayed if login has timed out -->
39
                                <div class="alert alert-info">
40
                                    <p>Sorry, your session has timed out.  Please log in again.</p>
41
                                </div>
42
                            [% END %]
43
44
                            [% IF ( different_ip ) %]
45
                                <!-- This is what is displayed if user doesnt have permission -->
46
                                <div class="alert alert-info">
47
                                    <p>You are logging from a different IP address.  Please log in again.</p>
48
                                </div>
49
                            [% END %]
50
51
                            [% IF ( invalid_username_or_password ) %]
52
                                <!-- This is what is displayed if user doesnt have permission -->
53
                                <div class="alert alert-info">
54
                                    <p>You entered an incorrect username or password. Please try again! And remember, passwords are case sensitive.</p>
55
                                </div>
56
                            [% END %]
57
                            
58
                            [% INCLUDE 'alt-auth.inc' %] 
59
60
                          <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post">
61
                                <input type="hidden" name="koha_login_context" value="opac" />
62
                                <fieldset class="brief">
63
                                    [% FOREACH INPUT IN INPUTS %]
64
                                        <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" />
65
                                    [% END %]
66
                                    <label for="userid">Login</label>
67
                                    <input type="text"  size="25" id="userid"  name="userid" />
68
                                    <label for="password">Password</label><input type="password"  size="25" id="password"  name="password" />
69
                                </fieldset>
70
71
                                <input type="submit" value="Log in" class="btn" />
72
                                </div>
73
                            </form>
74
                        [% END # / IF loginprompt %]
75
                </div> <!-- /.sco-auth -->
76
            </div> <!-- /.span12 -->
77
        </div> <!-- /.row-fluid -->
78
    </div> <!-- /.container-fluid -->
79
</div> <!-- /.main -->
80
81
[% INCLUDE 'opac-bottom.inc' %]
82
[% BLOCK jsinclude %]
83
[% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
84
</script>
85
[% END %]
86
(-)a/opac/sco/sco-main.pl (-2 / +1 lines)
Lines 67-73 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
67
    authnotrequired => 0,
67
    authnotrequired => 0,
68
    flagsrequired => { circulate => "self_checkout" },
68
    flagsrequired => { circulate => "self_checkout" },
69
    query => $query,
69
    query => $query,
70
    type  => "opac",
70
    type  => "sco",
71
    debug => 1,
71
    debug => 1,
72
});
72
});
73
73
74
- 

Return to bug 12663