Add support for CAS intro in tpac for rel_2_4_mergery
authorArt Rhyno <art632000@yahoo.ca>
Fri, 24 May 2013 15:24:53 +0000 (11:24 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 4 Jun 2013 17:48:22 +0000 (13:48 -0400)
These changes allow a CAS intro to be put in place before
a patron is sent off to the CAS service from the tpac. CAS
logins can be a jarring experience since the interface is
controlled by the validating organization.

Signed-off-by: Art Rhyno <art632000@yahoo.ca>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Container.pm
Open-ILS/src/templates/opac/cas_intro.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/config.tt2

index 74c0700..992852b 100644 (file)
@@ -133,6 +133,9 @@ sub load {
     return $self->load_cache_clear if $path =~ m|opac/cache/clear|;
     return $self->load_temp_warn_post if $path =~ m|opac/temp_warn/post|;
     return $self->load_temp_warn if $path =~ m|opac/temp_warn|;
+    # added for CAS support - we probably want a place to explain why someone is being
+    # redirected to a third party site
+    return $self->load_cas_intro if $path =~ m|opac/cas_intro|;
 
     # ----------------------------------------------------------------
     #  Everything below here requires SSL
index b61ac06..376a0b2 100644 (file)
@@ -245,4 +245,10 @@ sub load_temp_warn {
     return Apache2::Const::OK;
 }
 
+sub load_cas_intro {
+    my $self = shift;
+    $self->ctx->{'redirect_to'} = $self->cgi->param('redirect_to');
+    return Apache2::Const::OK;
+}
+
 1;
diff --git a/Open-ILS/src/templates/opac/cas_intro.tt2 b/Open-ILS/src/templates/opac/cas_intro.tt2
new file mode 100644 (file)
index 0000000..dd921ad
--- /dev/null
@@ -0,0 +1,38 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+
+    cas_alert = l('You have selected CAS Authentication. This will use your campus userid (also known as login or user name).');
+    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>[% cas_alert %]</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 CAS ID') %]
+            </a>
+                                <br /><br />
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+        <div style="height:20px;"></div>
+        </div>
+    </div>
+[% END %]
index 718083e..3f28cca 100644 (file)
@@ -28,6 +28,14 @@ ctx.refworks.url = 'http://www.refworks.com';
 # ctx.refworks.url = 'http://librweb.laurentian.ca/login?url=http://refworks.scholarsportal.info';
 
 ##############################################################################
+# CAS support
+##############################################################################
+# Specify CAS URL for Login
+# ctx.cas.url = 'https://myorg.org/cas/login?service=https://mylibrary.org/eg/opac/login';
+# Specify CAS URL for Logout
+# ctx.cas.logout = 'https://myorg.org/cas/logout';
+
+##############################################################################
 # OpenURL resolution
 ##############################################################################
 # Evergreen provides the ability to point at an OpenURL resolver to find