"Edit password" ACL, #21178, part 1
[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 <A ID="<%$pre%>link" HREF="#" onclick="<%$pre%>toggle(true)">(<% mt('change') %>)</A>
12 <DIV ID="<%$pre%>form" CLASS="passwordbox">
13   <FORM METHOD="POST" ACTION="<%$fsurl%>misc/process/change-password.html">
14     <INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svc_acct->svcnum |h%>">
15     <INPUT TYPE="text" ID="<%$pre%>password" NAME="password" VALUE="<% $curr_value |h%>">
16     <& /elements/random_pass.html, $pre.'password', 'randomize' &>
17     <INPUT TYPE="submit" VALUE="change">
18     <INPUT TYPE="button" VALUE="cancel" onclick="<%$pre%>toggle(false)">
19 % if ( $error ) {
20     <BR><SPAN STYLE="color: #ff0000"><% $error |h %></SPAN>
21 % }
22   </FORM>
23 </DIV>
24 <SCRIPT TYPE="text/javascript">
25 function <%$pre%>toggle(val) {
26   document.getElementById('<%$pre%>form').style.display =
27     val ? 'inline-block' : 'none';
28   document.getElementById('<%$pre%>link').style.display =
29     val ? 'none' : 'inline';
30 }
31 % if ( $error ) {
32 <%$pre%>toggle(true);
33 % }
34 </SCRIPT>
35 <%init>
36 my %opt = @_;
37 my $svc_acct = $opt{'svc_acct'};
38 my $curr_value = $opt{'curr_value'} || '';
39 my $pre = 'changepw'.$svc_acct->svcnum.'_';
40 my $error = $cgi->param($pre.'error');
41 </%init>