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)
committerDan Scott <dscott@laurentian.ca>
Wed, 1 Aug 2012 16:14:21 +0000 (12:14 -0400)
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>
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 418c7ac..4b5c476 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 %]
+                <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 %]
+                <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..22d9aff 100644 (file)
@@ -27,6 +27,7 @@
                         [% IF (matches = ctx.user_setting_map.$setting.match('email')); %] checked='checked' [% END %]/>
                 </td>
             </tr>
+            [%- IF allow_phone_notifications %]
             <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 f23ef4d..35db609 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 ec979e3..eefeda1 100644 (file)
@@ -77,6 +77,7 @@
                 <input type="checkbox" name="email_notify" value="t"
                     [% IF ctx.default_email_notify %]checked="checked"[% END %]/>
                     [% l('Yes, by Email') %]<br/>
+                [%- IF allow_phone_notifications %]
                 <input type="checkbox" name="phone_notify_checkbox"
                     [% IF ctx.default_phone_notify %]checked="checked"[% END %]/>
                     [% l('Yes, by Phone') %]<br/>
@@ -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 %]/>
                 </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 %]/>