";
echo "Change password";
echo"";
?>
here.";*/
////////////////////////////////////////////////FUNCTIONS
function change_CL_password_form() {
global $PHP_SELF;
?>
Change your password!
";
//echo "userCLpassword2A is " . $_POST['userCLpasswd2A'] . " ";
//echo "userCLpassword2B is " . $_POST['userCLpasswd2B'] . " ";
if(empty($_SESSION['userCLid'])) error_message("Sorry, you're no longer logged in. Please refresh the page and log in using the link at the top.");
if(empty($_POST['userCLpasswd'])) error_message("Enter your old password.");
if(ereg("[^a-zA-Z0-9]", $_POST['userCLpasswd'])) error_message("Only letters and numbers allowed in passwords");
if(empty($_POST['userCLpassword2A'])) error_message("Enter your new password.");
if(ereg("[^a-zA-Z0-9]", $_POST['userCLpassword2A'])) error_message("Only letters and numbers allowed in passwords");
if(empty($_POST['userCLpassword2B'])) error_message("Retype your new password.");
if(ereg("[^a-zA-Z0-9]", $_POST['userCLpassword2B'])) error_message("Only letters and numbers allowed in passwords");
if(empty($_POST['password_hint'])) error_message("Enter a hint for your password.");
if(ereg("[^a-zA-Z0-9\ '_-]", $_POST['password_hint'])) error_message("Only numbers, letters, dashes, underscores and spaces allowed in password hint");
if($_POST['userCLpassword2A'] != $_POST['userCLpassword2B']) error_message("Passwords don't match!");
$link_id = db_connect(); ///line 122
//UPDATE the CLient password
$tempuserCLid=$_SESSION['userCLid'];
$tempuserCLpassword2A=$_POST['userCLpassword2A'];
$tempuserCLpasswd=$_POST['userCLpasswd'];
$password_hint=$_POST['password_hint'];
$userCLprov=$_SESSION['userCLprov'];
if($userCLprov=="BC"){$clients_db = "clients";$hinttab="hints";}
else if($userCLprov=="AB"){$clients_db = "clients_ab";$hinttab="hints_ab";}
else if($userCLprov=="SK"){$clients_db = "clients_sk";$hinttab="hints_sk";}
else if($userCLprov=="MB"){$clients_db = "clients_mb";$hinttab="hints_mb";}
else if($userCLprov=="ON"){$clients_db = "clients_on";$hinttab="hints_on";}
else if($userCLprov=="QC"){$clients_db = "clients_qc";$hinttab="hints_qc";}
else if($userCLprov=="NB"){$clients_db = "clients_nb";$hinttab="hints_nb";}
else if($userCLprov=="NS"){$clients_db = "clients_ns";$hinttab="hints_ns";}
else if($userCLprov=="PE"){$clients_db = "clients_pe";$hinttab="hints_pe";}
else if($userCLprov=="NL"){$clients_db = "clients_nl";$hinttab="hints_nl";}
else if($userCLprov=="YK"){$clients_db = "clients_yk";$hinttab="hints_yk";}
else if($userCLprov=="NW"){$clients_db = "clients_nw";$hinttab="hints_nw";}
else if($userCLprov=="NV"){$clients_db = "clients_nv";$hinttab="hints_nv";}
else {$clients_db = "clients";}
$query="UPDATE $clients_db SET userCLpassword = password('$tempuserCLpassword2A')
WHERE CL_id = '$tempuserCLid' AND userCLpassword = password('$tempuserCLpasswd')";
$result=mysql_query($query);
if(!$result) {error_message(sql_error());}
$result2=mysql_affected_rows($link_id);
if($result2)
{
$link_id1 = db_connect();
if(!$link_id1) die(sql_error());
$hintQ="UPDATE $hinttab SET hint='$password_hint' WHERE user_id='$tempuserCLid' and user_type=2";
$hintR=mysql_query($hintQ);
if(!$hintR){error_message("Error 1123");}
?>
, thanks for updating your password!
If you want to logout, click here.";
}
/////OMITTED THE DISPLAY INFO below////
?>No client logged in. If you are a client, log in here ";}
else {echo "If you want to logout, click here.";
change_CL_password_form();
echo " If you wish to update your registration, click " . "here.";
echo " If you want to check available appointments, click ";
echo "here.";
}
break;
}
echo "