Bugzilla – Attachment 46736 Details for
Bug 12663
SCOUserCSS and SCOUserJS ignored on selfcheck login page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12663 - SCOUserCSS and SCOUserJS ignored on selfcheck login page
Bug-12663---SCOUserCSS-and-SCOUserJS-ignored-on-se.patch (text/plain), 18.06 KB, created by
Nick Clemens (kidclamp)
on 2016-01-15 21:05:58 UTC
(
hide
)
Description:
Bug 12663 - SCOUserCSS and SCOUserJS ignored on selfcheck login page
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-01-15 21:05:58 UTC
Size:
18.06 KB
patch
obsolete
>From c613a039c8576efd82fc24fd22f754c24341bae0 Mon Sep 17 00:00:00 2001 >From: Nick <nick@bywatersolutions.com> >Date: Fri, 15 Jan 2016 15:46:46 -0500 >Subject: [PATCH] Bug 12663 - SCOUserCSS and SCOUserJS ignored on selfcheck > login page > >Currently if not logged in when browsing to >http://YOURCATALOG/cgi-bin/koha/sco/sco-main.pl >You are redirected to opac-auth.pl and SCOUserCSS and SCOUserJS are not >loaded. This patch adds new opac-auth.tt file for authenticating SCO users which >loads these files and redirects a login to the SCO module instead of the patron >account > >Common code between opac-auth and sco-auth is mostly alternate login info and has been >move to alt-auth.inc > >To test: >1 - Verify that normal login works on both staff and opac >2 - Verify that SCO login goes to a new page >3 - Enter changes into SCOUserJS and SCOUserCSS and observe these are present on >SOC log in page >4 - Verify that a logged in opac user without permissions cannot access the self-checkout module >5 - Verify that AutoSelfCheckAllowed and associated system preferences function as expected >6 - Verify the AutoSelfCheck user is logged out if they attempt to visit another page >Bonus points for verifying all alternate methonds of login function as expected > >Sponsored by Northeast Kansas Libary System (NEKLS) www.nekls.org >--- > C4/Auth.pm | 11 ++- > .../opac-tmpl/bootstrap/en/includes/alt-auth.inc | 79 ++++++++++++++++++++ > .../bootstrap/en/includes/doc-head-close.inc | 4 +- > .../bootstrap/en/includes/opac-bottom.inc | 4 +- > .../opac-tmpl/bootstrap/en/modules/opac-auth.tt | 81 +------------------- > .../opac-tmpl/bootstrap/en/modules/sco-auth.tt | 86 ++++++++++++++++++++++ > opac/sco/sco-main.pl | 2 +- > 7 files changed, 183 insertions(+), 84 deletions(-) > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/alt-auth.inc > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/sco-auth.tt > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index cda7ae0..bd06804 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1197,7 +1197,14 @@ sub checkauth { > $LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi; > $LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg; > >- my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt'; >+ my $template_name; >+ if( $type eq 'opac' ) { >+ $template_name = 'opac-auth.tt' >+ } >+ elsif( $type eq 'sco' ){ >+ $template_name = 'sco-auth.tt' >+ } >+ else { $template_name = 'auth.tt' } > my $template = C4::Templates::gettemplate( $template_name, $type, $query ); > $template->param( > branchloop => GetBranchesLoop(), >@@ -1243,6 +1250,8 @@ sub checkauth { > PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), > persona => C4::Context->preference("Persona"), > opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, >+ SCOUserCSS => C4::Context->preference("SCOUserCSS"), >+ SCOUserJS => C4::Context->preference("SCOUserJS"), > ); > > $template->param( OpacPublic => C4::Context->preference("OpacPublic") ); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/alt-auth.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/alt-auth.inc >new file mode 100644 >index 0000000..91bb1c6 >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/alt-auth.inc >@@ -0,0 +1,79 @@ >+[% IF ( shibbolethAuthentication ) %] >+ >+ [% IF ( invalidShibLogin ) %] >+ <!-- This is what is displayed if shibboleth login has failed to match a koha user --> >+ <div class="alert alert-info"> >+ <p> >+ Sorry, your Shibboleth identity does not match a valid library identity. >+ [% IF ( casAuthentication ) %] >+ [% IF ( invalidCasLogin ) %] >+ <!-- This is what is displayed if cas login has failed --> >+ <p>Sorry, the CAS login also failed, if you have a local login you may use that below.</p> >+ [% ELSE %] >+ If you have a CAS account, you may use that below. >+ [% END %] >+ [% ELSE %] >+ If you have a local account, you may use that below. >+ [% END %] >+ </p> >+ </div> >+ [% ELSE %] >+ <h4>Shibboleth Login</h4> >+ <p>If you have a Shibboleth account, >+ please <a href="[% shibbolethLoginUrl %]">click here to login</a> >+ [% END %] >+ >+ [% IF ( casAuthentication ) %] >+ <h4>CAS login</h4> >+ <p>If you do not have a Shibboleth account, but you do have a CAS account, >+ [% ELSE %] >+ <h4>Local login</h4> >+ <p>If you do not have a Shibboleth account, but you do have a local login, then you may login below:</p> >+ [% END %] >+ >+[% END %] >+ >+[% IF ( casAuthentication ) %] >+ [% IF ( shibbolethAuthentication ) %] >+ [% IF ( casServerUrl ) %] >+ please <a href="[% casServerUrl %]">click here to login</a>.<p> >+ [% END %] >+ [% IF ( casServersLoop ) %] >+ please choose against which one you would like to authenticate: </p> >+ <ul> >+ [% FOREACH casServer IN casServersLoop %] >+ <li><a href="[% casServer.value %]">[% casServer.name %]</a></li> >+ [% END %] >+ </ul> >+ [% END %] >+ [% ELSE %] >+ <h4>CAS login</h4> >+ >+ [% IF ( invalidCasLogin ) %] >+ <!-- This is what is displayed if cas login has failed --> >+ <p>Sorry, the CAS login failed.</p> >+ [% END %] >+ >+ <p>If you have a CAS account, >+ [% IF ( casServerUrl ) %] >+ please <a href="[% casServerUrl %]">click here to login</a>.<p> >+ [% END %] >+ >+ [% IF ( casServersLoop ) %] >+ please choose against which one you would like to authenticate: </p> >+ <ul> >+ [% FOREACH casServer IN casServersLoop %] >+ <li><a href="[% casServer.value %]">[% casServer.name %]</a></li> >+ [% END %] >+ </ul> >+ [% END %] >+ [% END %] >+ >+ [% IF ( shibbolethAuthentication ) %] >+ <p>Nothing</p> >+ [% ELSE %] >+ <h4>Local login</h4> >+ <p>If you do not have a CAS account, but do have a local account, you can still log in: </p> >+ [% END %] >+ >+[% END # / IF casAuthentication %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >index e346689..a6945b5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >@@ -37,7 +37,9 @@ > [% IF ( bidi ) %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" /> > [% END %] >-[% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %] >+[% UNLESS template.name.match('sco-auth.tt') %] >+ [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %] >+[% END %] > <link rel="unapi-server" type="application/xml" title="unAPI" href="[% OPACBaseURL %]/cgi-bin/koha/unapi" /> > [% PROCESS cssinclude %] > <!-- Respond.js brings responsive layout behavior to IE < v.9 --> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 30ba396..0965619 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -267,12 +267,14 @@ $(document).ready(function() { > </script> > [% PROCESS jsinclude %] > >-[% IF ( OPACUserJS ) %] >+[% UNLESS template.name.match('sco-auth.tt') %] >+ [% IF ( OPACUserJS ) %] > <script type="text/javascript"> > //<![CDATA[ > [% OPACUserJS %] > //]]> > </script> >+ [% END %] > [% END %] > </body> > </html> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >index 3dc1c56..9b581f9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >@@ -57,86 +57,7 @@ > </div> > [% END %] > >- [% IF ( shibbolethAuthentication ) %] >- >- [% IF ( invalidShibLogin ) %] >- <!-- This is what is displayed if shibboleth login has failed to match a koha user --> >- <div class="alert alert-info"> >- <p> >- Sorry, your Shibboleth identity does not match a valid library identity. >- [% IF ( casAuthentication ) %] >- [% IF ( invalidCasLogin ) %] >- <!-- This is what is displayed if cas login has failed --> >- <p>Sorry, the CAS login also failed, if you have a local login you may use that below.</p> >- [% ELSE %] >- If you have a CAS account, you may use that below. >- [% END %] >- [% ELSE %] >- If you have a local account, you may use that below. >- [% END %] >- </p> >- </div> >- [% ELSE %] >- <h4>Shibboleth Login</h4> >- >- <p>If you have a Shibboleth account, >- please <a href="[% shibbolethLoginUrl %]">click here to login</a>.</p> >- [% END %] >- [% IF ( casAuthentication ) %] >- <h4>CAS login</h4> >- <p>If you do not have a Shibboleth account, but you do have a CAS account, >- [% ELSE %] >- <h4>Local login</h4> >- <p>If you do not have a Shibboleth account, but you do have a local login, then you may login below:</p> >- [% END %] >- >- [% END %] >- >- [% IF ( casAuthentication ) %] >- [% IF ( shibbolethAuthentication ) %] >- [% IF ( casServerUrl ) %] >- please <a href="[% casServerUrl %]">click here to login</a>.<p> >- [% END %] >- >- [% IF ( casServersLoop ) %] >- please choose against which one you would like to authenticate: </p> >- <ul> >- [% FOREACH casServer IN casServersLoop %] >- <li><a href="[% casServer.value %]">[% casServer.name %]</a></li> >- [% END %] >- </ul> >- [% END %] >- [% ELSE %] >- <h4>CAS login</h4> >- >- [% IF ( invalidCasLogin ) %] >- <!-- This is what is displayed if cas login has failed --> >- <p>Sorry, the CAS login failed.</p> >- [% END %] >- >- <p>If you have a CAS account, >- [% IF ( casServerUrl ) %] >- please <a href="[% casServerUrl %]">click here to login</a>.<p> >- [% END %] >- >- [% IF ( casServersLoop ) %] >- please choose against which one you would like to authenticate: </p> >- <ul> >- [% FOREACH casServer IN casServersLoop %] >- <li><a href="[% casServer.value %]">[% casServer.name %]</a></li> >- [% END %] >- </ul> >- [% END %] >- [% END %] >- >- [% IF ( shibbolethAuthentication ) %] >- <p>Nothing</p> >- [% ELSE %] >- <h4>Local login</h4> >- <p>If you do not have a CAS account, but do have a local account, you can still log in: </p> >- [% END %] >- >- [% END # / IF casAuthentication %] >+ [% INCLUDE 'alt-auth.inc' %] > > <form action="/cgi-bin/koha/opac-user.pl" name="auth" id="auth" method="post"> > <input type="hidden" name="koha_login_context" value="opac" /> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco-auth.tt >new file mode 100644 >index 0000000..1d0ec8d >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco-auth.tt >@@ -0,0 +1,86 @@ >+[% USE Koha %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] self-checkout station › >+ Self-checkout login >+</title> >+[% INCLUDE 'doc-head-close.inc' %] >+[% BLOCK cssinclude %][% END %] >+[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %] >+</head> >+[% INCLUDE 'bodytag.inc' bodyid='sco-login-page' bodyclass='scrollto' %] >+[% INCLUDE 'masthead.inc' %] >+ >+<div class="main"> >+ <ul class="breadcrumb"> >+ <li><a href="/cgi-bin/koha/sco/sco-main.pl">Home</a> <span class="divider">›</span></li> >+ <li><a href="#">Log in</a></li> >+ </ul> >+ >+ <div class="container-fluid"> >+ <div class="row-fluid"> >+ <div class="span7 offset2"> >+ <div id="sco-auth" class="maincontent"> >+ [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >+ [% IF ( nopermission ) %] >+ <!-- This is what is displayed if user doesnt have permission --> >+ <div class="alert"> >+ <h3>Access denied</h3> >+ <p>Sorry, the system doesn't think you have permission to access this page. </p> >+ </div> >+ [% END %] >+ [% END %] >+ <!--CONTENT--> >+ [% IF ( loginprompt ) %] >+ <!-- login prompt time--> >+ <h3>Log in to your account</h3> >+ >+ [% IF ( timed_out ) %] >+ <!-- This is what is displayed if login has timed out --> >+ <div class="alert alert-info"> >+ <p>Sorry, your session has timed out. Please log in again.</p> >+ </div> >+ [% END %] >+ >+ [% IF ( different_ip ) %] >+ <!-- This is what is displayed if user doesnt have permission --> >+ <div class="alert alert-info"> >+ <p>You are logging from a different IP address. Please log in again.</p> >+ </div> >+ [% END %] >+ >+ [% IF ( invalid_username_or_password ) %] >+ <!-- This is what is displayed if user doesnt have permission --> >+ <div class="alert alert-info"> >+ <p>You entered an incorrect username or password. Please try again! And remember, passwords are case sensitive.</p> >+ </div> >+ [% END %] >+ >+ [% INCLUDE 'alt-auth.inc' %] >+ >+ <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post"> >+ <input type="hidden" name="koha_login_context" value="opac" /> >+ <fieldset class="brief"> >+ [% FOREACH INPUT IN INPUTS %] >+ <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" /> >+ [% END %] >+ <label for="userid">Login</label> >+ <input type="text" size="25" id="userid" name="userid" /> >+ <label for="password">Password</label><input type="password" size="25" id="password" name="password" /> >+ </fieldset> >+ >+ <input type="submit" value="Log in" class="btn" /> >+ </div> >+ </form> >+ [% END # / IF loginprompt %] >+ </div> <!-- /.sco-auth --> >+ </div> <!-- /.span12 --> >+ </div> <!-- /.row-fluid --> >+ </div> <!-- /.container-fluid --> >+</div> <!-- /.main --> >+ >+[% INCLUDE 'opac-bottom.inc' %] >+[% BLOCK jsinclude %] >+[% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %] >+</script> >+[% END %] >+ >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index eff549d..a2020a4 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -67,7 +67,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({ > authnotrequired => 0, > flagsrequired => { circulate => "self_checkout" }, > query => $query, >- type => "opac", >+ type => "sco", > debug => 1, > }); > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12663
:
46736
|
47270
|
47317
|
47318
|
47319
|
48831
|
49595
|
49602
|
49745
|
49864
|
49865
|
49879
|
49880