Viewing File: /usr/local/cpanel/base/frontend/jupiter/contact/indexincludeform.html.tt
[%
USE Email;
Api2.pre_exec("CustInfo", "contactemails");
SET contactemails=Api2.exec("CustInfo" , "contactemails" , {});
Api2.post_exec("CustInfo", "contactemails");
Api2.pre_exec("CustInfo", "contactprefs");
SET contactprefs=Api2.exec("CustInfo" , "contactprefs" , {});
Api2.post_exec("CustInfo", "contactprefs");
SET default_address=Email.get_default_address();
SET autossl_notification_preset = 'disable';
SET cert_failures = [ "notify_autossl_expiry", "notify_autossl_expiry_coverage", "notify_autossl_renewal_coverage", "notify_autossl_renewal_coverage_reduced" ];
# If we notify on regular renewals, then we notify on all events.
# Otherwise, if we notify when a renewal lacks domains, then we renew
# on warnings. Otherwise, if we notify on anything, we notify on failures.
# Otherwise, no notifications.
#
# ^^ The above logic replaces the “sea of checkboxes” that we presented
# prior to v74. It allowed for generally-undesirable configurations like
# notifications on successes but not on failures. To simplify the UI,
# then, we now allow only four levels: disabled, failures only, failures
# plus warnings, and notify-on-all.
#
# The simplification means that users who did have the “undesirable”
# configurations will lose them.
#
# Note that the backend still stores these settings the same way as before.
#
FOREACH pref IN contactprefs;
IF pref.name == 'notify_autossl_renewal';
SET can_set_all_autossl_notification = 1;
IF pref.enabled == 1;
SET autossl_notification_preset = 'all';
END;
ELSIF pref.name == 'notify_autossl_renewal_uncovered_domains';
SET can_set_fail_warn_defer_autossl_notification = 1;
IF pref.enabled == 1 && autossl_notification_preset != 'all';
SET autossl_notification_preset = 'failWarnDefer';
END;
ELSIF cert_failures.grep('^' _ pref.name _ '$').size;
SET can_set_cert_failures_autossl_notification = 1;
IF pref.enabled == 1 && autossl_notification_preset != 'all' && autossl_notification_preset != 'failWarnDefer';
SET autossl_notification_preset = 'certFailures';
END;
END;
END;
SET can_set_any_autossl_notification = can_set_all_autossl_notification || can_set_fail_warn_defer_autossl_notification || can_set_cert_failures_autossl_notification;
%]
[% MACRO textfield(descp_html, name_html, type, value_html, info_text) BLOCK -%]
<div class="form-group">
<label for="[% name_html %]">[% descp_html %]</label>
[% IF info_text -%]
<span class="info-block">[% info_text %]</span>
[% END -%]
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<input
id="[% name_html %]"
name="[% name_html %]"
type="[% type %]"
value="[% value_html %]"
size="40"
class="form-control"
/>
</div>
<div id="[% name_html %]_error" class="col-xs-12 col-sm-6 col-md-6 col-lg-6" ></div>
</div>
</div>
[% END -%]
<div class="section" id="contactprefs">
[% IF contactemails.size() %]
<div class="callout callout-warning">
[% locale.maketext("You may use an email address on a domain that this server hosts. However, we do not recommend this, because you may fail to receive messages when the server encounters problems. For example, if your mailbox exceeds its quota, you will not receive any new email, including notices.") %]
</div>
<h2>[% locale.maketext('Email') %]</h2>
[% FOREACH contactemail IN contactemails %]
[% IF contactemail.name == "pushbullet_access_token" %]
<h2>[% locale.maketext('Push Notifications') %]</h2>
[% END %]
[% IF contactemail.name == "email" and default_address != '' and default_address != contactemail.value %]
[% textfield(
contactemail.descp,
contactemail.name,
'text',
contactemail.value,
'<a href="#" id="autofill-btn" data-email="' _ default_address _ '">'
_ locale.maketext('Use the email address set in the Default Address interface ([_1])[comment,label text of a link]', default_address) _
'</a>'
) -%]
[% ELSE %]
[% textfield(
contactemail.descp,
contactemail.name,
'text',
contactemail.value
) -%]
[% END %]
[% IF ( !CPANEL.authuser.match('@') || CPANEL.is_team_user ) && contactemail.name == "second_email" %]
[% textfield(
locale.maketext('Your account’s password:'),
'password',
'password',
'',
locale.maketext('This is only required if you change your contact email addresses.'),
) -%]
[% END %]
[% END %]
[% END %]
[% IF CPANEL.feature("updatenotificationprefs") && contactprefs.size() %]
<div class="form-group contact-prefs" ng-app>
<h2 id="contact_prefs_header">[% locale.maketext("Contact Preferences") %]</h2>
<div class="contact-prefs-subtitle">[% locale.maketext("Notify me when:") %]</div>
[% FOREACH pref IN contactprefs %]
[% IF pref.onchangeparent == '' %]
<div class="checkbox contact-pref">
<label>
<input id="[% pref.name %]"
name="[% pref.name %]"
type="[% "boolean" == pref.type ? "checkbox" : "text" %]"
[% (pref.enabled && ("boolean" == pref.type)) ? 'checked="checked"' : '' %]
value="[% pref.value %]"
size="40"
ng-model="[% pref.name %]"
ng-init="[% pref.name %] = [% pref.enabled %] ? true : false"/>
[% pref.descp %]
</label>
[% IF pref.infotext %]
<span class="info-block">
[% pref.infotext %]
</span>
[% END %]
<div class="contact-pref-children">
[% FOREACH child_pref IN contactprefs %]
[% IF child_pref.onchangeparent == pref.name %]
<div class="checkbox contact-pref-child">
<label>
<input id="[% child_pref.name %]"
name="[% child_pref.name %]"
type="[% "boolean" == child_pref.type ? "checkbox" : "text" %]"
[% (child_pref.enabled && ("boolean" == child_pref.type)) ? 'checked="checked"' : '' %]
value="[% child_pref.value %]"
size="40"
ng-disabled="![% pref.name %]"/>
[% child_pref.is_disabler ? locale.maketext("If the above option is disabled, notify me.") : child_pref.descp %]
</label>
</div>
[% END %]
[% END %]
</div>
</div>
[% END %]
[% END %]
[% IF can_set_any_autossl_notification %]
<div class="form-group" ng-init="autosslNotifications = '[% autossl_notification_preset %]'">
<h2 id="autossl_prefs_header">[% locale.maketext('[asis,AutoSSL] Notifications') %]</h2>
<div class="contact-prefs-subtitle">[% locale.maketext("Notify me for:") %]</div>
<div>
[% IF can_set_all_autossl_notification %]
<div class="radio">
<label>
<input type="radio" name="autosslNotifications" id="autosslNotificationsAll" ng-model="autosslNotifications" value="all"
[% IF autossl_notification_preset == 'all' %]checked[% END %]>
[% locale.maketext('All [asis,AutoSSL] events: failures, deferrals, and successful installations.') %]
</label>
</div>
[% END %]
[% IF can_set_fail_warn_defer_autossl_notification %]
<div class="radio">
<label>
<input type="radio" name="autosslNotifications" id="autosslNotificationsFailsAndDeferrals" ng-model="autosslNotifications" value="failWarnDefer"
[% IF autossl_notification_preset == 'failWarnDefer' %]checked[% END %]>
[% locale.maketext('[asis,AutoSSL] failures and deferrals only. (default)') %]
</label>
</div>
[% END %]
[% IF can_set_cert_failures_autossl_notification %]
<div class="radio">
<label>
<input type="radio" name="autosslNotifications" id="autosslNotificationsFailsOnly" ng-model="autosslNotifications" value="certFailures"
[% IF autossl_notification_preset == 'certFailures' %]checked[% END %]>
[% locale.maketext('[asis,AutoSSL] failures only.') %]
</label>
</div>
[% END %]
<div class="radio">
<label>
<input type="radio" name="autosslNotifications" id="autosslNotificationsDisabled" ng-model="autosslNotifications" value="disable"
[% IF autossl_notification_preset == 'disable' %]checked[% END %]>
[% locale.maketext('Disable [asis,AutoSSL] event notifications.') %]
</label>
</div>
</div>
</div>
[% ELSE %]
<input type="hidden" name="autosslNotifications" id="autosslNotificationsHidden" ng-model="autosslNotifications" value="disable">
[% END %]
</div>
[% END %]
<div class="form-group">
<input type="submit" id="submit-button" class="btn btn-primary" value="[% locale.maketext("Save") %]">
</div>
</div>
Back to Directory
File Manager