/home/techb158/workloadmatch.com/workloadmatch.com/Manager/Inc
Edit: /home/techb158/workloadmatch.com/workloadmatch.com/Manager/Inc/Update_Profile.php (4816B)
The email address you entered is not valid';
}
$Phones =$_POST['Phone'];
$rx = "/
(1)?\D* # optional country code
(\d{3})?\D* # optional area code
(\d{3})\D* # first three
(\d{4}) # last four
(?:\D+|$) # extension delimiter or EOL
(\d*) # optional extension
/x";
preg_match($rx, $Phones, $matches);
if(!isset($matches[0])) return false;
$country = $matches[1];
$area = $matches[2];
$three = $matches[3];
$four = $matches[4];
$ext = $matches[5];
$Phones= $area.''.$three.''.$four;
//header('Location: profile.php?error='.$FUserNames .' '. $random_salt .' '. $LUserNames .' '. $Address .' '. $Phones .' '. $CompanyNames .' '. $Admin_ID .' '. $email .' '. $password);
// exit();
//$error_msg .= $FUserNames .' '. $Admin_ID .' '. $LUserNames;
// $error_msg .= $FUserNames .' '. $random_salt .' '. $LUserNames .' '. $Address .' '. $Phones .' '. $CompanyNames .' '. $Admin_ID .' '. $email .' '. $password ;
$user_n=$_SESSION['user_id'];
$stmt = $mysqli->prepare('SELECT * FROM Manager_Profile WHERE Manager_ID = ?');
$stmt->bind_param('s', $user_n);
$stmt->execute();
$result = $stmt->get_result();
//$row = $result->fetch_assoc();
$count =$result->num_rows;
if($count > 0)
{
if (empty($error_msg)) {
if (!$mysqli->query("UPDATE Manager_Profile SET First_Name='$FUserNames', Last_name='$LUserNames', Company_Name ='$CompanyNames', Email='$email', Phone ='".$Phones."', Company_Phone ='$Company_Phone', Address ='$Address', prof_lang='$prof_lang', SMS_Carrier='$Access_Carrier' WHERE User_Name ='$Admin_ID' AND Manager_ID ='$user_n'")) {
// header('Location: profile.php?error='.$mysqli->error);
header('Location: profile.php?error=Manager failure to update!');
exit();
}
}
header('Location: profile.php?error=Manager is Updated successfully. Thanks!');
exit();
}
}else
{
header('Location: profile.php?error=all information are required!');
exit();
}
}else if(isset($_POST["submits"]) && $_POST["submits"]!="") {
if (isset ($_POST['p'])) {
$password = filter_input(INPUT_POST, 'p', FILTER_SANITIZE_STRING);
if (strlen($password) != 128) {
// The hashed pwd should be 128 characters long.
// If it's not, something really odd has happened
$error_msg .= '
Invalid password configuration.
';
}
$random_salt = hash('sha512', uniqid(openssl_random_pseudo_bytes(16), TRUE));
// Create salted password
$password = hash('sha512', $password . $random_salt);
//$error_msg .= $FUserNames .' '. $Admin_ID .' '. $LUserNames;
// $error_msg .= $FUserNames .' '. $random_salt .' '. $LUserNames .' '. $Address .' '. $Phones .' '. $CompanyNames .' '. $Admin_ID .' '. $email .' '. $password ;
$user_n=$_SESSION['user_id'];
$stmt = $mysqli->prepare('SELECT * FROM Manager_Profile WHERE Manager_ID = ?');
$stmt->bind_param('s', $user_n);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$count =$result->num_rows;
if($count > 0)
{
if (empty($error_msg)) {
if (!$mysqli->query("UPDATE Manager_Profile SET Password ='$password', salt='$random_salt' WHERE User_Name ='".$row['User_Name']."' AND Manager_ID ='".$user_n."'")) {
// header('Location: profile.php?error='.$mysqli->error);
header('Location: profile.php?error=Manager password failure to update!');
exit();
}
}
header('Location: profile.php?error=Manager password is updated successfully. Thanks!');
exit();
}
}else
{
header('Location: profile.php?error=all information are required!');
exit();
}
}