[imp] change password

Joseph Kacmarcik joe@chubbo.net
Tue, 20 Nov 2001 16:33:28 -0800


---------------------- multipart/mixed attachment

hmmmmm, index.php didn't wanna go...

attached and follows:

index.php:

<html><head>
<title>Change your Password</title>
 
<body bgcolor=#cc9966>
<table bgcolor=#cc9966><TR><TD bgcolor=#cc9966>
<p><font face=verdana size=4>Change your password</font></p>
 
<?
print "<form method=post action=''>";
print "<table width=100% border=0>";
print "<tr>";
print "<td width=150>Your Userid:</td>";
print "<td colspan=2>";
print "<input type=text name=userid>";
print "</td>";
print "</tr>";
print "<tr>";
print "<td width=150>Old password:</td>";
print "<td colspan=2>";
print "<input type=password name=oldpassword>";
print "</td>";
print "</tr>";
print "<tr>";
print "<td width=150>New password:</td>";
print "<td colspan=2><input type=password name=newpassword[]></td>";
print "</tr>";
print "<tr>";
print "<td width=150>Confirm:</td>";
print "<td colspan=2><input type=password name=newpassword[]></td> ";
print "</td>";
print "</tr>";
print "</table><br><br>";
print "<p align=right><input type=submit name=submit value=Submit>";
 
  if ($submit) {
    print '<p><font size="+3" color="#CC0000">';
    $error = false;
    if ($userid == "") {
      print "You must give your userid<br>";
      $error = true;
    }
    if ($oldpassword == "") {
      print "You must give your old password<br>";
      $error = true;
    }
    if ($newpassword[0] == "") {
      print "You must give your new password<br>";
      $error = true;
    }
    if ($newpassword[1] == "") {
      print "You must verify your new password<br>";
      $error = true;
    }
    if (!($newpassword[0] == $newpassword[1])) {
      print "Your new passwords didn't match<br>";
      $error = true;
    }
    if ($error == false) {
      require("poppassd.php");
      $daemon = new poppassd;
      if ($daemon->change_password($userid, $oldpassword, $newpassword[0])) {
        echo "Success!";
      } else {
        echo "Failure!<br>$daemon->err_str";
      }
    }
    print "</font></p>";
  }
?>
</form>
</tr></td></table>
</body>
</html>

---------------------- multipart/mixed attachment--