#!/usr/bin/perl
use CGI qw(:standard);
print header();

print start_html(-title=>'Update Password',
		-bgcolor=>'#EFFF99'),
	h1('Update Administrator User Password'),
	hr;
	
%passwordList = (abcd => zyxw,
              haha => lala,
              baba => sasa
             );
       	                   

dbmopen %passwordList, "order/password", 0666;
	     
	     foreach $type (keys %passwordList) {
	       $passwordList{$type} = $passwordList{$type};
	       print "$type $passwordList{$type}\n";
	     }
	     
dbmclose %passwordList; 

# retrieve the current password list
dbmopen %passwordList, "order/password", 0444;
print start_form(-method=>'POST', 
		-action=>'updatePassword.pl');

print p("Here is the current list of login and password\n");
print "<TABLE border=1 BGCOLOR=\"#EDDFC9\">\n";
print "<TR><TH>Login</TH><TH>Password</TH></TR>\n";
foreach $login (keys %passwordList) {
  $password = $passwordList{$login};
  print "<TR><TD>$login</TD><TD>$password</TD></TR>\n";
}
dbmclose %passwordList;
print "</TABLE>\n";
print p("Enter your administrator login and password for updating the password.\n");
print "<TABLE border=1 BGCOLOR='#93DDDB'>\n";
print "<TR><TD>Login:</TD><TD><INPUT type=text name=\"adminLogin\"></TD></TR>\n";
print "<TR><TD>Password:</TD><TD><INPUT type=password name=\"adminPassword\"></TD></TR>\n";
print "</TABLE>\n";
print p("Enter the new user login and password.\n");
print "<TABLE border=1 BGCOLOR='#ff99DB'>\n";
print "<TR><TD>Login:</TD><TD><INPUT type=text name=\"login\"></TD></TR>\n";
print "<TR><TD>Password:</TD><TD><INPUT type=password name=\"password\"></TD></TR>\n";
print "</TABLE>\n";
print submit(-value=>"Update"), reset, end_form;
print end_html;



              
dbmopen %cookieJugOne, "cookieData", 0666;

foreach $type (keys %cookieJugInitOne) {
  $cookieJugOne{$type} = $cookieJugInitOne{$type};
  print "$type $cookieJugOne{$type}\n";
}

dbmclose %cookieJugOne;    
