From cf65981dbe648a876c033baa19832422867f37f6 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 1 Aug 2012 11:12:36 -0400 Subject: [PATCH] TPAC: Add config options to hide phone / user prefs Libraries using centralized authentication (such as LDAP via open-ils.auth_proxy) will not want to allow users to change their passwords or email addresses. In addition, many libraries do not want to deal with phone notifications. This commit adds preferences to config.tt2 that hide these options from the user. Signed-off-by: Dan Scott --- Open-ILS/src/templates/opac/myopac/prefs.tt2 | 14 +++++++++++--- Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 | 2 ++ Open-ILS/src/templates/opac/parts/config.tt2 | 16 ++++++++++++++++ Open-ILS/src/templates/opac/parts/place_hold.tt2 | 2 ++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/opac/myopac/prefs.tt2 b/Open-ILS/src/templates/opac/myopac/prefs.tt2 index 418c7ac467..4b5c476c0d 100644 --- a/Open-ILS/src/templates/opac/myopac/prefs.tt2 +++ b/Open-ILS/src/templates/opac/myopac/prefs.tt2 @@ -84,21 +84,29 @@ [% l("Username") %] [% ctx.user.usrname | html %] - [% IF ctx.username_change_disallowed %] + [%- IF ctx.username_change_disallowed %] - [% ELSE %] + [%- ELSE %] [% l("Change") %] - [% END %] + [%- END %] [% l("Password") %] [% l("(not shown)") %] + [%- IF disable_password_change %] + + [%- ELSE %] [% l("Change") %] + [%- END %] [% l("Email Address") %] [% ctx.user.email | html %] + [%- IF disable_email_change %] + + [%- ELSE %] [% l('Change') %] + [%- END %] [% IF ctx.user.ident_value %] diff --git a/Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 b/Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 index fcd9f47823..22d9affc3b 100644 --- a/Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 +++ b/Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 @@ -27,6 +27,7 @@ [% IF (matches = ctx.user_setting_map.$setting.match('email')); %] checked='checked' [% END %]/> + [%- IF allow_phone_notifications %] [% l('Notify by Phone by default when a hold is ready for pickup?') %] @@ -43,6 +44,7 @@ [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/> + [%- END %] [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %] [% l('Notify by Text by default when a hold is ready for pickup?') %] diff --git a/Open-ILS/src/templates/opac/parts/config.tt2 b/Open-ILS/src/templates/opac/parts/config.tt2 index f23ef4d492..35db60926e 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -56,6 +56,22 @@ google_analytics.code = 'UA-9999999-99'; reset_password = 'true'; ############################################################################## +# Hide various options from user preferences that you might not want to expose +# if you rely on centralized authentication via open-ils.auth_proxy, like LDAP +# +# Username changes can be disabled by the opac.lock_usernames OU setting. +############################################################################## +disable_password_change = 'false'; +disable_email_change = 'false'; + +############################################################################## +# Some libraries do not do notifications by phone; if not true, then this +# hides the user preference for phone notifications as well as the phone +# notification portion of the hold dialogue +############################################################################## +allow_phone_notifications = 'true'; + +############################################################################## # Misc. UI Settings ############################################################################## diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2 index ec979e311b..eefeda12a9 100644 --- a/Open-ILS/src/templates/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2 @@ -77,6 +77,7 @@ [% l('Yes, by Email') %]
+ [%- IF allow_phone_notifications %] [% l('Yes, by Phone') %]
@@ -85,6 +86,7 @@ IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [% END %]/> + [%- END -%] [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %] -- 2.11.0