Config and TT2 changes for surfacing CAS in TPAC
authorArt Rhyno <art632000@yahoo.ca>
Wed, 23 Jan 2013 16:54:26 +0000 (11:54 -0500)
committerArt Rhyno <art632000@yahoo.ca>
Wed, 23 Jan 2013 16:54:26 +0000 (11:54 -0500)
These modifications:

1) assign the login and logout URLs for CAS support
2) replace the default cas_intro.tt2 screen with one specific to Windsor
3) show CAS_specific logout link if CAS is the authentication mechanism

Note that it is extremely important to have CAS logout with the
central CAS service since another user could have access to an account
on a public station. The central CAS service invalidates the ticket and
forces a new authentication session.

Signed-off-by: Art Rhyno <art632000@yahoo.ca>
Open-ILS/src/templates_windsor/opac/cas_intro.tt2 [new file with mode: 0644]
Open-ILS/src/templates_windsor/opac/parts/config.tt2
Open-ILS/src/templates_windsor/opac/parts/topnav.tt2 [new file with mode: 0644]

diff --git a/Open-ILS/src/templates_windsor/opac/cas_intro.tt2 b/Open-ILS/src/templates_windsor/opac/cas_intro.tt2
new file mode 100644 (file)
index 0000000..8331752
--- /dev/null
@@ -0,0 +1,45 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l("CAS Information") %]
+    <div id="content-wrapper">
+        <div id="main-content">
+        <div style="height:20px;"></div>
+        <table cellpadding="0" cellspacing="0" border="0">
+            <tr>
+                <td valign="top" width="676" class="login_boxes left_brain">
+                    <table cellpadding="10" cellspacing="0" border="0"
+                        width="100%">
+                        <tr>
+                                <td colspan="2" style="padding-bottom: 10px;">
+                                <h1>
+             [%
+             l('You have selected UWin ID Authentication. This will use your ');
+             l('University of Windsor userid (also known as login or user name). ');
+             l('It appears on the front of the ');
+             %] <strong>@</strong> [%
+             l('sign in your University of Windsor e-mail address and it is being ');
+             l('used as login name for most University computer systems.'); 
+             %]
+                                </h1>
+                                <br /><br />
+                            </td>
+                        </tr>
+                        <tr>
+                                <td colspan="2" style="padding-bottom: 10px;">
+            <a href="[% ctx.cas.url %]"
+                class="opac-button opac-button-header" id="home_myopac_link">
+                [% l('Continue to Your Account with Your UWind ID') %]
+            </a>
+                                <br /><br />
+                            </td>
+                        </tr>
+                    </table> 
+                </td>
+            </tr>
+        </table>
+        <div style="height:20px;"></div>
+        </div>
+    </div>
+[% END %]
index fab6b33..6b7ae7f 100644 (file)
@@ -31,6 +31,15 @@ ctx.refworks.url = 'http://ezproxy.uwindsor.ca/login?url=http://refworks.scholar
 # ctx.refworks.url = 'http://librweb.laurentian.ca/login?url=http://refworks.scholarsportal.info';
 
 ##############################################################################
+# CAS support
+##############################################################################
+# Specify CAS URL for Login
+ctx.cas.url = 'https://uwinid.uwindsor.ca/cas/login?service=https://windsor-test.concat.ca/eg/opac/login';
+# Specify CAS URL for Logout
+ctx.cas.logout = 'https://uwinid.uwindsor.ca/cas/logout';
+
+
+##############################################################################
 # OpenURL resolution
 ##############################################################################
 # Evergreen provides the ability to point at an OpenURL resolver to find
diff --git a/Open-ILS/src/templates_windsor/opac/parts/topnav.tt2 b/Open-ILS/src/templates_windsor/opac/parts/topnav.tt2
new file mode 100644 (file)
index 0000000..c6a2274
--- /dev/null
@@ -0,0 +1,72 @@
+[% IF !ctx.is_staff %]
+<div id="header-wrap">
+<div id="header">
+    <div class="float-left">
+        [% INCLUDE "opac/parts/topnav_logo.tt2" %]
+    </div>
+    <div class="float-right">
+        [% IF !ctx.user %]
+        <div id="your-acct-login-uwin">
+            <a href="[% mkurl(ctx.opac_root _ '/cas_intro') %]"
+                class="opac-button opac-button-header" id="home_myopac_link_uwin">
+                [% l('Log in to Your Account (UWind ID)') %]
+            </a>
+        </div>
+        <br clear="left"/>
+        <div id="your-acct-login-reg">
+            <a href="[% mkurl(ctx.opac_root _ '/myopac/main') %]" 
+                class="opac-button opac-button-header" id="home_myopac_link">
+                [% l('Log in to Your Account (Barcode or Other ID)') %]
+            </a>
+        </div>
+        [% ELSE %]
+        <div id="dash_wrapper">
+            <div id="dash_identity">
+                <span id="dash_user">
+                    [%  l('[_1] [_2]', ctx.user.first_given_name, ctx.user.family_name) | html %]
+                </span>
+                <span class="dash_divider">|</span>
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/main') %]" 
+                    class="opac-button">[% l('My Account') %]</a>
+                [% IF CGI.cookie('eg_CAS') %]
+                <a href="[% mkurl(ctx.opac_root _ '/logout?redirect_to=' _ ctx.cas.logout, {}, 1) %]"
+                    class="opac-button" id="logout_link">[% l('Logout') %]</a>
+                [% ELSE %]
+                <a href="[% mkurl(ctx.opac_root _ '/logout', {}, 1) %]"
+                    class="opac-button" id="logout_link">[% l('Logout') %]</a>
+                [% END %]
+            </div>
+            <div id="dashboard">
+                <span class="dash-align">
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/circs')
+                        %]"><span id="dash_checked">[% ctx.user_stats.checkouts.total_out
+                        %]</span> [% l("Checked Out") %]</a>
+                </span>
+                <span class="dash_divider">|</span>
+                <span class="dash-align">
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/holds', {}, ['available'])
+                        %]"><span id="dash_holds">[% ctx.user_stats.holds.total
+                        %]</span> [% l("On Hold") %]</a>
+                </span>
+                <span class="dash_divider">|</span>
+                <span class="dash-align">
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/holds',
+                        {available => 1}) %]"><span id="dash_pickup">[%
+                        ctx.user_stats.holds.ready %]</span> [% l("Ready for Pickup") %]</a>
+                </span>
+                <span class="dash_divider">|</span>
+                <span class="dash-align">
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/main')
+                        %]"><span id="dash_fines">[% money(ctx.user_stats.fines.balance_owed)
+                        %]</span> [% l("Fines") %]</a>
+                </span>
+            </div>
+        </div>
+        [% END %]
+    </div>
+    [%- INCLUDE "opac/parts/locale_picker.tt2" %]
+    <div class="common-no-pad"></div>
+</div>
+</div>
+[% END %]
+[% INCLUDE "opac/parts/topnav_links.tt2" %]