From 04941cd299d16ef19a247c6531fc99b861a6dbaf 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 Conflicts: Open-ILS/src/templates/opac/parts/place_hold.tt2 --- 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 d3178a7660..08aa0438b4 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 == 'true' %] + + [%- ELSE %] [% l("Change") %] + [%- END %] [% l("Email Address") %] [% ctx.user.email | html %] + [%- IF disable_email_change == 'true' %] + + [%- 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..d5bc545805 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 == 'true' %] [% 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 b0fee8f9a3..c97b61d5f0 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 2066616506..17bac7e14d 100644 --- a/Open-ILS/src/templates/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2 @@ -80,6 +80,7 @@
[% l('Email Address:') %] [% ctx.user.email %]
+ [%- IF allow_phone_notifications == 'true' %] [% l('Yes, by Phone') %]
@@ -88,6 +89,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