<?php
require_once("referrals_fns.php");
session_start();
header("Cache-control: private");
do_html_header("Changing password");
check_admin_user();
if (!filled_out($HTTP_POST_VARS))
{
echo "You have not filled out the form completely.
Please try again.";
do_html_footer();
exit;
}
else
{
if ($new_passwd!=$new_passwd2)
echo "The new passwords that you entered are not the same. Please click the Back button on your browser and try again.";
else if (strlen($new_passwd)>16 || strlen($new_passwd)<6)
echo "Passwords must be between 6 and 16 characters. Please click the Back button on your browser and try again.";
else
{
// attempt update
if (change_password($admin_user, $old_passwd, $new_passwd))
{
echo "Password changed.";
}
else
{
echo "Password could not be changed.";
}
}
}
do_html_footer();
?>