id, $currentpassword))
{
if ($_POST['npassword'] == $_POST['cnpassword'])
{
$newpassword = cleanInput($_POST['npassword']);
if(strlen($newpassword) < 8)
{
$alert = "
Passwords must be atleast 8 characters long
";
}
else
{
if (changePassword($newpassword))
{
$alert = "Password updated
";
}
else
{
$alert = "An error occurred, contact an admin
";
}
}
}
else
{
$alert = "The passwords you entered do not match
";
}
}
else
{
$alert = "Incorrect current password
";
}
}
$body = <<
{$alert}
EOT;
pageHandler();
$ph->pageTitle("Change Password");
$ph->body = $body;
$ph->output();