temporarily disabling torrus source build
[freeside.git] / httemplate / elements / change_password.html
1 <STYLE>
2 .passwordbox {
3   border: 1px solid #7e0079;
4   padding: 2px;
5   position: absolute;
6   font-size: 80%;
7   background-color: #ffffff;
8   display: none;
9 }
10 </STYLE>
11 % if (!$opt{'no_label_display'}) {
12 <A ID="<%$pre%>link" HREF="javascript:void(0)" onclick="<%$pre%>toggle(true)">(<% emt( $change_title ) %>)</A>
13 % }
14 <DIV ID="<%$pre%>form" CLASS="passwordbox">
15 % if (!$opt{'noformtag'}) {
16   <FORM METHOD="POST" ACTION="<%$fsurl%>misc/process/change-password.html">
17 % }
18
19     <% $change_id_input %>
20     <INPUT TYPE="text" ID="<%$pre%>password" NAME="<% $opt{'pre_pwd_field_label'} %>password" VALUE="<% $curr_value |h%>">
21     <& /elements/random_pass.html, $pre.'password', 'randomize', $change_button_id &>
22 % if (!$opt{'noformtag'}) {
23     <INPUT TYPE="submit" ID="<%$change_button_id%>" VALUE="change" disabled="disabled">
24 % } else {
25     <INPUT TYPE="button" ID="<%$change_button_id%>" VALUE="change" onclick="<%$pre%>toggle(false)" disabled="disabled">
26 %}
27     <INPUT TYPE="button" ID="<%$pre%>cancel_button" VALUE="cancel" onclick="<%$pre%>toggle(false, true)">
28
29     <DIV ID="<%$pre%>password_result" STYLE="font-size: smaller"></DIV>
30     <& '/elements/validate_password.html', 
31          'fieldid'    => $pre.'password',
32          'svcnum'     => $svcnum,
33          'contactnum' => $opt{'contact_num'},
34          'submitid'   => $change_button_id,
35     &>
36 % if ( $error ) {
37     <BR><SPAN STYLE="color: #ff0000"><% $error |h %></SPAN>
38 % }
39
40 % if (!$opt{'noformtag'}) {
41   </FORM>
42 % }
43
44 </DIV>
45 <SCRIPT TYPE="text/javascript">
46 function <%$pre%>toggle(toggle, clear) {
47   if (clear) {
48     document.getElementById('<%$pre%>password').value = '';
49     document.getElementById('<%$pre%>password_result').innerHTML = '';
50 % if ($opt{'contact_num'}) {
51     document.getElementById('<% $opt{'pre_pwd_field_label'} %>selfservice_access').value = 'Y';
52 % }
53 }
54   document.getElementById('<%$pre%>form').style.display =
55     toggle ? 'inline-block' : 'none';
56 % if (!$opt{'no_label_display'}) {
57   document.getElementById('<%$pre%>link').style.display =
58     toggle ? 'none' : 'inline';
59 % }
60 }
61 </SCRIPT>
62 <%init>
63 my %opt = @_;
64
65 my $curr_value = $opt{'curr_value'} || '';
66 my $change_title = $opt{'label'} || 'change';
67 my $svcnum;
68 my $change_id_input = '';
69 my $pre = 'changepw';
70
71 if ($opt{'svc_acct'}) {
72   my $svc_acct = $opt{'svc_acct'};
73   $change_id_input = '<INPUT TYPE="hidden" NAME="'.$opt{'pre_pwd_field_label'}.'svcnum" VALUE="' . $svc_acct->svcnum . '">';
74   $pre .= $svc_acct->svcnum . '_';
75   $svcnum = $svc_acct->svcnum;
76 }
77 elsif ($opt{'contact_num'}) {
78   $change_id_input = '
79     <INPUT TYPE="hidden" NAME="'.$opt{'pre_pwd_field_label'}.'contactnum" VALUE="' . $opt{'contact_num'} . '">
80     <INPUT TYPE="hidden" NAME="'.$opt{'pre_pwd_field_label'}.'custnum" VALUE="' . $opt{'custnum'} . '">
81   ';
82   $pre .= $opt{'pre_pwd_field_label'};
83 }
84
85 my $change_button_id = $pre.'change_button';
86
87  my $error = $cgi->param($pre.'error');
88 </%init>