summaryrefslogtreecommitdiff
path: root/httemplate/elements/change_password.html
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-07-06 11:52:22 -0400
committerChristopher Burger <burgerc@freeside.biz>2017-07-06 11:52:22 -0400
commit59776b97e0d82e30e9a50c76d16f302309fff76d (patch)
tree40312c609a9e1ff36d759d503ef0948c7e7a3d31 /httemplate/elements/change_password.html
parent53427a0d7b74c16d646196e70c95971471e1fae8 (diff)
RT# 75817 - fixed contact password page to be more consistant with svc password page, updated javascript to check password as you type rather than when you leave the field.
Diffstat (limited to 'httemplate/elements/change_password.html')
-rw-r--r--httemplate/elements/change_password.html60
1 files changed, 36 insertions, 24 deletions
diff --git a/httemplate/elements/change_password.html b/httemplate/elements/change_password.html
index a8cc883b9..463384f2f 100644
--- a/httemplate/elements/change_password.html
+++ b/httemplate/elements/change_password.html
@@ -8,69 +8,81 @@
display: none;
}
</STYLE>
+% if (!$opt{'no_label_display'}) {
<A ID="<%$pre%>link" HREF="javascript:void(0)" onclick="<%$pre%>toggle(true)">(<% emt( $change_title ) %>)</A>
+% }
<DIV ID="<%$pre%>form" CLASS="passwordbox">
+% if (!$opt{'noformtag'}) {
<FORM METHOD="POST" ACTION="<%$fsurl%>misc/process/change-password.html">
- <% $change_id_input %>
- <INPUT TYPE="text" ID="<%$pre%>password" NAME="password" VALUE="<% $curr_value |h%>">
- <& /elements/random_pass.html, $pre.'password', 'randomize' &>
- <INPUT TYPE="submit" VALUE="change">
-% if ($opt{'popup'}) {
- <INPUT TYPE="button" VALUE="cancel" onclick="parent.cClick();">
% }
-% else {
- <INPUT TYPE="button" VALUE="cancel" onclick="<%$pre%>toggle(false)">
+
+ <% $change_id_input %>
+ <INPUT TYPE="text" ID="<%$pre%>password" NAME="<% $opt{'pre_pwd_field_label'} %>password" VALUE="<% $curr_value |h%>">
+ <& /elements/random_pass.html, $pre.'password', 'randomize', $change_button_id &>
+% if (!$opt{'noformtag'}) {
+ <INPUT TYPE="submit" ID="<%$change_button_id%>" VALUE="change" disabled="disabled">
+% } else {
+ <INPUT TYPE="button" ID="<%$change_button_id%>" VALUE="change" onclick="<%$pre%>toggle(false)" disabled="disabled">
%}
+ <INPUT TYPE="button" ID="<%$pre%>cancel_button" VALUE="cancel" onclick="<%$pre%>toggle(false, true)">
+
<DIV ID="<%$pre%>password_result" STYLE="font-size: smaller"></DIV>
<& '/elements/validate_password.html',
'fieldid' => $pre.'password',
'svcnum' => $svcnum,
- 'contactnum' => $contactnum,
+ 'contactnum' => $opt{'contact_num'},
+ 'submitid' => $change_button_id,
&>
% if ( $error ) {
<BR><SPAN STYLE="color: #ff0000"><% $error |h %></SPAN>
% }
+
+% if (!$opt{'noformtag'}) {
</FORM>
+% }
+
</DIV>
<SCRIPT TYPE="text/javascript">
-function <%$pre%>toggle(val) {
+function <%$pre%>toggle(toggle, clear) {
+ if (clear) {
+ document.getElementById('<%$pre%>password').value = '';
+ document.getElementById('<%$pre%>password_result').innerHTML = '';
+% if ($opt{'contact_num'}) {
+ document.getElementById('<% $opt{'pre_pwd_field_label'} %>selfservice_access').value = 'Y';
+% }
+}
document.getElementById('<%$pre%>form').style.display =
- val ? 'inline-block' : 'none';
+ toggle ? 'inline-block' : 'none';
+% if (!$opt{'no_label_display'}) {
document.getElementById('<%$pre%>link').style.display =
- val ? 'none' : 'inline';
-}
-% if ( $error || $opt{'popup'} ) {
-<%$pre%>toggle(true);
+ toggle ? 'none' : 'inline';
% }
+}
</SCRIPT>
<%init>
my %opt = @_;
-my $contactnum = $opt{'contact_num'};
my $curr_value = $opt{'curr_value'} || '';
my $change_title = $opt{'label'} || 'change';
-
my $svcnum;
my $change_id_input = '';
my $pre = 'changepw';
if ($opt{'svc_acct'}) {
my $svc_acct = $opt{'svc_acct'};
- $change_id_input = '<INPUT TYPE="hidden" NAME="svcnum" VALUE="' . $svc_acct->svcnum . '">';
+ $change_id_input = '<INPUT TYPE="hidden" NAME="'.$opt{'pre_pwd_field_label'}.'svcnum" VALUE="' . $svc_acct->svcnum . '">';
$pre .= $svc_acct->svcnum . '_';
$svcnum = $svc_acct->svcnum;
}
elsif ($opt{'contact_num'}) {
$change_id_input = '
- <INPUT TYPE="hidden" NAME="contactnum" VALUE="' . $opt{'contact_num'} . '">
- <INPUT TYPE="hidden" NAME="custnum" VALUE="' . $opt{'custnum'} . '">
+ <INPUT TYPE="hidden" NAME="'.$opt{'pre_pwd_field_label'}.'contactnum" VALUE="' . $opt{'contact_num'} . '">
+ <INPUT TYPE="hidden" NAME="'.$opt{'pre_pwd_field_label'}.'custnum" VALUE="' . $opt{'custnum'} . '">
';
- $pre .= $opt{'contact_num'} . '_';
+ $pre .= $opt{'pre_pwd_field_label'};
}
-if ($opt{'popup'}) {
- $change_id_input .= '<INPUT TYPE="hidden" NAME="popup" VALUE="' . $opt{'popup'} . '">';
-}
+my $change_button_id = $pre.'change_button';
my $error = $cgi->param($pre.'error');
</%init>