summaryrefslogtreecommitdiff
path: root/httemplate/elements/change_password.html
blob: 625ba1fb5d8e1b4faac33993feebf2d2349cfff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<STYLE>
.passwordbox {
  border: 1px solid #7e0079;
  padding: 2px;
  position: absolute;
  font-size: 80%;
  background-color: #ffffff;
  display: none;
}
</STYLE>
<A ID="<%$pre%>link" HREF="#" onclick="<%$pre%>toggle(true)">(<% mt('change') %>)</A>
<DIV ID="<%$pre%>form" CLASS="passwordbox">
  <FORM METHOD="POST" ACTION="<%$fsurl%>misc/process/change-password.html">
    <INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svc_acct->svcnum |h%>">
    <INPUT TYPE="text" ID="<%$pre%>password" NAME="password" VALUE="<% $curr_value |h%>">
    <& /elements/random_pass.html, $pre.'password', 'randomize' &>
    <INPUT TYPE="submit" VALUE="change">
    <INPUT TYPE="button" VALUE="cancel" onclick="<%$pre%>toggle(false)">
% if ( $error ) {
    <BR><SPAN STYLE="color: #ff0000"><% $error |h %></SPAN>
% }
  </FORM>
</DIV>
<SCRIPT TYPE="text/javascript">
function <%$pre%>toggle(val) {
  document.getElementById('<%$pre%>form').style.display =
    val ? 'inline-block' : 'none';
  document.getElementById('<%$pre%>link').style.display =
    val ? 'none' : 'inline';
}
% if ( $error ) {
<%$pre%>toggle(true);
% }
</SCRIPT>
<%init>
my %opt = @_;
my $svc_acct = $opt{'svc_acct'};
my $curr_value = $opt{'curr_value'} || '';
my $pre = 'changepw'.$svc_acct->svcnum.'_';
my $error = $cgi->param($pre.'error');
</%init>