TPAC: Add config options to hide phone / user prefs
authorDan Scott <dscott@laurentian.ca>
Wed, 1 Aug 2012 15:12:36 +0000 (11:12 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Fri, 1 Feb 2013 15:07:36 +0000 (10:07 -0500)
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 <dscott@laurentian.ca>
Conflicts:

Open-ILS/src/templates/opac/parts/place_hold.tt2

Open-ILS/src/templates/opac/myopac/prefs.tt2
Open-ILS/src/templates/opac/myopac/prefs_notify.tt2
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/parts/place_hold.tt2

index d3178a7..08aa043 100644 (file)
                     </div>[% l("Username") %]
                 </td>
                 <td class='light_border'>[% ctx.user.usrname | html %]</td>
-                [% IF ctx.username_change_disallowed %]
+                [%- IF ctx.username_change_disallowed %]
                 <td></td>
-                [% ELSE %]
+                [%- ELSE %]
                 <td class='light_border'><a href='update_username'>[% l("Change") %]</a></td>
-                [% END %]
+                [%- END %]
             </tr>
             <tr>
                 <td class='color_4 light_border'>[% l("Password") %]</td>
                 <td class='light_border'>[% l("(not shown)") %]</td>
+                [%- IF disable_password_change == 'true' %]
+                <td></td>
+                [%- ELSE %]
                 <td class='light_border'><a href='update_password'>[% l("Change") %]</a></td>
+                [%- END %]
             </tr>
             <tr>
                 <td class='color_4 light_border'>[% l("Email Address") %]</td>
                 <td class='light_border'>[% ctx.user.email | html %]</td>
+                [%- IF disable_email_change == 'true' %]
+                <td></td>
+                [%- ELSE %]
                 <td class='light_border'><a href='update_email'>[% l('Change') %]</a></td>
+                [%- END %]
             </tr>
 
             [% IF ctx.user.ident_value %]<tr class="hide_me">
index fcd9f47..d5bc545 100644 (file)
@@ -27,6 +27,7 @@
                         [% IF (matches = ctx.user_setting_map.$setting.match('email')); %] checked='checked' [% END %]/>
                 </td>
             </tr>
+            [%- IF allow_phone_notifications == 'true' %]
             <tr>
                 <td>[% l('Notify by Phone by default when a hold is ready for pickup?') %]</td>
                 <td>
@@ -43,6 +44,7 @@
                         [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
                 </td>
             </tr>
+            [%- END %]
             [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
             <tr>
                 <td>[% l('Notify by Text by default when a hold is ready for pickup?') %]</td>
index b0fee8f..c97b61d 100644 (file)
@@ -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
 ##############################################################################
 
index 2066616..17bac7e 100644 (file)
@@ -80,6 +80,7 @@
                 <blockquote>
                     [% l('Email Address:') %] <span name="email_address">[% ctx.user.email %]</span>
                 </blockquote>
+                [%- IF allow_phone_notifications == 'true' %]
                 <input type="checkbox" name="phone_notify_checkbox"
                     [% IF ctx.default_phone_notify %]checked="checked"[% END %]/>
                     [% l('Yes, by Phone') %]<br/>
@@ -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 %]/>
                 </blockquote>
+                [%- END -%]
                 [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
                 <input type="checkbox" name="sms_notify_checkbox"
                     [% IF ctx.default_sms_notify %]checked="checked"[% END %]/>