<?php
  require ("vote.php");
?>
<html>
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
  <title>New password setting</title>
  <body bgcolor=#000000>
    <font color=#ffffff size=2 face=verdana>
    <?php
      if (!legal($oldpwd))
        {
          echo("Error! Old password incorrect.");
          die();
        }
      if ($admpwd1!=$admpwd2)
        {
          echo("Error! Both new passwords are not equal.");
          die();
        }
      if ($admpwd1=="")
        {
          echo("Error! Empty password is not allowed.");
          die();
        }
      myflock();
      $f=fopen("votepwd.dat","w");
      fputs($f,md5($admpwd1));
      fclose($f);
      myfunlock();
      echo("Password has been changed. Don't forget!");
    ?>
    </font>
  </body>
</html>
