From: Dan Scott Date: Wed, 1 Aug 2012 15:12:36 +0000 (-0400) Subject: TPAC: Add config options to hide phone / user prefs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fdbs%2Ftpac_prevent_user_edits;p=working%2FEvergreen.git 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 --- diff --git a/Open-ILS/src/templates/opac/myopac/prefs.tt2 b/Open-ILS/src/templates/opac/myopac/prefs.tt2 index 418c7ac467..85572f4fe7 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 813280aeff..2c99853f26 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -47,6 +47,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..16a18c1d40 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 == 'true' %] [% 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 %]